op_trace_event()
摘要
在 ODB 中启用对事件句柄的跟踪。
语法
op_trace_event (label, value)
| 参数 | 类型 | 说明 |
|---|---|---|
label |
const char * |
要跟踪的参数名称。该字符串将显示在跟踪输出中。 |
value |
Evhandle |
待跟踪的参数。 |
返回类型
void
无返回值。
示例
OMSC_EXPORT void
oms_timer_remove (OmsT_Timer_Bank* timer_bank_ptr, int code)
{
int evhandle_list_size;
int i;
Evhandle current_event;
FIN (oms_timer_remove (timer_bank_ptr, code));
#if defined (OPD_DEBUG)
op_trace_event ("Timer removal event", current_event);
#endif
prg_mt_spinlock_acquire (&timer_bank_ptr->spinlock);
evhandle_list_size = op_prg_list_size
(timer_bank_ptr->timer_code_entry_ptr [code].evh_list_ptr);
current_event = op_ev_current ();
for (i = 0; i < evhandle_list_size; i++)
{
Evhandle * evh_ptr = (Evhandle *)
op_prg_list_access
(timer_bank_ptr->timer_code_entry_ptr [code].evh_list_ptr, i);
if (op_ev_id (current_event) == op_ev_id (*evh_ptr))
{
op_prg_list_remove
(timer_bank_ptr->timer_code_entry_ptr [code].evh_list_ptr, i);
op_prg_mem_free (evh_ptr);
break;
}
}
prg_mt_spinlock_release (&timer_bank_ptr->spinlock);
FOUT;
}
详情
无。
用途
提供了一种以编程方式向 ODB 发出跟踪命令、从而自动跟踪事件句柄的方法。
错误
- 可恢复错误:label 参数无效。
参考
- 无。