qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: ltt-dev@lists.casi.polymtl.ca,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [ltt-dev] [PATCH 2/3] trace: [ust] Do not use 'm' in event argument names (used by ust macros)
Date: Wed, 21 Sep 2011 09:28:55 +0100	[thread overview]
Message-ID: <CAJSP0QXOE-_1BEacvOAse4WU7WL_Kwa-3gFBj7JSXE=8h0O94A@mail.gmail.com> (raw)
In-Reply-To: <20110920162253.GA26358@Krystal>

On Tue, Sep 20, 2011 at 5:22 PM, Mathieu Desnoyers
<compudj@krystal.dyndns.org> wrote:
> * Stefan Hajnoczi (stefanha@gmail.com) wrote:
>> 2011/9/20 Mathieu Desnoyers <compudj@krystal.dyndns.org>:
>> > * Lluís Vilanova (vilanova@ac.upc.edu) wrote:
>> >> Stefan Hajnoczi writes:
>> >>
>> >> > On Fri, Sep 16, 2011 at 06:59:38PM +0200, Lluís Vilanova wrote:
>> >> >> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> >> >> ---
>> >> >> trace-events |    4 ++--
>> >> >> 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.  Let'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.  My 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 ‘__tp_cb_data’
>> >> set but not used", but using a minimal example does not raise such problems, so
>> >> I'm assuming this is related to some namespace problems related to some 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
>> >   problem, as a sequence of commands from a pristine repository)
>> >
>> > It will allow me to look into this warning and fix it.
>>
>> 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:
>>
>> #include <stdint.h>
>> #include <ust/tracepoint.h>
>>
>> DECLARE_TRACE(ust_milkymist_softusb_mevt, TP_PROTO(uint8_t m),
>> TP_ARGS(m));
>>
>> int main(int argc, char **argv)
>> {
>>        return 0;
>> }
>>
>> You will get an error with gcc 4.6 and libust 0.15:
>>
>> $ 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ís.
>
>>
>> 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.

Okay, this is the fault of QEMU's tracetool script, which generates
the LTTng UST tracepoints.  We can move to the new TRACEPOINT*()
macros and use _NOARGS as appropriate.

Stefan

  reply	other threads:[~2011-09-21  8:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 16:59 [Qemu-devel] [PATCH 1/3] trace: Fix print format for "mipsnet_write" Lluís Vilanova
2011-09-16 16:59 ` [Qemu-devel] [PATCH 2/3] trace: [ust] Do not use 'm' in event argument names (used by ust macros) Lluís Vilanova
2011-09-20 11:52   ` Stefan Hajnoczi
2011-09-20 12:55     ` Lluís Vilanova
2011-09-20 14:31       ` [Qemu-devel] [ltt-dev] " Mathieu Desnoyers
2011-09-20 14:41         ` Stefan Hajnoczi
2011-09-20 15:12           ` Lluís Vilanova
2011-09-20 16:22             ` Mathieu Desnoyers
2011-09-20 16:22           ` Mathieu Desnoyers
2011-09-21  8:28             ` Stefan Hajnoczi [this message]
2011-09-20 13:03     ` P DUMAS
2011-09-20 14:22     ` Mathieu Desnoyers
2011-09-20 11:58   ` [Qemu-devel] " Stefan Hajnoczi
2011-09-16 16:59 ` [Qemu-devel] [PATCH 3/3] trace: [ust] Do not use zero-length format strings (avoid compiler warning) Lluís Vilanova
2011-09-20  7:32 ` [Qemu-devel] [PATCH 1/3] trace: Fix print format for "mipsnet_write" Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJSP0QXOE-_1BEacvOAse4WU7WL_Kwa-3gFBj7JSXE=8h0O94A@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=compudj@krystal.dyndns.org \
    --cc=ltt-dev@lists.casi.polymtl.ca \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).