Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
TraceEvent()
Trace kernel events
Synopsis:
#include <sys/neutrino.h>
int TraceEvent( int mode,
... );
Arguments:
- mode
- A command that indicates what you want to trace. Certain modes require additional arguments.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The TraceEvent() function controls all stages of the instrumentation process such as initialization, starting, execution control and stopping. These stages consist of the following activities:
- creating internal circular link list of trace buffers
- initializing filters
- turning on or off the event stream
- deallocating the internal circular link list of trace buffers
![]() |
This function requires the instrumented kernel. For more information, see the documentation for the System Analysis Toolkit (SAT). |
Returns:
- If mode is set to _NTO_TRACE_QUERYEVENTS
- Number of events in the buffer, or -1 if an error occurs (errno is set).
- If mode isn't set to _NTO_TRACE_QUERYEVENTS
- 0 for success, or -1 if an error occurs (errno is set).
Errors:
- ECANCELED
- The requested action has been canceled.
- EFAULT
- The requested action has been specified out of order.
- ENOMEM
- Insufficient memory to allocate the trace buffers.
- ENOSUP
- The requested action isn't supported.
- EPERM
- The application doesn't have the appropriate permission to perform the action.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | Read the Caveats |
| Signal handler | Yes |
| Thread | Yes |
Caveats:
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
See also:
InterruptAttach(), InterruptHookTrace()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
