proldiag

Abstract

Executes the diagnostic block of the specified process, and sets a trace for the specified label restricted to the execution of the block. Invocations of the KP op_prg_odb_ltrace_active() with a matching label within the block return 1.

Syntax

proldiag <process_id> [<label>] [--args <arg>]

Argument Type Description
<process_id> integer numeric process ID of the process-of-interest
A process ID can be obtained by issuing the ODB commands objprint or promap, which both display lists of the existing processes associated with a specific module.
<label> string [optional] one or more space-separated strings specifying which labels in the process to trace
Each label can include alphanumeric characters, spaces, and selected punctuation, but must be surrounded by double quotes if spaces are included.
If no label is given in the command, proldiag displays a list of the labels found in the process model.
<arg> string [optional] one or more space-separated strings specifying arguments to be passed to the diagnostic block.
Each argument can include alphanumeric characters, spaces, and selected punctuation, but must be surrounded by double quotes if spaces are included.

Details

The diagnostic block of a process model can contain multiple C statements for diagnostic purposes within the context of ODB (a full description of diagnostic blocks appears in “Using Diagnostic Blocks in ODB” on page 53). Diagnostic statements have access to process state variables, and thus can be used to display their values.

The proldiag command executes the whole diagnostic block, but also sets a trace for the specified label. The labeled trace can be used as a way of controlling the statements that are executed within the diagnostic block, if the execution of certain statements is dependent on the Boolean return value of the KP op_prg_odb_ltrace_active(), as shown in the example. This technique is useful for defining several independent diagnostic actions which can be triggered by issuing the proldiag command with the respective enabling labels.

The optional --args argument lets you pass one or more strings to your diagnostic block code. You can access these arguments in the diagnostic block with the KP op_prg_odb_prodiag_args() and use them to customize execution of the diagnostic routines.

Example

For this example, the following code must be added to the indicated portions of the pksw_nd_proc process model.

diagnostic block:         if (op_prg_odb_ltrace_active (“xmit”))
                                 printf (“\n(%d packets transmitted)\n", xmit_packets);
xmt state enter execs:    xmit_packets++;
init state enter execs:   xmit_packets = 0;
state variables:          int \xmit_packets;

----------------------------------------------------------------------------------
...

breakpoint #0 trapped : "stop at time (50) sec."

ODB> promap pksw1.node0.proc
________________________________________________________________
Active Processes for Module (23)
process ID     process model       process tag
----------     -------------       -----------
1              pksw_nd_proc        (none)

ODB> proldiag 1
Following ODB labels are available for the process [1]: xmit

ODB> proldiag 1 xmit

(34 packets transmitted)

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com