QSMM provides facilities for tracing events related to a multinode model. You can specify types of events dumped to a trace log using a bitmask defined as a subset of the following macros merged by bitwise “or.”
Multinode model API calls entry and exit. API functions with a model handle argument dump a function name, names and values of function arguments, and a returned value.
The beginning and end of processing every model event by event handlers with dumping event parameters.
Calling nodes, returning control from nodes, instruction invocations, and their outcomes.
Use the following functions to query or set a bitmask of types of events dumped to a trace log.
unsigned int qsmm_get_trace_flags (qsmm_t model) ¶This function returns the bitmask of types of events dumped to trace log of a multinode model.
The model is the originator of the 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.
void qsmm_set_trace_flags (qsmm_t model, unsigned int flags) ¶This function sets to flags the bitmask of types of events dumped to trace log of a multinode model. The model is the originator of the 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 information 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.
FILE * qsmm_get_trace_stream (qsmm_t model) ¶This function returns a stream for trace log of a multinode model.
If the model does not have an assigned stream, the function returns NULL.
void qsmm_set_trace_stream (qsmm_t model, FILE *filep) ¶This function sets to filep the stream for 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.
void qsmm_trace_f (qsmm_t model, const char *fmt, ...) ¶void qsmm_trace_fv (qsmm_t model, const char *fmt, va_list ap) ¶The functions write a formatted message to 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 similar to the function printf.
The meaning of fmt and ap arguments of qsmm_trace_fv function is similar to the function vprintf.