Barrelfish
Functions
control.c File Reference

System-wide tracing. More...

Functions

void trace_reset_buffer (void)
 Reset the trace buffer on the current core. More...
 
void trace_reset_all (void)
 Reset all trace buffers discarding the current trace. More...
 
errval_t trace_control (uint64_t start_trigger, uint64_t stop_trigger, uint64_t duration)
 Specify the trigger events which start and stop tracing. More...
 
errval_t trace_wait (void)
 Wait for a trace to complete.
 
size_t trace_dump (char *buf, size_t buflen, int *number_of_events_dumped)
 Dump the contents of the trace buffers. More...
 
void trace_flush (struct event_closure callback)
 Flush the trace buffer to the "best" destination. More...
 
void trace_set_autoflush (bool enabled)
 Enable/Disable the autoflush mechanism of the tracing framework. More...
 
errval_t trace_set_subsys_enabled (uint16_t subsys, bool enabled)
 Enable/Disable the logging of a given subsytem. More...
 
errval_t trace_set_all_subsys_enabled (bool enabled)
 Enable/Disable all subsystems.
 
errval_t trace_prepare (struct event_closure callback)
 Optional call to do "extra" preparation of the tracing framework. More...
 

Detailed Description

System-wide tracing.

Function Documentation

errval_t trace_control ( uint64_t  start_trigger,
uint64_t  stop_trigger,
uint64_t  duration 
)

Specify the trigger events which start and stop tracing.

Parameters
start_trigger- Raw event value which starts the trace
stop_trigger- Raw event value which stops the trace
duration- Maximum trace duration in cycles (0 is infinite)
size_t trace_dump ( char *  buf,
size_t  buflen,
int *  number_of_events_dumped 
)

Dump the contents of the trace buffers.

buf : The buffer to write the trace log into. buflen : Length of buf. number_of_events_dumped : (optional) Returns how many events have been written into the buffer.

void trace_flush ( struct event_closure  callback)

Flush the trace buffer to the "best" destination.

This function automatically determines if bfscope is running and if someone is connected over the network. If so, the buffer is flushed over the network. If nobody is connected or bfscope is not running, the buffer is flushed onto the console.

errval_t trace_prepare ( struct event_closure  callback)

Optional call to do "extra" preparation of the tracing framework.

Call this method to prepare for tracing. This is not a preparation in a strict sense, i.e. tracing will also work when you do not call this method, but it provides some benefits.

Currently it provides a mechanism for clock synchronization between cores.

void trace_reset_all ( void  )

Reset all trace buffers discarding the current trace.

Reset head and tail pointers.

void trace_reset_buffer ( void  )

Reset the trace buffer on the current core.

Reset head and tail pointers.

void trace_set_autoflush ( bool  enabled)

Enable/Disable the autoflush mechanism of the tracing framework.

If autoflush is enabled, the tracing framework will automatically flush the content of the buffer periodically.

NOTE: This only works when bfscope is running!

NOTE: If you enable autoflush, it will affect your performance during the time period you are flushing, as the buffer might be flushed at any given time.

errval_t trace_set_subsys_enabled ( uint16_t  subsys,
bool  enabled 
)

Enable/Disable the logging of a given subsytem.

subsys: A subsystem, i.e. the macro generated by the DSL. enabled: True iff the events should be logged.