ltrace
Abstract
Sets a global labeled trace. Invocations of the KP op_prg_odb_ltrace_active() will return 1 if passed a label argument that matches the trace.
Syntax
ltrace <label>
| Argument | Type | Description |
|---|---|---|
<label> |
string | label string of the trace The label can include alphanumeric characters, spaces, and selected punctuation, but must be surrounded by double quotes if spaces are included. The labels used for traces exist in a different space from those used by labeled breakpoints. Traces and breakpoints can have labels with the same name, but they do not affect each other. |
Details
KP trace messages are not issued by labeled traces; instead, invocations of op_prg_odb_ltrace_active() return 1, which can be used to trigger user-defined diagnostic messages or other actions. An event that directly or indirectly leads to the invocation of op_prg_odb_ltrace_active() is indicated by an event banner. Traces can be suspended by the susptrace, reactivated by acttrace, or deleted by deltrace.
Example
This example assumes that a statement similar to the following one appears in the code wherever a “pk_created” trace is desired.
if (op_prg_odb_ltrace_active ("pk_created"))
printf ("\nPk Created: objid (%d), time (%g)\n", op_id_self (), op_sim_time ());
-----------------------------------------------------------------------------------
ODB> ltrace pk_created
Added trace #0: “trace on label (pk_created)”
ODB> status
Breakpoints :
None
Traces :
Full trace is disabled
Encapsulation trace is enabled
Execution trace is disabled
Trace format: intented
0) trace on label (pk_created)
Actions :
None
Miscellaneous :
Memory tagging is disabled
ODB> cont
__________________________ (ODB 18.6.0: Event) ____________________________
* Time : 0.296739496946 sec, [296ms 739us 496ns 946ps]
* Event : execution ID (11), schedule ID (#19), type (stream intrpt)
* Source : execution ID (10), top.pksw2.node1.src (processor)
* Data : instrm (1), packet ID (0)
> Module : top.pksw2.node1.proc [Objid=23] (processor) [process id: 94]
Pk Created: objid (130), time (0.296739)
...