Previous: , Up: Executing a Multinode Model   [Contents][Index]


4.3.8 Tracing Model Execution

QSMM provides facilities for tracing events related to a multinode model. You can specify the types of events dumped to a trace log using a bitmask defined as a subset of the following macros merged by bitwise “or.”

Macro: QSMM_TRACE_API

Multinode model API calls entry and exit. API functions with a model handle argument dump a function name, the names and values of function arguments, and a returned value.

Macro: QSMM_TRACE_EVT

The beginning and end of processing every model event by event handlers with dumping event parameters.

Macro: QSMM_TRACE_CTRL

Calling nodes, returning control from nodes, instruction invocations, and the outcomes of those invocations.

Use the following functions to query or set a bitmask of types of events dumped to a trace log.

Function: unsigned int qsmm_get_trace_flags (qsmm_t model)

This function returns the bitmask of types of events dumped to the trace log of a multinode model. The model is the originator of those events. This function returns a bitmask set by the function qsmm_set_trace_flags or a default bitmask (see a remark below) if the latter function not yet called.

Function: void qsmm_set_trace_flags (qsmm_t model, unsigned int flags)

This function sets to flags the bitmask of types of events dumped to the trace log of a multinode model. The model is the originator of those events. The function does not check whether the bitmask is correct.

The function qsmm_create initializes the bitmask of types of events dumped to a trace log to 0.

A multinode model does not dump messages to a trace log unless the multinode model has an assigned stream for the trace log. Use the following functions to get or set the stream.

Function: FILE * qsmm_get_trace_stream (qsmm_t model)

This function returns a stream for the trace log of a multinode model. If the model does not have the stream assigned, the function returns NULL.

Function: void qsmm_set_trace_stream (qsmm_t model, FILE *filep)

This function sets to filep the stream for the trace log of a multinode model. The NULL stream disables dumping log messages.

Use the following functions to write a custom formatted message to the trace log.

Function: void qsmm_trace_f (qsmm_t model, const char *fmt, ...)
Function: void qsmm_trace_fv (qsmm_t model, const char *fmt, va_list ap)

These functions write a formatted message to the trace log of a multinode model. They append the character ‘\n’ to the message and flush the stream buffer. If the trace stream not set, the functions have no effect. The meaning of fmt argument and subsequent arguments of qsmm_trace_f function is the same as in the function printf. The meaning of fmt and ap arguments of qsmm_trace_fv function is the same as in the function vprintf.


Previous: , Up: Executing a Multinode Model   [Contents][Index]