┌────────────────────────┐ │ Header │ ├────────────────────────┤ │ Type List Definition │ │ (optional) │ ├────────────────────────┤ │ Group List Definition │ │ (optional) │ ├────────────────────────┤ │ │ │ │ │ Tracepoint Definitions │ │ │ │ │ └────────────────────────┘Layout of a trace source file
Note:
; Sample trace source file depicting dynamic tracing for OS calls compiled; with 32-bit addressing MODNAME = doscall1.dll MAJOR = 100 /* this is decimal, would be 0x64 if specified hex */ MAXDATALENGTH = 200 /* max bytes logged per tracepoint is 200 */ TYPELIST NAME=PRE,ID=1, NAME=SYS,ID=0x40, NAME=API,ID=128, /* decimal, if hex would be 0x80 */ NAME=POST,ID=0x8000 GROUPLIST NAME=MEM,ID=2, NAME=FS,ID=0x5, NAME=MOU,ID=13, NAME=DOS,ID=0x2B /* would be 43 if decimal */ TRACE MINOR=0x0001, TP=.DosOpen, /* Pre-invocation tracing on DosOpen */ TYPE=(PRE,API), GROUP=DOS, DESC="(OS) DosOpen Pre-Invocation", FMT="Major = %X Minor = %Y", FMT=" EAX = %D", FMT=" FileName = %P%S", REGS=(EAX), ASCIIZ32=(.FileName,DIRECT,128) TRACE MINOR=0x7001, /* Puts tracept on code at line 28 */ /* of file dosopen1.c. Debug */ TP=@dosopen1.c,28, /* info is needed to use this. */ TYPE=(API), GROUP=DOS, DESC="(OS) CheckParm After Createhandle", FMT=" New handle = %P%W", MEM32=(.handle,DIRECT,2) TRACE MINOR=0x8001, /* Post-invocation tracing at */ TP=.DosOpenC,RETEP, /* procedure DosOpenC return point. */ TYPE=(API,POST), /* Debug info is needed to use */ GROUP=DOS, /* this type of tracepoint. */ DESC="(OS) DosOpenC Post-Invocation", FMT=" Return Code = %P%W", FMT=" Variable Rec= %P%U", MEM32=(.retcode,DIRECT,2), /* The following will log a variable length structure. The */ /* second field in the structure is the length of the */ /* record(position var_struct+2). This LEN parameter must*/ /* immediately precede the memory specification defining */ /* the variable length record. */ LEN=(var_struct+2,DIRECT), MEM32=(.var_struct,DIRECT,LEN)