From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23762 invoked by alias); 4 Sep 2010 03:42:28 -0000 Received: (qmail 23748 invoked by uid 22791); 4 Sep 2010 03:42:26 -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,TW_SV 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 03:42:19 +0000 Received: by wwi14 with SMTP id 14so1202743wwi.12 for ; Fri, 03 Sep 2010 20:42:17 -0700 (PDT) Received: by 10.216.71.85 with SMTP id q63mr1445991wed.53.1283571737154; Fri, 03 Sep 2010 20:42:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.213 with HTTP; Fri, 3 Sep 2010 20:41:57 -0700 (PDT) In-Reply-To: <1283504768.2100.43.camel@steven> References: <1283504768.2100.43.camel@steven> From: Hui Zhu Date: Sat, 04 Sep 2010 03:42: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/msg00018.txt.bz2 Hi Steven, On Fri, Sep 3, 2010 at 17:06, Steven wrote: > Dear Hui, > > I encountered two issue when I use your GTP. > > 1) Following your HOWTO, I collect the two variables jiffies_64(global), > *file(argument), the result are as following, where you may see > jiffies_64 =3D 4298520928, that's OK, but the members of *file are all 0. > What's the problem? Thank you very much! > =A0 =A0 =A0 =A0----------------------------------------------------------= --------- > =A0 =A0 =A0 =A0(gdb) trace vfs_readdir > =A0 =A0 =A0 =A0Tracepoint 3 at 0xc1175690: file fs/readdir.c, line 23. > =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 jiffies_64 > =A0 =A0 =A0 =A0> collect *file > =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 =A0#0 =A00xc1175691 i (file=3D0x0, filler=3D0, buf=3D0x0) at > =A0 =A0 =A0 =A0fs/readdir.c:23 > =A0 =A0 =A0 =A023 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0(gdb) p jiffies_64 > =A0 =A0 =A0 =A0$7 =3D 4298520928 > =A0 =A0 =A0 =A0(gdb) p *file > =A0 =A0 =A0 =A0$8 =3D {f_u =3D {fu_list =3D {next =3D 0x0, prev =3D 0x0},= fu_rcuhead =3D > =A0 =A0 =A0 =A0{next =3D 0x0, func =3D 0}}, f_path =3D {mnt =3D 0x0, dent= ry =3D 0x0}, > =A0 =A0 =A0 =A0f_op =3D 0x0, f_lock =3D {{ rlock =3D {raw_lock =3D {slock= =3D 0}}}}, > =A0 =A0 =A0 =A0f_count =3D {counter =3D 0}, f_flags =3D 0, f_mode =3D 0, = f_pos =3D 0, > =A0 =A0 =A0 =A0f_owner =3D {lock =3D {raw_lock =3D { lock =3D 0}}, pid = =3D 0x0, pid_type > =A0 =A0 =A0 =A0=3D PIDTYPE_PID, uid =3D 0, euid =3D 0, signum =3D 0}, f_c= red =3D 0x0, > =A0 =A0 =A0 =A0f_ra =3D {stra_pages =3D 00, f_security =3D 0x0, private_d= ata =3D 0x0, > =A0 =A0 =A0 =A0f_ep_links =3D {next =3D 0x0, prev =3D 0x0}, f_mapping =3D= 0x0} > =A0 =A0 =A0 =A0----------------------------------------------------------= --------- > It looks like a old bug that I have fixed in new version. I try it in 20100830 version cannot reproduce this issue: (gdb) target remote /proc/gtp Remote debugging using /proc/gtp 0x0000000000000000 in ?? () (gdb) trace vfs_readdir Tracepoint 1 at 0xffffffff81147d3c: 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 jiffies_64 >collect *file >end (gdb) tstart (gdb) sh sharedlibrary shell show (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=09=09 sound t virt (gdb) tstop (gdb) tfind Found trace frame 0, tracepoint 1 #0 0xffffffff81147d3d in vfs_readdir (file=3D0xffff88007b22bcc0, filler=3D0xffffffff81147ba0 , buf=3D0xffff88006cc31f38) at /home/teawater/kernel/linux-2.6/fs/readdir.c:24 24 { (gdb) p jiffies_64 $1 =3D 4295113995 (gdb) p *file $2 =3D {f_u =3D {fu_list =3D {next =3D 0xffff88007b22b480, prev =3D 0xffffe8ffffc86960}, fu_rcuhead =3D {next =3D 0xffff88007b22b480, func =3D 0xffffe8ffffc86960}}, f_path =3D {mnt =3D 0xffff880037bd6b00, dentry =3D 0xffff88007e15b6c0}, f_op =3D 0xffffffff81622b00, f_lock =3D {{ rlock =3D {raw_lock =3D {slock =3D 0}}}}, f_sb_list_cpu =3D 1, f_coun= t =3D {counter =3D 2}, f_flags =3D 624640, f_mode =3D 29, f_pos =3D 0, f_owner = =3D { lock =3D {raw_lock =3D {lock =3D 16777216}}, pid =3D 0x0, pid_type =3D PIDTYPE_PID, uid =3D 0, euid =3D 0, signum =3D 0}, f_cred =3D 0xffff88007ae6f780, f_ra =3D {start =3D 0, size =3D 0, async_size =3D 0, ra_pages =3D 32, mmap_miss =3D 0, prev_pos =3D -1}, f_version =3D 0, f_security =3D 0x0, private_data =3D 0x0, f_ep_links =3D {next =3D 0xffff88007b22bd68, prev = =3D 0xffff88007b22bd68}, f_mapping =3D 0xffff880036662590} Could you try the new version? I think it will work OK. If you still meet this issue, maybe you can try with the new GDB from http://www.gnu.org/software/gdb/download/ANNOUNCEMENT > > 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 =A0Tracepoint 2 at 0xc11756ca: file fs/readdir.c, line 29. > =A0 =A0 =A0 =A0(gdb) actions > =A0 =A0 =A0 =A0Enter actions for tracepoint 2, 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 =A0res: don't know symbol class 20 This error is from GDB, I think it's a GDB bug, I will try to find out the root cause. 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? The MIPS support that you interest is check in to the KGTP truck. I just try it with a mips32el board. To cross-compile it, you need set the CROSS_COMPILE ,KERNELDIR and ARCH in Makefile. Thanks, Hui > =A0 =A0 =A0 =A0----------------------------------------------------------= --------- > > =A0 =A0 =A0 =A0Code fragment of readdir.c > =A0 =A0 =A0 =A0----------------------------------------------------------= --------- > =A0 =A0 =A0 =A0 22 int vfs_readdir(struct file *file, filldir_t filler, v= oid > =A0 =A0 =A0 =A0*buf) > =A0 =A0 =A0 =A0 23 { > =A0 =A0 =A0 =A0 24 =A0 =A0 =A0 =A0 struct inode *inode =3D file->f_path.d= entry->d_inode; > =A0 =A0 =A0 =A0 25 =A0 =A0 =A0 =A0 int res =3D -ENOTDIR; > =A0 =A0 =A0 =A0 26 =A0 =A0 =A0 =A0 if (!file->f_op || !file->f_op->readdi= r) > =A0 =A0 =A0 =A0 27 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > =A0 =A0 =A0 =A0 28 > =A0 =A0 =A0 =A0 29 =A0 =A0 =A0 =A0 res =3D security_file_permission(file,= MAY_READ); > =A0 =A0 =A0 =A0 30 =A0 =A0 =A0 =A0 if (res) > =A0 =A0 =A0 =A0 31 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > =A0 =A0 =A0 =A0----------------------------------------------------------= --------- > > Best Regards, > Steven > > > On Mon, 2010-08-30 at 15:00 +0800, Hui Zhu wrote: >> http://kgtp.googlecode.com/files/kgtp_20100830.tar.bz2 >> or >> svn co https://kgtp.googlecode.com/svn/tags/20100830 >> to get it. >> >> Fix bug in ref16, ref32, ref64 in issue >> https://code.google.com/p/kgtp/issues/detail?id=3D2 >> Fix bug that disable some tracepoint will make "tstart" get error. >> >> Support qtstatus. Then KGTP support GDB command "tstatus". >> Add support for "make install" and "make uninstall". >> Add support for qtro. Fix a bug about GTP_GDBRSP_REG_SIZE. >> >> Change gtp_list make it more efficient. >> >> Please goto http://code.google.com/p/kgtp/wiki/HOWTO to get more info >> about how to use KGTP. > > >