![]() | ![]() | Programming Guide |
Create event trace and dump files
int sm_trace(char *commands);
commands- Command to execute.
- 0 no errors found in
commands.
- ·
SM_EQUALS: No equal sign following aDUMPFILE;FRAMESorTRACEFILEcommand.
- ·
SM_FORMAT: a non-alphabetic character was found in a command.
- ·
SM_MALLOC: a call to the malloc C function has failed.
- ·
SM_MISSARGS: commands is the null pointer; the null string or just whitespace.
- ·
SM_NOFILE: unable to open the file in aDUMPFILEorTRACEFILEcommand.
- ·
SM_NOT_LOADED:DUMPcommand whenDUMPFILEis not specified.
- ·
SM_NUMBER:DUMPcommand whenFRAMESis zero or theFRAMEScommand value is not one or more digits.
sm_tracecan create trace and dump files containing information about Panther events. The events that are reported in these files can be selected. Thecommandsparameter is series of command tokens that control operations. Most tokens can be prefixed withNOto reverse their effect. The case of tokens is ignored but they will be capitalized in this manual.
sm_tracewas first released in Panther 5.30.Trace files are written as events occur. The following commands control trace files::
Dump files are written when the
DUMPcommand is executed. The number of events to store for reporting is controlled by theFRAMES=command. The following commands control dump files:The following commands control how files are opened:
OVERWRITESpecifies that existing files should be overwritten. It is the default.
APPENDSpecifies that existing files should be appended to.
The following commands control which events are to be logged:
The following command causes parameters to be displayed:
PARMSCauses parameters to be displayed for calls to functions, including JPL functions. The default is
NOPARMS.To enable tracing to begin at startup, the
SMTRACEapplication variable can be included in aSMVARSorSMSETUPsetup file, for example:
SMTRACE=NOJAVA FRAMES=100 TRACEFILE="c:\temp\forex.trc"
SMINITJPLin a setup file can also be used to callsm_trace, for example:
SMINITJPL=call sm_trace('PARMS TRACEFILE="c:\temp\forex.trc"')When debugging a program,
sm_tracecan be called from the debugger to produce a dump file. For example, one can call:
sm_trace("DUMPFILE='dump1.dmp' DUMP")to create a dump file named "dump1.dmp" with the most recent trace information.
![]()
![]()
![]()
![]()