Configuring trace (C)

Trace is controlled on the PocketPC via entries in the Windows Registry. These trace values are under the HKEY_LOCAL_MACHINE\SOFTWARE\IBM\MQe\CurrentVersion\Trace key. You can set the values in several ways:
  • Manually, using a registry editor, such as the Remote Registry Editor provided with eMbedded Visual Tools V3.0
  • With a .Reg file, which you can download to the device and then execute
  • Programatically, using the supplied mqeTrace_setOptions function
For information on the mqeTrace_setOptions function, see the C Programming Reference on the product CD. If you set the value manually or use a .Reg file, all values should be of type REG_SZ. MQe supports the following values:
Table 1. Trace values supported in MQe
Value NameSupported values Description
EnableYes or noTurns trace on and off.
LocationFull pathDirectory where trace files are written to. The location string must be a valid file path, for example mqetrace.
TimestampYes or noDetermine if timestamp information is added to each tracepoint. Set to "no" to reduce file size and increase speed.
ParametersYes or noDetermine if parameter information is added to each tracepoint. Set to "no" to reduce file size and increase speed.
WrapLengthValueAdvanced value, described in the following list under Wraplength.
SubtractMethodFilterValueAdvanced value, described in the following list under AddMethodFilter and SubtractMethodFilter.
AddMethodFilterValueAdvanced value, describted in the following list under AddMethodFilter and SubtractMethodFilter.
In the table, the following conditions apply:
WrapLength
This is the maximum size, in bytes, that an individual trace file will reach. Once this value is reached, the trace file begins to wrap using a "circular buffer" algorithm. However, this takes a considerable amount of time, and may significantly slow down execution speed once the file starts wrapping. Therefore, leave this value at -1, except in circumstances where disk space is at a premium.
Note: This is the maximum length of a single trace file. If an application is run multiple times, or multiple applications are run, then each generated trace file reaches this size.
AddMethodFilter and SubtractMethodFilter

These values allow sophisticated control over exactly what trace points are produced. Incorrect use can seriously limit the effectiveness and understandability of the trace files. You should leave these fields blank, unless an IBM service representative instructs you otherwise. If you do send trace files to IBM, you must include details of what both of these fields are set to.

Parent topic: Tracing and logging with C