1、将do 和 while 分为两部分,分配定义在START 和 END宏中
2、tracepoint生效时,如果是callback类型的tracepoint,则可执行callback,同时跳过START与END之间的流程。
3、tracepoint注册、tracepoint插入(设置START、END点)在代码过程中完成。(tracepoint注册信息需单独管理)
4、tracepoint类型、状态可在运行时使用命令动态设置,根据设置控制tracepoint执行
5、START和END定义:
#define TP_START(name, ...) \
do \
{ \
tp = getTracePoint( #name) \
if (ACTIVE == tp->status && CALLBACK == tp->type) \
{ \
tp->callback(); \
} \
else \
{ \
if (...) \
{ \
panic(); \
} \
else \
{ \
reboot(); \
} \
#define TP_END \
} \
}while(0);