Profiler File Layout
The profiler output file will be a sequence of variable length records of various types. The first byte of each record will provide the record type, the length and record information will be record type specific. All numbers are network byte order.
CREATE MODULE MAPPING Byte 1: 1 Byte 2-3: 16 bit module number Byte 4-5: 16 bit File Name Length Byte 6-end: File Name
CURRENT LINE Current line information is started with this record and will be ended with a END CURRENT LINE record Byte 1: 3 Byte 2-3: module number Byte 4-7: line number Byte 8: clause number
TIME SPENT IN LINE these records will only exist for timed sampling they will always occur between CURRENT LINE and END CURRENT LINE Byte 1: 4 Byte 2 – 9: 8 bit time spent in line in nano-seconds.
BACKTRACE INFORMATION these records may or may not exist depending on creation options they will always occur between CURRENT LINE and END CURRENT LINE Note: besides the record type identifier, these records have the same format as CURRENT LINE Byte 1: 5 Byte 2-3: module number Byte 4-7: line number Byte 8: clause number
FUNCTION NAME: These records may or may not exist depending on creation options. These records will follow immediately after either CURRENT LINE or BACKTRACE INFORMATION Byte 1:7 Byte 2: 8-bit name length Byte 3- on: function name
GOSUB: These records may or may not exist depending on creation options. These records will follow immediately after either CURRENT LINE or BACKTRACE INFORMATION Byte 1:8
MAIN ROUTINE: These records may or may not exist depending on creation options. These records will follow immediately after either CURRENT LINE or BACKTRACE INFORMATION This indicates that the given line is neither in a GOSUB or in a function body. Byte 1:9
END CURRENT LINE Byte 1: 6
Potential syntax
DEBUG PROFILE SAMPLED filename DEBUG PROFILE TIMED filename DEBUG PROFILE STOP