Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] ltt channel thread safe?
@ 2010-08-04  6:12 chris meyers
  2010-08-04  6:12 ` chris meyers
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: chris meyers @ 2010-08-04  6:12 UTC (permalink / raw)


To give a bit of context to the problem.  I am using user space ltt to help
profile code.  I have created two events, time_begin and time_end.  The goal
is to allow for logging the runtime of specific code blocks via start()
stop() insertions.

I am having some issues with traces not coming out "correct" on the other
"end".  Let me further explain what I mean by correct and end.

correct
trace_mark(ust, time_begin, "thread %d func %s depth %d extra %s", 0,
__FUNCTION__, 1, __FUNCTION__)
trace_mark(ust, time_end, "thread %d func %s depth %d extra %s", 0,
__FUNCTION__, 1, __FUNCTION__)

end
ust.time_begin: 30208.932264102
(/home/meyers/.usttraces/lappy-20100804020140730811027/28367_5501430910891543571/ust_0),
0, 0, , , 0, 0x0, MODE_UNKNOWN { thread = 1, func =
"memloc_request_response_decider", depth = 1, extra =
"memloc_request_response_decider" }
ust.time_end: 30208.932267455
(/home/meyers/.usttraces/lappy-20100804020140730811027/28367_5501430910891543571/ust_0),
0, 0, , , 0, 0x0, MODE_UNKNOWN { thread = 1, func =
"memloc_request_response_decider", depth = 1, extra =
"memloc_request_response_decider" }

Later on the output looks like this:
ust.time_begin: 30198.142843837
(/home/meyers/.usttraces/lappy-20100804020140730811027/28367_5501430910891543571/ust_0),
0, 0, , , 0, 0x0, MODE_UNKNOWN { thread = 1, func = "ne_worker_thread",
depth = 560296821, extra = "" }

Notice that in the trace_mark() code above I hard coded depth to be 0 and
_str is always __FUNCTION__.

Possible reasons:
* Buffer is being overrun.  I changed the buffer size using the -N and -S
options in usttrace to something > 2 MB (plenty large).
* Channels are not thread-safe?  I have 3 threads of execution in this
example.  All using the ust channel.
* My code is crappy and I am overwriting the lust library buffer?


Also, I am having trouble using any channel other than ust.  Is ust the only
channel available in user space?

Many thanks,
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20100804/0436241d/attachment-0002.htm>


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

end of thread, other threads:[~2010-08-10  4:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-04  6:12 [ltt-dev] ltt channel thread safe? chris meyers
2010-08-04  6:12 ` chris meyers
2010-08-04  6:12 ` chris meyers
2010-08-06 20:55 ` chris meyers
2010-08-06 20:55   ` chris meyers
2010-08-06 20:55   ` chris meyers
2010-08-06 21:02   ` Mathieu Desnoyers
2010-08-10  4:29     ` Pierre-Marc Fournier
2010-08-10  4:28 ` Pierre-Marc Fournier

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