[ltt-dev] [UST PATCH] Request: Make wait_for_buffer_consumption visible
Paul Wögerer
paul_woegerer at mentor.com
Wed Mar 16 12:27:37 EDT 2011
Hi,
I'm trying to use LTTng UST as a backend for function call tracing. The
following pseudocode shows what we basically to:
ustcmd_set_marker_state( "call_trace", call, enter, 1, pid );
ustcmd_set_marker_state( "call_trace", call, inside, 1, pid );
ustcmd_set_marker_state( "call_trace", call, exit, 1, pid );
ustcmd_create_trace( "call_trace", pid );
ustcmd_start_trace( "call_trace", pid );
...
... Lots of auto-generated code that makes use of call.enter/inside/exit
markers
...
ustcmd_stop_trace( "call_trace", pid );
ustcmd_destroy_trace( "call_trace", pid );
This works very well in general but whenever an executable runs only for
a very short amount of time I run into troubles with stopping/destroying
my "call_trace" properly.
This is caused by the fact that stop/destroy_trace runs before buffer
consumption completed on the ust-consumerd side. This is easy to prevent
by some code that implements waiting for buffer consumption. Fortunately
this is already available in tracectl.c keepalive().
The following patch puts the "waiting for buffer consumption" code into
its own function and makes it visible externally via ust/ustctl.h. Using
function wait_for_buffer_consumption() before stop/destroy_trace solves
the problem for me.
Please apply the patch from the attachment to the ust trunk to make
wait_for_buffer_consumption()available for everyone.
Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wait_for_buffer_consumption.patch
Type: text/x-patch
Size: 1194 bytes
Desc: not available
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20110316/4ab5474c/attachment-0003.bin>
More information about the lttng-dev
mailing list