From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21520 invoked by alias); 4 Sep 2010 16:35:25 -0000 Received: (qmail 21512 invoked by uid 22791); 4 Sep 2010 16:35: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-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 16:34:45 +0000 Received: by wyb36 with SMTP id 36so3582829wyb.0 for ; Sat, 04 Sep 2010 09:34:42 -0700 (PDT) Received: by 10.216.54.9 with SMTP id h9mr1085920wec.34.1283618082214; Sat, 04 Sep 2010 09:34:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.213 with HTTP; Sat, 4 Sep 2010 09:34:22 -0700 (PDT) In-Reply-To: References: <1283504768.2100.43.camel@steven> From: Hui Zhu Date: Sat, 04 Sep 2010 16:35: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/msg00031.txt.bz2 Hi Frank, I try systemtrap but got some error: 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$) > } parse error: expected literal string or number saw: embedded-code at ./1.sh:3:14 source: println(%{ jiffies_64 %}) ^ parse error: expected statement saw: ./1.sh EOF 2 parse error(s). Pass 1: parse failed. Try again with another '--vp 1' option. > > >> 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) > } > semantic error: not accessible at this address: identifier '$res' at ./1.sh= :3:14 source: println($res) ^ Pass 2: analysis failed. Try again with another '--vp 01' option. [1]+ Done gedit 1.sh Could you help me with it? Thanks, Hui