Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool.
@ 2012-06-04 23:19 John Steele Scott
  2012-06-05  3:12 ` Alexandre Montplaisir
  2012-06-05 17:14 ` Mathieu Desnoyers
  0 siblings, 2 replies; 3+ messages in thread
From: John Steele Scott @ 2012-06-04 23:19 UTC (permalink / raw)


I originally sent this on the 22nd of May, but it looks like it got stuck in moderation since I'm not subscribed. Reposting via gmane.comp.sysutils.lttng.devel . . .

I'm just getting started wiring my up to lttng-ust, and unfortunately
ran into an issue with the first probe I tried, which used a C99 bool
argument.

The problem can be seen by patching the demo test from lttng-ust as
follows:

--- a/tests/demo/ust_tests_demo3.h
+++ b/tests/demo/ust_tests_demo3.h
@@ -22,12 +22,14 @@ extern "C" {
  * all copies or substantial portions of the Software.
  */
 
+#include <stdbool.h>
+
 #include <lttng/tracepoint.h>
 
 TRACEPOINT_EVENT(ust_tests_demo3, done,
-	TP_ARGS(int, value),
+	TP_ARGS(bool, value),
 	TP_FIELDS(
-		ctf_integer(int, value, value)
+		ctf_integer(bool, value, value)
 	)
 )

Then when the demo is run with LTTNG_UST_DEBUG=1, a warning is shown,
like:

liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint signature mismatch, not enabling one or more tracepoints. Ensure that the tracepoint probes prototypes match the application. (in set_tracepoint() at tracepoint.c:310)
liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint "ust_tests_demo3:done" signatures: call: "_Bool, value" vs probe: "bool, value". (in set_tracepoint() at tracepoint.c:312)

It seems that TP_ARGS does not perform preprocessor expansion on the
"bool" type spec, while something underneath TP_FIELDS does. And since
(at least on this Centos 6.2 box) stdbool.h uses a #define rather than a
typedef to make bool equivalent to _Bool, liblttng detects a mismatch.

So in my tracepoint specifications, I need to remember to use the less
attractive _Bool instead of bool.

Perhaps it's worth having a special case for this where the trace/probe
signatures are compared? On the other hand, I guess nobody complained
until now? 

cheers,

John




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool.
  2012-06-04 23:19 [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool John Steele Scott
@ 2012-06-05  3:12 ` Alexandre Montplaisir
  2012-06-05 17:14 ` Mathieu Desnoyers
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Montplaisir @ 2012-06-05  3:12 UTC (permalink / raw)


On 12-06-04 07:19 PM, John Steele Scott wrote:
> I originally sent this on the 22nd of May, but it looks like it got stuck in moderation since I'm not subscribed. Reposting via gmane.comp.sysutils.lttng.devel . . .

It seems the list stopped sending daily reminders again...
I just flushed the moderation queue, there might be some 2-3 weeks old
emails appearing. Please ignore them if they have already been replied to.


Cheers,

-- 
Alexandre Montplaisir
DORSAL lab,
?cole Polytechnique de Montr?al




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool.
  2012-06-04 23:19 [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool John Steele Scott
  2012-06-05  3:12 ` Alexandre Montplaisir
@ 2012-06-05 17:14 ` Mathieu Desnoyers
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2012-06-05 17:14 UTC (permalink / raw)


* John Steele Scott (toojays at toojays.net) wrote:
> I originally sent this on the 22nd of May, but it looks like it got stuck in moderation since I'm not subscribed. Reposting via gmane.comp.sysutils.lttng.devel . . .
> 
> I'm just getting started wiring my up to lttng-ust, and unfortunately
> ran into an issue with the first probe I tried, which used a C99 bool
> argument.

Fixed by commit:

commit 9eb061825ad8ebdf8c22d812eff0232d97d72cd2
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Tue Jun 5 13:08:54 2012 -0400

    Fix: perform macro expansion on tracepoint signatures
    
    The problem can be seen by patching the demo test from lttng-ust as
    follows:
    
    --- a/tests/demo/ust_tests_demo3.h
    +++ b/tests/demo/ust_tests_demo3.h
    @@ -22,12 +22,14 @@ extern "C" {
      * all copies or substantial portions of the Software.
      */
    
    +#include <stdbool.h>
    +
     #include <lttng/tracepoint.h>
    
     TRACEPOINT_EVENT(ust_tests_demo3, done,
    -       TP_ARGS(int, value),
    +       TP_ARGS(bool, value),
            TP_FIELDS(
    -               ctf_integer(int, value, value)
    +               ctf_integer(bool, value, value)
            )
     )
    
    Then when the demo is run with LTTNG_UST_DEBUG=1, a warning is shown,
    like:
    
    liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint signature mismatch, 
    enabling one or more tracepoints. Ensure that the tracepoint probes prototyp
    match the application. (in set_tracepoint() at tracepoint.c:310)
    liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint "ust_tests_demo3:don
    signatures: call: "_Bool, value" vs probe: "bool, value". (in set_tracepoint
    at tracepoint.c:312)

    It seems that TP_ARGS does not perform preprocessor expansion on the
    "bool" type spec, while something underneath TP_FIELDS does. And since
    (at least on this Centos 6.2 box) stdbool.h uses a #define rather than a
    typedef to make bool equivalent to _Bool, liblttng detects a mismatch.
    
    Reported-by: John Steele Scott <toojays at toojays.net>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>


And tested by commit f121009f677db0f9444e0683e24315eed9c5973d

(master branch commits).

I'll immediately merge these into stable-2.0.

Thanks!

Mathieu


> 
> The problem can be seen by patching the demo test from lttng-ust as
> follows:
> 
> --- a/tests/demo/ust_tests_demo3.h
> +++ b/tests/demo/ust_tests_demo3.h
> @@ -22,12 +22,14 @@ extern "C" {
>   * all copies or substantial portions of the Software.
>   */
>  
> +#include <stdbool.h>
> +
>  #include <lttng/tracepoint.h>
>  
>  TRACEPOINT_EVENT(ust_tests_demo3, done,
> -	TP_ARGS(int, value),
> +	TP_ARGS(bool, value),
>  	TP_FIELDS(
> -		ctf_integer(int, value, value)
> +		ctf_integer(bool, value, value)
>  	)
>  )
> 
> Then when the demo is run with LTTNG_UST_DEBUG=1, a warning is shown,
> like:
> 
> liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint signature mismatch, not enabling one or more tracepoints. Ensure that the tracepoint probes prototypes match the application. (in set_tracepoint() at tracepoint.c:310)
> liblttng_ust_tracepoint[3315/3315]: Warning: Tracepoint "ust_tests_demo3:done" signatures: call: "_Bool, value" vs probe: "bool, value". (in set_tracepoint() at tracepoint.c:312)
> 
> It seems that TP_ARGS does not perform preprocessor expansion on the
> "bool" type spec, while something underneath TP_FIELDS does. And since
> (at least on this Centos 6.2 box) stdbool.h uses a #define rather than a
> typedef to make bool equivalent to _Bool, liblttng detects a mismatch.
> 
> So in my tracepoint specifications, I need to remember to use the less
> attractive _Bool instead of bool.
> 
> Perhaps it's worth having a special case for this where the trace/probe
> signatures are compared? On the other hand, I guess nobody complained
> until now? 
> 
> cheers,
> 
> John
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-05 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-04 23:19 [lttng-dev] UST "Tracepoint signature mismatch" with C99 bool John Steele Scott
2012-06-05  3:12 ` Alexandre Montplaisir
2012-06-05 17:14 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox