Dos16SysTrace: Difference between revisions
Appearance
Created page with "==Description== Dos16SysTrace writes a trace record to the system trace buffer. It provides a high speed event recording mechanism which may be used by PM and non-PM threads i..." |
mNo edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
'''Dos16SysTrace''' writes a trace record to the system trace buffer. It provides a high speed event recording mechanism which may be used by PM and non-PM threads in ring 3 and ring 2 and by detached processes. | |||
Dos16SysTrace writes a trace record to the system trace buffer. It provides a high speed event recording mechanism which may be used by PM and non-PM threads in ring 3 and ring 2 and by detached processes. | |||
==Syntax== | ==Syntax== | ||
APIRET16 APIENTRY16 Dos16SysTrace | |||
(USHORT major, USHORT cBuffer, USHORT minor, PCHAR pBuffer) | (USHORT major, USHORT cBuffer, USHORT minor, PCHAR pBuffer) | ||
==Parameters== | ==Parameters== | ||
; | ;major (USHORT) input : Major code which identifies the trace record. Range reserved for user. :Use is 245-255. | ||
Valid range 0 255 | :Valid range 0-255 | ||
;cBuffer (USHORT) input : Length of optional buffer. Valid range | |||
; cBuffer (USHORT) input : Length of optional buffer. Valid range | :*0 - 512 (before 4.0 FP 10 and 3.0 FP 35) | ||
:*0 - 4099 (from 3.0 FP35 and 4.0 FP10 onwards). | |||
* 0 512 (before 4.0 FP 10 and 3.0 FP 35) | ;minor (USHORT) input : Minor code which identifies the trace record. Major-minor code pair should uniquely identify the trace record. | ||
* 0 4099 (from 3.0 FP35 and 4.0 FP10 onwards). | :Valid range 1 - 255 | ||
;pBuffer (PCHAR) input : Pointer to optional buffer. If cBuffer is 0, then pBuffer is ignored. | |||
; minor (USHORT) input : Minor code which identifies the trace record. Major-minor code pair should uniquely identify the trace record. | |||
Valid range 1 255 | |||
; pBuffer (PCHAR) input : Pointer to optional buffer. If cBuffer is 0, then pBuffer is ignored. | |||
==Return Code== | ==Return Code== | ||
ulrc (APIRET) returns | ulrc (APIRET) returns | ||
Dos16SysTrace returns one of the following values | Dos16SysTrace returns one of the following values | ||
* 0 NO_ERROR | |||
* 0 | * 150 ERROR_SYSTEM_TRACE | ||
* 150 | |||
==Remarks== | ==Remarks== | ||
Dos16SysTrace creates a trace record that includes the following items | Dos16SysTrace creates a trace record that includes the following items: | ||
* Header Major code, minor code, time stamp, PID of logging process | * Header Major code, minor code, time stamp, PID of logging process | ||
* Optional System Data Controlled by the TRACE command | * Optional System Data Controlled by the TRACE command | ||
* Optional User Data Specified by the pBuffer parameter | * Optional User Data Specified by the pBuffer parameter | ||
If you use Dos16SysTrace, then you need to LINK specifying OS2386.LIB. If you use DosSysTrace, then you need to LINK specifying OS2286.LIB as an additional library file with the LINK386 command. | |||
If you use Dos16SysTrace, then you need to LINK specifying OS2386.LIB. If you use DosSysTrace, then you need to LINK specifying OS2286.LIB as an additional library file with the LINK386 command. | |||
==Example Code== | ==Example Code== | ||
Line 68: | Line 53: | ||
} | } | ||
</PRE> | </PRE> | ||
==Related Functions== | ==Related Functions== | ||
* [[ | * [[DosDumpProcess]] | ||
* [[ | * [[DosForceSystemDump]] | ||
[[Category: | [[Category:Dos]] |
Latest revision as of 04:05, 6 January 2017
Dos16SysTrace writes a trace record to the system trace buffer. It provides a high speed event recording mechanism which may be used by PM and non-PM threads in ring 3 and ring 2 and by detached processes.
Syntax
APIRET16 APIENTRY16 Dos16SysTrace (USHORT major, USHORT cBuffer, USHORT minor, PCHAR pBuffer)
Parameters
- major (USHORT) input
- Major code which identifies the trace record. Range reserved for user. :Use is 245-255.
- Valid range 0-255
- cBuffer (USHORT) input
- Length of optional buffer. Valid range
- 0 - 512 (before 4.0 FP 10 and 3.0 FP 35)
- 0 - 4099 (from 3.0 FP35 and 4.0 FP10 onwards).
- minor (USHORT) input
- Minor code which identifies the trace record. Major-minor code pair should uniquely identify the trace record.
- Valid range 1 - 255
- pBuffer (PCHAR) input
- Pointer to optional buffer. If cBuffer is 0, then pBuffer is ignored.
Return Code
ulrc (APIRET) returns
Dos16SysTrace returns one of the following values
- 0 NO_ERROR
- 150 ERROR_SYSTEM_TRACE
Remarks
Dos16SysTrace creates a trace record that includes the following items:
- Header Major code, minor code, time stamp, PID of logging process
- Optional System Data Controlled by the TRACE command
- Optional User Data Specified by the pBuffer parameter
If you use Dos16SysTrace, then you need to LINK specifying OS2386.LIB. If you use DosSysTrace, then you need to LINK specifying OS2286.LIB as an additional library file with the LINK386 command.
Example Code
int main(int argc, char *argv[], char *envp[]){ APIRET16 rc=0; /* default return code */ USHORT major=255; /* default major code */ USHORT minor=1; /* default minor code */ USHORT cBuffer=0; /* default buffer length */ PCHAR pBuffer=NULL; /* default buffer address */ if (argc>1) { pBuffer = argv[1]; cBuffer = strlen(argv[1]); } if (argc>2) major = atol(argv[2]); if (argc>3) minor = atol(argv[3]); rc = Dos16SysTrace(major, cBuffer, minor, pBuffer); if (rc) printf("DosSysTrace retuned rc=%u\n", rc); return rc; }