Project

General

Profile

Actions

Bug #513

closed

Undefined behaviour - tracepoints with same provider in multiple compilation units

Added by Simon Marchi over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/29/2013
Due date:
% Done:

100%

Estimated time:

Description

When using tracepoints with the same provider in multiple .c files, my small test application crashes at startup with a cryptic error message:

test: /usr/local/include/lttng/ust-tracepoint-event.h:685: __lttng_events_init__my_project: Assertion `!ret' failed.
Aborted

Gitweb: http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary
To run: make && ./test

With a more complex application, I get a different behaviour, no crash, but only one tracepoint gets correctly activated. I attached a tarball with an example.

To run:
$ ./configure --enable-tracing
$ make
$ LTTNG_UST_DEBUG=1 ./memcached

Snippet from the debug output:

liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_add (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_del (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_pre (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_set (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_app (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_get (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:cmd_rep (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:new_conn (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:conn_dispatch (in tracepoint_register_lib() at tracepoint.c:762)
liblttng_ust_tracepoint[15544/15544]: registered tracepoint: memcached:server_start (in tracepoint_register_lib() at tracepoint.c:762)
libust[15544/15544]: adding probe memcached containing 1 events to lazy registration list (in lttng_probe_register() at lttng-probes.c:179)
libust[15544/15544]: just registered probe memcached containing 1 events (in lttng_lazy_probe_register() at lttng-probes.c:115)
libust[15544/15544]: Sent register event notification for name "memcached:server_start": ret_code 0, event_id 0 (in ustcomm_register_event() at lttng-ust-comm.c:948)
liblttng_ust_tracepoint[15544/15544]: Registering probe to tracepoint memcached:server_start (in __tracepoint_probe_register() at tracepoint.c:539)

We can see "adding probe memcached containing 1 events", where I would prefer "adding probe memcached containing 10 events".


Files

memcached-1.4.15.tar.gz (460 KB) memcached-1.4.15.tar.gz Simon Marchi, 04/29/2013 02:42 PM
Actions #1

Updated by Mathieu Desnoyers over 11 years ago

  • Status changed from New to Feedback

In your small test app, I see:

tp1.h:
#define TRACEPOINT_PROVIDER my_project

tp2.h:
#define TRACEPOINT_PROVIDER my_project

what makes you think it is supported to define twice the same provider in a program ?

It looks like there might be some extra documentation to add to lttng-ust(3) to discourage trying this, because it is unsupported.

Actions #2

Updated by Simon Marchi over 11 years ago

I think the confusion is because I don't understand the concept of a "provider". I thought it was one app <=> one provider, but that is not the case.

As you said, some more documentation would help. There is nothing in the man page that suggests that you can't use the same provider name for tracepoints in different .tp files.

Actions #3

Updated by Mathieu Desnoyers over 11 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF