Received: from eggs.gnu.org ([140.186.70.92]:42391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R620z-0003Y8-AU for qemu-devel@nongnu.org; Tue, 20 Sep 2011 11:13:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R620s-0002Ty-0f for qemu-devel@nongnu.org; Tue, 20 Sep 2011 11:13:41 -0400 Received: from gw.ac.upc.edu ([147.83.30.3]:43660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R620r-0002Tm-N1 for qemu-devel@nongnu.org; Tue, 20 Sep 2011 11:13:33 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= 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> Date: Tue, 20 Sep 2011 17:12:10 +0200 In-Reply-To: (Stefan Hajnoczi's message of "Tue, 20 Sep 2011 15:41:02 +0100") Message-ID: <87k493w8mt.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Mathieu Desnoyers , ltt-dev@lists.casi.polymtl.ca, qemu-devel@nongnu.org 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 =3D ({ typeof((&__tracepoint_ust_g_mall= oc)->probes) _________p1 =3D rcu_dereference_sym((void *)((&__tracepoint_us= t_g_malloc)->probes)); (_________p1); }); if (__tp_it_probe_ptr) { do { __tp_it_func =3D __tp_it_probe_ptr->func; __tp_cb_data =3D __tp_it_probe_ptr->data; ((void(*)(size_t size, void* ptr))__tp_it_func)(s= ize, 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 orig= inal code is: DECLARE_TRACE(ust_g_malloc, TP_PROTO(size_t size, void* ptr), TP_ARGS(siz= e, ptr)); #define trace_g_malloc trace_ust_g_malloc I don't know about the portability requirements in UST, but if supporting o= nly 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_i= rq_raise ./trace.h: In function =E2=80=98__trace_ust_slavio_misc_update_irq_raise= =E2=80=99: ./trace.h:361:1: error: =E2=80=98void=E2=80=99 must be the only parameter ./trace.h:361:1: error: expected expression before =E2=80=98)=E2=80=99 to= ken ./trace.h:361:1: error: too many arguments to function =E2=80=98(void (*)= (void *))__tp_it_func=E2=80=99 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 --=20 "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