From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6365-0007gs-Ov for qemu-devel@nongnu.org; Tue, 20 Sep 2011 12:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6360-0002wb-4a for qemu-devel@nongnu.org; Tue, 20 Sep 2011 12:23:01 -0400 Received: from mail.openrapids.net ([64.15.138.104]:45420 helo=blackscsi.openrapids.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R635z-0002vS-WC for qemu-devel@nongnu.org; Tue, 20 Sep 2011 12:22:56 -0400 Received: from localhost (localhost [127.0.0.1]) by blackscsi.openrapids.net (Postfix) with ESMTP id B3550140455 for ; Tue, 20 Sep 2011 12:22:55 -0400 (EDT) Received: from blackscsi.openrapids.net ([127.0.0.1]) by localhost (blackscsi.openrapids.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ImlqlhZC-sGa for ; Tue, 20 Sep 2011 12:22:55 -0400 (EDT) Received: from krystal.dyndns.org (localhost [127.0.0.1]) by blackscsi.openrapids.net (Postfix) with ESMTP id B554F140456 for ; Tue, 20 Sep 2011 12:22:53 -0400 (EDT) Date: Tue, 20 Sep 2011 12:22:53 -0400 From: Mathieu Desnoyers Message-ID: <20110920162253.GA26358@Krystal> References: <20110916165933.16620.4383.stgit@ginnungagap.bsc.es> <20110916165938.16620.54932.stgit@ginnungagap.bsc.es> <20110920115202.GB23976@stefanha-thinkpad.localdomain> <87ty87z849.fsf@ginnungagap.bsc.es> <20110920143112.GA14814@Krystal> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Subject: Re: [Qemu-devel] [ltt-dev] [PATCH 2/3] trace: [ust] Do not use 'm' in event argument names (used by ust macros) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ltt-dev@lists.casi.polymtl.ca, =?iso-8859-1?Q?Llu=EDs?= Vilanova , qemu-devel@nongnu.org * Stefan Hajnoczi (stefanha@gmail.com) wrote: > 2011/9/20 Mathieu Desnoyers : > > * Llu=C3=ADs Vilanova (vilanova@ac.upc.edu) wrote: > >> Stefan Hajnoczi writes: > >> > >> > On Fri, Sep 16, 2011 at 06:59:38PM +0200, Llu=C3=ADs Vilanova wrote: > >> >> Signed-off-by: Llu=C3=ADs Vilanova > >> >> --- > >> >> trace-events | =C2=A0 =C2=A04 ++-- > >> >> 1 files changed, 2 insertions(+), 2 deletions(-) > >> >> > >> >> diff --git a/trace-events b/trace-events > >> >> index 9d1fbbb..b653d70 100644 > >> >> --- a/trace-events > >> >> +++ b/trace-events > >> >> @@ -418,8 +418,8 @@ milkymist_pfpu_pulse_irq(void) "Pulse IRQ" > >> >> # hw/milkymist-softusb.c > >> >> milkymist_softusb_memory_read(uint32_t addr, uint32_t value) "addr = %08x value %08x" > >> >> milkymist_softusb_memory_write(uint32_t addr, uint32_t value) "addr= %08x value %08x" > >> >> -milkymist_softusb_mevt(uint8_t m) "m %d" > >> >> -milkymist_softusb_kevt(uint8_t m) "m %d" > >> >> +milkymist_softusb_mevt(uint8_t _m) "m %d" > >> >> +milkymist_softusb_kevt(uint8_t _m) "m %d" > >> > >> > The LTTng community has been very responsive in addressing namespace > >> > issues with libust. =C2=A0Let's post more details and see if it can = be fixed > >> > in libust. > >> > >> > Could you please post your gcc and libust versions? > >> > >> > I have not been able to reproduce the problem on Debian libust-dev > >> > 0.15-3. =C2=A0My gcc version is Debian gcc 4.6.1-4. > >> > >> Yup, I was using libust-dev 0.5 (debian stable). After switching to 0.= 15 (debian > >> testing) other problems arise. > >> > >> For example, in my box compiling osdep.c yields lots of "variable =E2= =80=98__tp_cb_data=E2=80=99 > >> set but not used", but using a minimal example does not raise such pro= blems, so > >> I'm assuming this is related to some namespace problems related to som= e other > >> code in qemu's headers. > > > > If you can find a few minutes to provide: > > > > 1) a link to the git repository/commit ID you are testing > > 2) the exact configuration you use (detailed way to reproduce the > > =C2=A0 problem, as a sequence of commands from a pristine repository) > > > > It will allow me to look into this warning and fix it. >=20 > AFAICT the only problem with libust is the __tp_cb_data set but not > used warning that gcc 4.6 emits, see my test program: >=20 > #include > #include >=20 > DECLARE_TRACE(ust_milkymist_softusb_mevt, TP_PROTO(uint8_t m), > TP_ARGS(m)); >=20 > int main(int argc, char **argv) > { > return 0; > } >=20 > You will get an error with gcc 4.6 and libust 0.15: >=20 > $ gcc -o a -Wall a.c Ah, I see. This is due to the backward compatibility API I added in 0.15 for qemu. It skips using the __tp_cb_data private data. So it does make sense that the compiler complains about this. I can add a __attribute__((unused)), as proposed by Llu=C3=ADs. >=20 > QEMU itself does have one problem with libust 0.15. We do > DECLARE_TRACE(name, TP_PROTO(void), TP_ARGS()). This results in a > compiler error but we can fix this my changing our tracepoints to use > DECLARE_TRACE(name, TP_PROTO(), TP_ARGS()) I think. Perhaps libust's > behavior here has changed, it shouldn't be hard to update QEMU's > tracetool tracepoint generator though. For tracepoints without arguments, you need to use something like: TRACEPOINT_EVENT_NOARGS(name, TP_FIELDS()) (note: the full support of TP_FIELDS() declaration will come in UST 2.0. For UST 0.15, it's just ignored) The _NOARGS variant lets you handle the (void) 0 parameter case. Thanks, Mathieu >=20 > If you adapt the example program I used above to use TP_PROTO(void), > TP_ARGS() then you get this error: >=20 > a.c: In function =E2=80=98__trace_ust_milkymist_softusb_mevt=E2=80=99: > a.c:4:1: error: expected declaration specifiers or =E2=80=98...=E2=80=99 = before =E2=80=98)=E2=80=99 token > a.c:4:1: error: expected =E2=80=98)=E2=80=99 before =E2=80=98__tp_it_func= =E2=80=99 > a.c:4:1: error: expected expression before =E2=80=98)=E2=80=99 token > a.c:4:1: warning: variable =E2=80=98__tp_it_func=E2=80=99 set but not used > [-Wunused-but-set-variable] > a.c: At top level: > a.c:4:1: error: expected declaration specifiers or =E2=80=98...=E2=80=99 = before =E2=80=98)=E2=80=99 token > a.c:4:1: error: expected =E2=80=98;=E2=80=99, =E2=80=98,=E2=80=99 or =E2= =80=98)=E2=80=99 before =E2=80=98void=E2=80=99 > a.c:4:1: error: expected declaration specifiers or =E2=80=98...=E2=80=99 = before =E2=80=98)=E2=80=99 token > a.c:4:1: error: expected =E2=80=98;=E2=80=99, =E2=80=98,=E2=80=99 or =E2= =80=98)=E2=80=99 before =E2=80=98void=E2=80=99 > a.c: In function =E2=80=98trace_ust_milkymist_softusb_mevt=E2=80=99: > a.c:4:1: warning: variable =E2=80=98__tp_cb_data=E2=80=99 set but not used > [-Wunused-but-set-variable] >=20 > I can't say for sure whether I ever tested old libust versions with > void tracepoints. Perhaps we simply never had any and the tracetool > generator has always been broken. Or perhaps libust changed its > behavior. >=20 > Stefan >=20 --=20 Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com