From: vilanova@ac.upc.edu (Lluís Vilanova)
Subject: [ltt-dev] [Qemu-devel] [PATCH 2/3] trace: [ust] Do not use 'm' in event argument names (used by ust macros)
Date: Tue, 20 Sep 2011 17:12:10 +0200 [thread overview]
Message-ID: <87k493w8mt.fsf@ginnungagap.bsc.es> (raw)
In-Reply-To: <CAJSP0QWur0sBo4utoTwPK2Le9VocNRBaFEdh85L9sZy+ZwxqtQ@mail.gmail.com> (Stefan Hajnoczi's message of "Tue, 20 Sep 2011 15:41:02 +0100")
Stefan Hajnoczi writes:
> 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:
Here's a prettified version of the failing (pre-processed) code:
static inline
void
trace_ust_g_malloc(size_t size, void* ptr)
{
do {
if (__builtin_expect(!!(__tracepoint_ust_g_malloc.state), 0))
do {
struct tracepoint_probe *__tp_it_probe_ptr;
void *__tp_it_func;
void *__tp_cb_data;
rcu_read_lock_bp();
__tp_it_probe_ptr = ({ typeof((&__tracepoint_ust_g_malloc)->probes) _________p1 = rcu_dereference_sym((void *)((&__tracepoint_ust_g_malloc)->probes)); (_________p1); });
if (__tp_it_probe_ptr) {
do {
__tp_it_func = __tp_it_probe_ptr->func;
__tp_cb_data = __tp_it_probe_ptr->data;
((void(*)(size_t size, void* ptr))__tp_it_func)(size, ptr);
} while ((++__tp_it_probe_ptr)->func); }
rcu_read_unlock_bp();
} while (0);
} while (0);
}
Which is produced by the "__DO_TRACE" macro in "ust/tracepoint.h". The original
code is:
DECLARE_TRACE(ust_g_malloc, TP_PROTO(size_t size, void* ptr), TP_ARGS(size, ptr));
#define trace_g_malloc trace_ust_g_malloc
I don't know about the portability requirements in UST, but if supporting only
gcc is an option, you can simply use this line in the macro:
void *__tp_cb_data __attribute__((unused));
Even with this fixed, there still seem to be problems with events without
parameters:
DECLARE_TRACE(ust_slavio_misc_update_irq_raise, TP_PROTO(void), TP_ARGS());
#define trace_slavio_misc_update_irq_raise trace_ust_slavio_misc_update_irq_raise
./trace.h: In function ?__trace_ust_slavio_misc_update_irq_raise?:
./trace.h:361:1: error: ?void? must be the only parameter
./trace.h:361:1: error: expected expression before ?)? token
./trace.h:361:1: error: too many arguments to function ?(void (*)(void *))__tp_it_func?
The debian/testing version of ust is 0.15, and the sources have a ChangeLog with
this at the top:
2011-07-15 ust 0.15
* Add backward compability for tracepoint API (still planned for
deprecation, but should make the transition smoother).
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
next prev parent reply other threads:[~2011-09-20 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110916165933.16620.4383.stgit@ginnungagap.bsc.es>
[not found] ` <20110916165938.16620.54932.stgit@ginnungagap.bsc.es>
2011-09-20 11:52 ` Stefan Hajnoczi
2011-09-20 12:55 ` Lluís Vilanova
2011-09-20 14:31 ` Mathieu Desnoyers
2011-09-20 14:41 ` Stefan Hajnoczi
2011-09-20 15:12 ` Lluís Vilanova [this message]
2011-09-20 16:22 ` Mathieu Desnoyers
2011-09-20 16:22 ` Mathieu Desnoyers
2011-09-21 8:28 ` Stefan Hajnoczi
2011-09-20 14:22 ` Mathieu Desnoyers
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=87k493w8mt.fsf@ginnungagap.bsc.es \
--to=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