My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Quickstart  
Updated May 9, 2012 by teawa...@gmail.com

Update in 2012-05-10

Ubuntu

Preparatory work before use KGTP

http://code.google.com/p/kgtp/wiki/HOWTO#Preparatory_work_before_use_KGTP

Use KGTP

  • Mount the sysfs and debugfs:
  • sudo mount -t sysfs none /sys/
    sudo mount -t debugfs none /sys/kernel/debug/
  • Insert the KGTP module to the current Linux Kernel:
  • cd kgtp
    sudo insmod gtp.ko
  • Use GDB connect to KGTP:
  • sudo gdb-release /usr/lib/debug/boot/vmlinux-$(uname -r)
    (gdb) target remote /sys/kernel/debug/gtp
  • Do a very simple trace:
  • (gdb) trace vfs_readdir
    Tracepoint 1 at 0xc02289f0: file /build/buildd/linux-2.6.35/fs/readdir.c, line 23.
    (gdb) actions 
    Enter actions for tracepoint 1, one per line.
    End with a line saying just "end".
    >collect $reg
    >end
    (gdb) tstart 
    (gdb) shell ls
    vmlinux-2.6.35-30-generic
    (gdb) tstop 
    (gdb) tfind 
    Found trace frame 0, tracepoint 1
    #0  vfs_readdir (file=0x0, filler=0x163d8ae3, buf=0x18c0) at /build/buildd/linux-2.6.35/fs/readdir.c:23
    23	{

End

Now, you can begin to rock and roll your Linux kernel with KGTP and GDB.
Please go to HOWTO to get more message about howto use KGTP.

Fedora

Preparatory work before use KGTP

http://code.google.com/p/kgtp/wiki/HOWTO#Preparatory_work_before_use_KGTP

Use KGTP

  • Mount the sysfs and debug fs:
  • sudo mount -t sysfs none /sys/
    sudo mount -t debugfs none /sys/kernel/debug/
  • Insert the KGTP module to the current Linux Kernel:
  • cd kgtp
    sudo insmod gtp.ko
  • Use GDB connect to KGTP:
  • sudo gdb-release /usr/lib/debug/lib/modules/$(uname -r)/vmlinux
    (gdb) target remote /sys/kernel/debug/gtp
  • Do a very simple trace:
  • (gdb) trace vfs_readdir
    Tracepoint 1 at 0xffffffff8110ec9b: file fs/readdir.c, line 23.
    (gdb) actions
    Enter actions for tracepoint 1, one per line.
    End with a line saying just "end".
    >collect $reg
    >end
    (gdb) tstart
    (gdb) shell ls
    co.patch		  getframe	getmod.c   gtp.mod.c  gtp.txt	      perf_event.c
    dkms.conf		  getframe.c	getmod.py  gtp.mod.o  Makefile	      ring_buffer.c
    dkms_others_install.sh	  getgtprsp.pl	gtp.c	   gtp.o      modules.order   ring_buffer.h
    dkms_others_uninstall.sh  getmod	gtp.ko	   gtp.patch  Module.symvers
    (gdb) tstop
    (gdb) tfind 
    Found trace frame 0, tracepoint 1
    #0  vfs_readdir (file=0xffff880019d3df00, filler=0xffffffff8110eb16 <filldir>, buf=0xffff880003b39f38)
        at fs/readdir.c:23
    23	{

End

Now, you can begin to rock and roll your Linux kernel with KGTP and GDB.
Please go to HOWTO to get more message about howto use KGTP.


Sign in to add a comment
Powered by Google Project Hosting