Kevin Smith
|
How to TraceEvent() in new SMP safe InterruptHookIdle2() API?
|
Kevin Smith
10/28/2011 5:36 PM
post89751
|
How to TraceEvent() in new SMP safe InterruptHookIdle2() API?
Accordign to the docs (http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/t/traceevent.html) :
You can call TraceEvent() from an interrupt/event handler. However, not all trace modes are valid in this case. The
valid trace modes are:
_NTO_TRACE_INSERTSUSEREVENT
_NTO_TRACE_INSERTCUSEREVENT
_NTO_TRACE_INSERTUSRSTREVENT
_NTO_TRACE_INSERTEVENT
_NTO_TRACE_STOP
_NTO_TRACE_STARTNOSTATE
_NTO_TRACE_START
If I call TraceEvent(_NTO_TRACE_INSERTUSRSTREVENT, int event, const char * str) after waking up to log information, I do
not see it working well after looking at the logs. I have tried disabling other trace events and still it does not
seem to work as expected. I can use the above API fine in any thread - Just not in my ISR of interest. The docs also
comment how _NTO_TRACE_INSERTEVENT
is "real" but I'm not sure how to use the API to test it (i.e. How do i fill in the timestamp its an int? If the
_NTO_TRACE_INSERTEVENT method is more powerful and direct, can you please provide some commented code sample of how to
setup the base data structures and use it with proper time stamps? I like the *USR* events cause the API is easy to use
, but i am not successful in using them in my ISR. It would also be nice to leverage some of the other classes and
events so that my traces have pretty icons and format in the timeline view in the IDE.
My goal is to add trace events when waking up from sleep (exiting the idle task). The events should be strings so they
can be easily understood in the IDE. I want to trace the the different low power modes that we entered when leaving the
idle task. The API to trace needs to be ISR safe as it is called when exiting sleep from the ISR hooked by
InterruptHookIdle2().
Thanks!
|
|
|