Creates event trace and dump files



int sm_trace(char *commands);


commands       Command to execute



Returns        0 if there are no errors.

               Otherwise, one of these error codes:


               SM_EQUALS        No equal sign following a DUMPFILE;

                                FRAMES or TRACEFILE command.

               SM_FORMAT        non-alphabetic character in a command.

               SM_MALLOC        a call to the malloc function has failed.

               SM_MISSARGS      command is the null pointer; null

                                string or just whitespace.                          

               SM_NOFILE        unable to open the file in a DUMPFILE

                                or TRACEFILE command.                          

               SM_NOT_LOADED    DUMP command when DUMPFILE is not


               SM_NUMBER        DUMP command when FRAMES is zero or

                                the FRAMES command value is not one or

                                more digits.                          

               SM_QUOTE         DUMPFILE or TRACEFILE value starts

                                with a quote character but terminating

                                quote not found.                               

               SM_SYNTAX        character after the closing quote in a                                 

                                DUMPFILE or TRACEFILE is not a NULL or


               SM_VERB_UNKNOWN  command is not valid.



Description    sm_trace can create trace and dump files containing

               information about Panther events.  The events to report

               in these files can be controlled.  The commands

               parameter is a series of tokens that control

               operations.  Most tokens can be prefixed with NO to turn

               off their normal effect.  Case is ignored but tokens will

               be capitalized in this document.


               Trace files are written as events occur.  The following

               commands control trace file operations:


               TRACEFILE=  File to write event information to. The file

                           name should be quoted if it contains spaces. 

                           Use the null string "" to stop tracing and

                           close the current TRACEFILE.


               TRACE       Used to control whether event information

                           is to be written to TRACEFILE.  Default is TRACE.


               Dump files are written when the DUMP command is executed.

               The number of events to store for reporting is controlled

               by the FRAMES= command.  The following tokens control dump



               DUMPFILE=   File to write information to. The file name

                           should be quoted if it contains spaces.


               DUMP        Used to cause information is to be written

                           to DUMPFILE.


               FRAMES=     Specifies how many events are to be stored

                           for writing by the DUMP command.  500 is the



               The following tokens control how files are opened:


               OVERWRITE   Specifies that existing files should be

                           overwritten. It is the default.


               APPEND      Specifies that existing files should be

                           appended to.


               The following tokens control which events are to be



               CSTR        Control String events

               DBI         Database (DBi) events

               FIELD       Field entry, exit and validation events

               FUNCTION    Installed function call and return events

               GRID        Grid and Grid Row entry, exit and

                           validation events

               GROUP       Group entry, exit and validation events

               JPL         JPL execution events

               KEY         Key being taken off the key queue events

               LDB         LDB (Local Data Block) events

               RW          Report Writer (RW) events

               SCREEN      Screen entry, exit and expose events

               TM          Transaction Manager (TM) events

               ALL         All of the above events.

               CORE        All of the above events except for DBI, RW

                           and TM.

               NONE        The same as NOALL.

               PARMS       Causes parameters to be displayed for calls

                           to functions, including JPL functions.





Use the setup variable SMTRACE in the smvars file to pass parameters to

sm_trace at startup time.  As an example:


SMTRACE         = TRACE NORW TRACEFILE="c:\test\PantherTrace"


The above command turns tracing on, ignores Report Writer events; and

writes the trace to  “c:\test\Panther Trace”.