op_prg_odb_trace_active()

Abstract

Determines if a full trace, or a module trace associated with the surrounding module, has been activated by an ODB command.

Syntax

op_prg_odb_trace_active ()
Argument Type Description
no arguments

Return Type

Boolean

Boolean value indicating whether a full trace is active, or if a module trace is active for the surrounding module. This value is OPC_TRUE if either trace is active; OPC_FALSE otherwise.

Example

/* check if this module is being traced */
if (op_prg_odb_trace_active ())
	{
	/* print local banner (time / module not necessary) */
	op_prg_odb_print_major ("List of in-stream contents:", OPC_NIL);

	/* loop through all the input streams, determining the number */
	/* of packets being queued there (assumes consecutive connections) */
	num_in_strms = op_strm_max_index_in () + 1;
	for (i = 0; i < num_in_strms; i++)
		{
		sprintf (out_string, "in-stream [%d] contains %d packets\n", i,
			op_strm_pksize ());
		op_prg_odb_print_minor (out_string, OPC_NIL);
		}
	}

Details

Traces are a special status of simulations that when activated, permit specific diagnostic information to be printed and related actions to occur. Simulation traces are supported within the ODB simulation debugger (see “Simulation Debugger (ODB)“ on page 39 for information on using ODB). Various types of traces can be activated within ODB, including full, module-oriented, packet-oriented, and labeled traces. Full traces are activated via the ODB command fulltrace, and module traces are activated via the ODB command mtrace. Both of these trace types are detected by this KP, but a module trace is only detected if it affects the surrounding module.

This KP returns OPC_FALSE when used with an optimized simulation kernel.

Purpose

Provides a mechanism for performing special actions if a full or surrounding module trace has been defined in ODB. The actions usually include diagnostic print statements generated by op_prg_odb_print_major(), op_prg_odb_print_minor(), or printf(). However, the actions can include any KPs, including reading statistics, manipulating packets, etc.

Errors

  • No errors are trapped.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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