From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15490 invoked by alias); 4 Sep 2010 09:26:21 -0000 Received: (qmail 15477 invoked by uid 22791); 4 Sep 2010 09:26:20 -0000 X-SWARE-Spam-Status: No, hits=-1.7 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-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 09:26:14 +0000 Received: by iwn33 with SMTP id 33so3291819iwn.0 for ; Sat, 04 Sep 2010 02:26:13 -0700 (PDT) Received: by 10.231.157.11 with SMTP id z11mr2479035ibw.147.1283592372858; Sat, 04 Sep 2010 02:26:12 -0700 (PDT) Received: from [192.168.1.239] ([202.201.14.141]) by mx.google.com with ESMTPS id z6sm3096812ibc.18.2010.09.04.02.26.08 (version=SSLv3 cipher=RC4-MD5); Sat, 04 Sep 2010 02:26:12 -0700 (PDT) Subject: Re: Linux Kernel GDB tracepoint module 2010-8-30 release From: Steven To: Hui Zhu Cc: "gdb@sourceware.org" , linux-kernel@vger.kernel.org, Michael Snyder , Marc Khouzam , Thiago Jung Bauermann , "Frank Ch. Eigler" In-Reply-To: References: <1283504768.2100.43.camel@steven> <1283590584.1685.39.camel@steven> Content-Type: text/plain; charset="UTF-8" Date: Sat, 04 Sep 2010 09:26:00 -0000 Message-ID: <1283592366.1685.50.camel@steven> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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/msg00027.txt.bz2 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 += -O2 > > to > > KBUILD_CFLAGS += -O0 > > Cool, :) > > I try just change the compile option of readdir.c to without -O2, it > works OK. I 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): -------- (gdb) trace vfs_readdir Tracepoint 3 at 0xc11756a0: file fs/readdir.c, line 24. (gdb) actions Enter actions for tracepoint 3, one per line. End with a line saying just "end". >collect *file >end (gdb) trace fs/readdir.c:29 Tracepoint 4 at 0xc11756ca: file fs/readdir.c, line 29. (gdb) actions Enter actions for tracepoint 4, one per line. End with a line saying just "end". >collect res >end (gdb) tstart (gdb) tstop (gdb) tfind Found trace frame 0, tracepoint 3 #0 0xc11756a1 in vfs_readdir (file=0xc7b2cf00, filler=0, buf=0x0) at fs/readdir.c:24 24 struct inode *inode = file->f_path.dentry->d_inode; (gdb) p *file $4 = {f_u = {fu_list = {next = 0xc6dca500, prev = 0xc7ade480}, fu_rcuhead = { next = 0xc6dca500, func = 0xc7ade480}}, f_path = {mnt = 0xc6c05300, dentry = 0xc761d440}, f_op = 0xc1709a20, f_lock = {{rlock = {raw_lock = { slock = 0}}}}, f_count = {counter = 2}, f_flags = 624640, f_mode = 29, f_pos = 0, f_owner = {lock = {raw_lock = {lock = 16777216}}, = 0start = 0, size = 0, async_size = 0, ra_pages = 32, mmap_miss = 0, prev_pos = -1}, f_version = 0, f_security = 0xc7b30120, private_data = 0x0, f_ep_links = { next = 0xc7b2cf74, prev = 0xc7b2cf74}, f_mapping = 0xc761c74c} (gdb) p res $5 = 0 (gdb) tfind Found trace frame 1, tracepoint 4 0xc11756cb 29 res = security_file_permission(file, MAY_READ); (gdb) p res $6 = -20 --------