From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14172 invoked by alias); 4 Sep 2010 14:59:12 -0000 Received: (qmail 14163 invoked by uid 22791); 4 Sep 2010 14:59:10 -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 14:59:05 +0000 Received: by wwi14 with SMTP id 14so1737279wwi.12 for ; Sat, 04 Sep 2010 07:59:03 -0700 (PDT) Received: by 10.227.130.203 with SMTP id u11mr653341wbs.220.1283612343139; Sat, 04 Sep 2010 07:59:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.213 with HTTP; Sat, 4 Sep 2010 07:58:43 -0700 (PDT) In-Reply-To: <1283592366.1685.50.camel@steven> References: <1283504768.2100.43.camel@steven> <1283590584.1685.39.camel@steven> <1283592366.1685.50.camel@steven> From: Hui Zhu Date: Sat, 04 Sep 2010 14:59:00 -0000 Message-ID: Subject: Re: Linux Kernel GDB tracepoint module 2010-8-30 release To: Steven Cc: "gdb@sourceware.org" , linux-kernel@vger.kernel.org, Michael Snyder , Marc Khouzam , Thiago Jung Bauermann , "Frank Ch. Eigler" 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/msg00028.txt.bz2 On Sat, Sep 4, 2010 at 17:26, Steven wrote: > On Sat, 2010-09-04 at 17:17 +0800, Hui Zhu wrote: >> On Sat, Sep 4, 2010 at 16:56, Steven wrote: >> > On Sat, 2010-09-04 at 11:41 +0800, Hui Zhu wrote: >> >> BTW, looks GCC and GDB don't want handle the optimization debug >> >> trouble (all they want is rewrite the GCC in C++ :P). >> >> So I think make linux kernel can close optimization is better idea, do >> >> you know some way or some patch to do it? >> >> >> > >> > Just disable CONFIG_CC_OPTIMIZE_FOR_SIZE and modify the Makefile of >> > kernel: >> > KBUILD_CFLAGS =A0 +=3D -O2 >> > to >> > KBUILD_CFLAGS =A0 +=3D -O0 >> >> Cool, =A0:) >> >> I try just change the compile option of readdir.c to without -O2, it >> works OK. =A0I think maybe it's a GDB bug too. >> Could you try the second issue with gdb 7.2? > > I have covered the two issues in the previous mail that I could collect > both global variables and locals(-O0 kernel + gdb7.2): > > =A0 =A0 =A0 =A0-------- > =A0 =A0 =A0 =A0(gdb) trace vfs_readdir > =A0 =A0 =A0 =A0Tracepoint 3 at 0xc11756a0: file fs/readdir.c, line 24. > =A0 =A0 =A0 =A0(gdb) actions > =A0 =A0 =A0 =A0Enter actions for tracepoint 3, one per line. > =A0 =A0 =A0 =A0End with a line saying just "end". > =A0 =A0 =A0 =A0>collect *file > =A0 =A0 =A0 =A0>end > =A0 =A0 =A0 =A0(gdb) trace fs/readdir.c:29 > =A0 =A0 =A0 =A0Tracepoint 4 at 0xc11756ca: file fs/readdir.c, line 29. > =A0 =A0 =A0 =A0(gdb) actions > =A0 =A0 =A0 =A0Enter actions for tracepoint 4, one per line. > =A0 =A0 =A0 =A0End with a line saying just "end". > =A0 =A0 =A0 =A0>collect res > =A0 =A0 =A0 =A0>end > =A0 =A0 =A0 =A0(gdb) tstart > =A0 =A0 =A0 =A0(gdb) tstop > =A0 =A0 =A0 =A0(gdb) tfind > =A0 =A0 =A0 =A0Found trace frame 0, tracepoint 3 > =A0 =A0 =A0 =A0#0 =A00xc11756a1 in vfs_readdir (file=3D0xc7b2cf00, filler= =3D0, > =A0 =A0 =A0 =A0buf=3D0x0) > =A0 =A0 =A0 =A0 =A0 =A0at fs/readdir.c:24 > =A0 =A0 =A0 =A024 =A0 =A0 =A0 =A0 =A0 =A0 =A0struct inode *inode =3D > =A0 =A0 =A0 =A0file->f_path.dentry->d_inode; > =A0 =A0 =A0 =A0(gdb) p *file > =A0 =A0 =A0 =A0$4 =3D {f_u =3D {fu_list =3D {next =3D 0xc6dca500, prev = =3D 0xc7ade480}, > =A0 =A0 =A0 =A0fu_rcuhead =3D { > =A0 =A0 =A0 =A0 =A0 =A0 =A0next =3D 0xc6dca500, func =3D 0xc7ade480}}, f_= path =3D {mnt =3D > =A0 =A0 =A0 =A00xc6c05300, > =A0 =A0 =A0 =A0 =A0 =A0dentry =3D 0xc761d440}, f_op =3D 0xc1709a20, f_loc= k =3D {{rlock =3D > =A0 =A0 =A0 =A0{raw_lock =3D { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0slock =3D 0}}}}, f_count =3D {counter = =3D 2}, f_flags =3D > =A0 =A0 =A0 =A0624640, > =A0 =A0 =A0 =A0 =A0f_mode =3D 29, f_pos =3D 0, f_owner =3D {lock =3D {raw= _lock =3D {lock =3D > =A0 =A0 =A0 =A016777216}}, > =A0 =A0 =A0 =A0 =A0 =3D 0start =3D 0, size =3D 0, async_size =3D 0, > =A0 =A0 =A0 =A0 =A0 =A0ra_pages =3D 32, mmap_miss =3D 0, prev_pos =3D -1}= , f_version =3D > =A0 =A0 =A0 =A00, > =A0 =A0 =A0 =A0 =A0f_security =3D 0xc7b30120, private_data =3D 0x0, f_ep_= links =3D { > =A0 =A0 =A0 =A0 =A0 =A0next =3D 0xc7b2cf74, prev =3D 0xc7b2cf74}, f_mappi= ng =3D > =A0 =A0 =A0 =A00xc761c74c} > =A0 =A0 =A0 =A0(gdb) p res > =A0 =A0 =A0 =A0$5 =3D 0 > =A0 =A0 =A0 =A0(gdb) tfind > =A0 =A0 =A0 =A0Found trace frame 1, tracepoint 4 > =A0 =A0 =A0 =A00xc11756cb =A0 =A0 =A029 =A0 =A0 =A0 =A0 =A0 =A0 =A0res =3D > =A0 =A0 =A0 =A0security_file_permission(file, MAY_READ); > =A0 =A0 =A0 =A0(gdb) p res > =A0 =A0 =A0 =A0$6 =3D -20 > =A0 =A0 =A0 =A0-------- > > > Great. :) Hui