From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6327 invoked by alias); 16 Aug 2010 15:35:22 -0000 Received: (qmail 6317 invoked by uid 22791); 16 Aug 2010 15:35:20 -0000 X-SWARE-Spam-Status: No, hits=1.5 required=5.0 tests=AWL,BAYES_50,RCVD_ILLEGAL_IP,TW_EB,TW_VX,TW_XF,TW_XJ X-Spam-Check-By: sourceware.org Received: from imr4.ericy.com (HELO imr4.ericy.com) (198.24.6.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Aug 2010 15:34:50 +0000 Received: from eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) by imr4.ericy.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id o7GFccaM011786; Mon, 16 Aug 2010 10:38:42 -0500 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.134]) by eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) with mapi; Mon, 16 Aug 2010 11:34:42 -0400 From: Marc Khouzam To: "'Michael Snyder'" , "'Hui Zhu'" CC: "'gdb@sourceware.org'" Date: Mon, 16 Aug 2010 15:35:00 -0000 Subject: RE: Linux Kernel GDB tracepoint module demo release Message-ID: References: <4C6311E0.5070909@vmware.com> In-Reply-To: <4C6311E0.5070909@vmware.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00094.txt.bz2 =20 > -----Original Message----- > From: gdb-owner@sourceware.org=20 > [mailto:gdb-owner@sourceware.org] On Behalf Of Michael Snyder > Sent: Wednesday, August 11, 2010 5:11 PM > To: Hui Zhu > Cc: gdb@sourceware.org; linux-kernel@vger.kernel.org > Subject: Re: Linux Kernel GDB tracepoint module demo release >=20 > Actually, this is kind of interesting. > Can your system set a tracepoint at any arbitrary location in the > kernel? If so, I think that makes it more powerful than existing > systems such as LTTng, which can only trace statically pre-determined > locations. You missed a great Tracing mini-summit at LinuxCon last Monday: http://lttng.org/tracingwiki/index.php/TracingMiniSummit2010 We discussed the different tracing technologies and talked about Kernel vs User space. So, yes, LTTng provides highly efficient _static_ tracing for the kernel. The LTTng tracepoints are already in the kernel. http://lttng.org/ There is also a new User Space Tracer (UST) provided by LTTng. http://lttng.org/ust There is also Kprobes, which are dynamic tracepoints for the Kernel. They seem very similar to GDB Tracepoints actually. http://sourceware.org/systemtap/kprobes/ Stan gave a great presentation about GDB Tracepoints and some upcoming work. And I spoke about Eclipse's support for GDB Tracepoints and for LTTng. I think having access to GDB Tracepoints for the kernel may be very nice. I imagine a user tracing both kernel and user space at the same time, using the same interface (preferably Eclipse :-)) Interesting work Hui! Marc >=20 > Hui Zhu wrote: > > Hi, > >=20 > > GDB Tracepoint=20 > (http://sourceware.org/gdb/current/onlinedocs/gdb/Tracepoints.html) > > is new feature that make GDB can debug real-time program. > > I think this feature is very fit for debug Linux Kernel.=20=20 > So I make a > > lkm to make kernel support it. You can get it in > > https://code.google.com/p/kgtp/ > >=20 > > I just release the demo for it. It just support collect $reg in > > x86_32. I will add the other tracepoint support in the future. > >=20 > > For example: > > tar vxjf gtp_20100811.tar.bz2 > > cd gtp > > make > > insmod gtp.ko > > gdb ./vmlinux > > GNU gdb (GDB) 7.2.50.20100720-cvs > > Copyright (C) 2010 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later=20 > > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. Type=20 > "show copying" > > and "show warranty" for details. > > This GDB was configured as "i686-pc-linux-gnu". > > For bug reporting instructions, please see: > > ... > > Reading symbols from /vmlinux...done. > > (gdb) target remote /proc/gtp > > Remote debugging using /proc/gtp > > 0x00000000 in ?? () > > (gdb) trace vfs_readdir > > Tracepoint 1 at 0xc01a1ac0: file > > /home/teawater/kernel/linux-2.6/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 > > (gdb) tstop > > (gdb) tfind > > Found trace frame 0, tracepoint 1 > > #0 0xc01a1ac1 in vfs_readdir (file=3D0xc5528d00,=20 > filler=3D0xc01a1900 , > > buf=3D0xc0d09f90) at=20 > /home/teawater/kernel/linux-2.6/fs/readdir.c:23 > > 23 /home/teawater/kernel/linux-2.6/fs/readdir.c: No such=20 > file or directory. > > in /home/teawater/kernel/linux-2.6/fs/readdir.c > > (gdb) info reg > > eax 0xc5528d00 -984445696 > > ecx 0xc0d09f90 -1060069488 > > edx 0xc01a1900 -1072031488 > > ebx 0xfffffff7 -9 > > esp 0xc0d09f8c 0xc0d09f8c > > ebp 0x0 0x0 > > esi 0x8061480 134616192 > > edi 0xc5528d00 -984445696 > > eip 0xc01a1ac1 0xc01a1ac1 > > eflags 0x286 [ PF SF IF ] > > cs 0x60 96 > > ss 0x8061480 134616192 > > ds 0x7b 123 > > es 0x7b 123 > > fs 0x0 0 > > gs 0x0 0 > > (gdb) tfind > > Found trace frame 1, tracepoint 1 > > 0xc01a1ac1 23 in /home/teawater/kernel/linux-2.6/fs/readdir.c > > (gdb) info reg > > eax 0xc5528d00 -984445696 > > ecx 0xc0d09f90 -1060069488 > > edx 0xc01a1900 -1072031488 > > ebx 0xfffffff7 -9 > > esp 0xc0d09f8c 0xc0d09f8c > > ebp 0x0 0x0 > > esi 0x8061480 134616192 > > edi 0xc5528d00 -984445696 > > eip 0xc01a1ac1 0xc01a1ac1 > > eflags 0x286 [ PF SF IF ] > > cs 0x60 96 > > ss 0x8061480 134616192 > > ds 0x7b 123 > > es 0x7b 123 > > fs 0x0 0 > > gs 0x0 0 > > (gdb) tfind > > Found trace frame 2, tracepoint 1 > > #0 0xc01a1ac1 in vfs_readdir (file=3D0xc5528300,=20 > filler=3D0xc01a19e0 , > > buf=3D0xc6c2df90) at=20 > /home/teawater/kernel/linux-2.6/fs/readdir.c:23 > > 23 in /home/teawater/kernel/linux-2.6/fs/readdir.c > > (gdb) > > Found trace frame 3, tracepoint 1 > > 0xc01a1ac1 23 in /home/teawater/kernel/linux-2.6/fs/readdir.c > > (gdb) > > Target failed to find requested trace frame. > > (gdb) quit > > A debugging session is active. > >=20 > > Inferior 1 [Remote target] will be killed. > >=20 > > Quit anyway? (y or n) y > >=20 > > Thanks, > > Hui >=20 >=20