From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24361 invoked by alias); 4 Sep 2010 04:30:25 -0000 Received: (qmail 24344 invoked by uid 22791); 4 Sep 2010 04:30:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 04:30:18 +0000 Received: by wwi14 with SMTP id 14so1238658wwi.12 for ; Fri, 03 Sep 2010 21:30:16 -0700 (PDT) Received: by 10.216.17.211 with SMTP id j61mr1499852wej.14.1283574616250; Fri, 03 Sep 2010 21:30:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.213 with HTTP; Fri, 3 Sep 2010 21:29:56 -0700 (PDT) In-Reply-To: References: <1283504768.2100.43.camel@steven> From: Hui Zhu Date: Sat, 04 Sep 2010 04:30:00 -0000 Message-ID: Subject: Re: Linux Kernel GDB tracepoint module 2010-8-30 release To: "Frank Ch. Eigler" Cc: Steven , "gdb@sourceware.org" , linux-kernel@vger.kernel.org, Michael Snyder , Marc Khouzam , Thiago Jung Bauermann Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-09/txt/msg00019.txt.bz2 Hi Frank, Looks systemtap are very cool. Could you talk about how it do call stack dump like following? (gdb) trace vfs_readdir Tracepoint 1 at 0xffffffff8113f7fc: file /home/teawater/kernel/linux-2.6/fs/readdir.c, line 24. (gdb) actions Enter actions for tracepoint 1, one per line. End with a line saying just "end". >collect *(unsigned char *)$rsp@512 >end (gdb) tstart (gdb) shell ls 2 block firmware i ipc Makefile modules.order scripts source t~ vmlinux a.out crypto fs include kernel mm Module.symvers security System.map usr vmlinux.o arch drivers gdb.txt init lib modules.builtin net sound t virt (gdb) tstop (gdb) tfind Found trace frame 0, tracepoint 1 #0 0xffffffff8113f7fd in vfs_readdir (file=3D0xffff880075f00780, filler=3D0xffffffff8113f630 , buf=3D0xffff880005785f38) at /home/teawater/kernel/linux-2.6/fs/readdir.c:24 24 { (gdb) bt #0 0xffffffff8113f7fd in vfs_readdir (file=3D0xffff880075f00780, filler=3D0xffffffff8113f630 , buf=3D0xffff880005785f38) at /home/teawater/kernel/linux-2.6/fs/readdir.c:24 #1 0xffffffff8113fa14 in sys_getdents (fd=3D, dirent=3D0x801108, count=3D32768) at /home/teawater/kernel/linux-2.6/fs/readdir.c:214 #2 0xffffffff8100af42 in ?? () at /home/teawater/kernel/linux-2.6/arch/x86/kernel/entry_64.S:487 BTW, I was not find out which ARCH of the systemtap support in its website? It support all the arch that kprobe support? Thanks, Hui On Fri, Sep 3, 2010 at 22:05, Frank Ch. Eigler wrote: > > Steven writes: > >> [...] >> =A0 =A0 =A0 =A0 (gdb) trace vfs_readdir >> =A0 =A0 =A0 =A0 Tracepoint 3 at 0xc1175690: file fs/readdir.c, line 23. >> =A0 =A0 =A0 =A0 (gdb) actions >> =A0 =A0 =A0 =A0 Enter actions for tracepoint 3, one per line. >> =A0 =A0 =A0 =A0 End with a line saying just "end". >> =A0 =A0 =A0 =A0 > collect jiffies_64 >> =A0 =A0 =A0 =A0 > collect *file >> =A0 =A0 =A0 =A0 > end > > By the way, the systemtap equivalent would be: > > #! /usr/bin/stap -g > probe kernel.function("vfs_readdir") { > =A0 =A0 =A0println(%{ jiffies_64 %}) > =A0 =A0 =A0println($file$) > } > > >> 2) I can not collect local variable, despite I rebuild the kernel with >> -O0 optimization option. what is the problem? Many thanks >> =A0 =A0 =A0 =A0 --------------------------------------------------------= ----------- >> =A0 =A0 =A0 =A0 (gdb) trace fs/readdir.c:29 >> =A0 =A0 =A0 =A0 Tracepoint 2 at 0xc11756ca: file fs/readdir.c, line 29. >> =A0 =A0 =A0 =A0 (gdb) actions >> =A0 =A0 =A0 =A0 Enter actions for tracepoint 2, one per line. >> =A0 =A0 =A0 =A0 End with a line saying just "end". >> =A0 =A0 =A0 =A0 > collect res >> =A0 =A0 =A0 =A0 > end > > > #! /usr/bin/stap > probe kernel.statement("*@fs/readdir.c:29") { > =A0 =A0 =A0println($res) > } > > > - FChE >