From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3625 invoked by alias); 6 Oct 2006 23:17:16 -0000 Received: (qmail 3612 invoked by uid 22791); 6 Oct 2006 23:17:14 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from gw.goop.org (HELO mail.goop.org) (64.81.55.164) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Oct 2006 23:17:11 +0000 Received: by lurch.goop.org (Postfix, from userid 525) id 4B9F22C8042; Fri, 6 Oct 2006 16:17:06 -0700 (PDT) Received: from lurch.goop.org (localhost [127.0.0.1]) by lurch.goop.org (Postfix) with ESMTP id 688DC2C803B; Fri, 6 Oct 2006 16:17:05 -0700 (PDT) Received: from [192.168.250.53] (207.47.60.101.static.nextweb.net [207.47.60.101]) by lurch.goop.org (Postfix) with ESMTP; Fri, 6 Oct 2006 16:17:05 -0700 (PDT) Message-ID: <4526E3F5.9040400@goop.org> Date: Fri, 06 Oct 2006 23:17:00 -0000 From: Jeremy Fitzhardinge User-Agent: Thunderbird 1.5.0.7 (X11/20061004) MIME-Version: 1.0 To: Steven Rostedt CC: Vara Prasad , Alan Cox , "Frank Ch. Eigler" , Ingo Molnar , Paul Mundt , Mathieu Desnoyers , linux-kernel , Jes Sorensen , Andrew Morton , Tom Zanussi , Richard J Moore , Michel Dagenais , Christoph Hellwig , Greg Kroah-Hartman , Thomas Gleixner , William Cohen , "Martin J. Bligh" , systemtap Subject: Re: tracepoint maintainance models References: <20060917143623.GB15534@elte.hu> <20060917153633.GA29987@Krystal> <20060918000703.GA22752@elte.hu> <450DF28E.3050101@opersys.com> <20060918011352.GB30835@elte.hu> <20060918122527.GC3951@redhat.com> <20060918150231.GA8197@elte.hu> <1158594491.6069.125.camel@localhost.localdomain> <20060918152230.GA12631@elte.hu> <1158596341.6069.130.camel@localhost.localdomain> <20060918161526.GL3951@redhat.com> <1158598927.6069.141.camel@localhost.localdomain> <450EEF2E.3090302@us.ibm.com> <1158608981.6069.167.camel@localhost.localdomain> <450F0180.1040606@us.ibm.com> <1160112791.30146.12.camel@localhost.localdomain> In-Reply-To: <1160112791.30146.12.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP by lurch.goop.org Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00044.txt.bz2 Steven Rostedt wrote: > Coming into this really late, and I'm still behind in reading this and > related threads, but I want to throw this idea out, and it's getting > late. > > On Mon, 2006-09-18 at 13:28 -0700, Vara Prasad wrote: > >> Alan Cox wrote: >> >> >>>> This still doesn't solve the problem of compiler optimizing such that a >>>> variable i would like to read in my probe not being available at the >>>> probe point. >>>> >>>> >>>> >>> Then what we really need by the sound of it is enough gcc smarts to do >>> something of the form >>> >>> .section "debugbits" >>> >>> .asciiz 'hook_sched' >>> .dword l1 # Address to probe >>> .word 1 # Argument count >>> .dword gcc_magic_whatregister("next"); [ reg num or memory ] >>> .dword gcc_magic_whataddress("next"); [ address if exists] >>> >>> >>> Can gcc do any of that for us today ? >>> >>> >>> >>> >> No, gcc doesn't do that today. >> >> >> > > > ---- cut here ---- > #include > > #define MARK(label, var) \ > asm ("debug_" #label ":\n" \ > ".section .data\n" \ > #label "_" #var ": xor %0,%0\n" \ > ".previous" : : "r"(var)) > That's a nice idea. As Frank pointed out, it does force things into register. You could use "rm" as a constraint, so you can also get the location wherever it exists. It will still force gcc into keeping the value around at all, but presumably if its interesting for a mark, its interesting to keep: asm volatile("..." \ #label "_" #var ": mov %0,%%eax\n" \ ".previous" : : "rm" (var)) and, aside from the naming issues, it could be a general expression rather than a specific variable. Of course, this requires a more complex addressing mode decoder, but it does give gcc more flexibility. And in principle this is all redundant, since DWARF should be able to encode all this too, and if you make use of the variable as an asm argument, gcc really should be outputting the debug info about it. J