9 Tracing

With help of various command line switches, processing in the DM can automatically be debugged and tested.

9.1 Description of Tracing

With help of the tracing facility, the DM application can be debugged. The tracefile contains all executed rules, all called application functions and all called DM functions with their current parameters (please refer also to manual “C Interface - Basics”).

The following is also traced:

The general layout of the file is as follows:

[<Abbreviation>]<Action>

The explanation of what has currently be done is given in the <Action>.

The <Abbreviation> stands for the DM action. The following codes are possible:

[AC]

AppMain call. This is the call to the main user program called AppMain.

[AR]

AppMain return. This is the return value of AppMain to the DM.

[BA]

Builder action: Start of an action (e.g. ‑writeexport) in builder process mode.

[BC]

Built-in function call. A built-in function was called by the Dialog Manager.

[BD]

Builder return: End of an action (e.g. ‑writeexport) in builder process mode.

[BM]

Builder message: IDM message in builder process mode.

[BR]

Built-in function return. This is the return value of a built-in function.

[BX]

Builder command: Command for the IDM in builder process mode, e.g. ‑buildertimeout.

[DC]

Dump Call. Source code output of the active window triggered by pressing the function key defined with the command line option -IDMobjdump_fkey.

[DE]

Dialog event. This is a user event which was triggered by the user when interacting with the system.

[DR]

Dump Return. End of source code output of the active window triggered by pressing the function key defined with the command line option -IDMobjdump_fkey.

[DS]

Dialog start. This is the execution of the dialog start rule.

[EC]

Error Handler Call. An error handler is called.

[EE]

Exit. The application does not exit normally. The exit status is written into the trace file.

[EQ]

Return executing SQL statement. Return value after the execution of a SQL statement.

[ER]

Error Handler Return. Return from an error handler.

[EX]

External event.

[FA]

Function assignment phase. The parameters passed with write access (declared as output) are now assigned to their object attributes.

[FC]

Function call. A function of the application was called by the DM.

[FE]

Finish dialog. This is the dialog finish event which was triggered by calling the function exit in a rule.

[FR]

Function return. This is the return value of an application function

[IA]

Interface argument. This is an argument which was passed from the application to a DM function.

[IC]

Interface call. A DM function was called by the application.

[IE]

Interface error. The DM function returns an error.

[IR]

Interface return. This is the return value of a DM function.

[IV]

Interface value. Additional values passed on to or returned of interface functions..

[MC]

Method call. Call of a method.

[MR]

Method return. Return value of a method.

[NI]

Network information. This message describes which transport is tried out and which one was started.

[PD]

Finish of perform rule. The execution of a sub-rule is finished.

[PR]

Perform rule. This is the call of a sub-rule from another rule.

[RC]

Rule call. This is the call of a named rule.

[RR]

Rule return. This is the return value of a rule.

[SC]

Simulated function call.

[SE]

Setval event. This is an internal event which was triggered by setting an object attribute.

[SQ]

Execute SQL statement. Execution of a SQL statement.

[SR]

Simulated function return. Return value of a simulated function.

[SV]

SetValue. This a SetValue to an attribute of an object.

[TD]

Tracing disabled. Tracing is switched off.

[TE]

Tracing enabled. Tracing is switched on.

[UM]

User message. This message was written by the application with a call of DM_TraceMessage.

[VS]

Version string of the used DM version (5 lines).

[WE]

Window system event

[XD]

Finish execution of a rule.

[XR]

Execution rule. The execution of a rule is started.

9.2 Configuration of Tracing

If enormous dialogs are being processed the tracefiles increase accordingly. This is why the tracing can be configured. In addition the possibility to switch on and off the tracing (setup.tracing := true/false) is available.

The configuration of tracing enables you to switch off the tracing for special trace events. This is helpful for e.g. loops or other trace-intensive rules or program codes. You may switch off trace events at the Setup object. The attribute .tracing is indexed with a string:

setup.tracing["<abbreviation>"] := false;

Example

setup.tracing["RR"] := false;

This definition switches off all return values of named rules.

By switching off certain trace events – e.g. ["RC"] (call of a named rule) – you may also obtain a grouping effect: in the above example the calls of named rules are oppressed as well as the return values of named rules (see table below, column Grouping).

Note

Please note that the following trace events cannot be switched off:

Warning

If you need IDM support, do not switch off too many trace messages, as we might not be able to help you efficiently. If important trace messages are missing it is not possible to get a satisfactory analysis.

Please not the following programming hints.

Right

variable boolean I_NEED_HELP_FROM_ISA_SUPPORT := true;
...
rule MyCode()
{
  TraceEvent("RC", false);
  ...
}

rule TraceEvent(string TraceTag, boolean Value)
{
  !! Check the global variable for support.
  if ( not I_NEED_HELP_FROM_ISA_SUPPORT ) then
    setup.tracing[TraceTag] := Value;
  endif
}

Wrong

rule MyCode()
{
  !! Do not look for help in your rules without a trace.
  !! Nobody knows which rule was called!
  setup.tracing["RC"] := false;
  ...
}

The following table summarizes how trace events are grouped and indented in the trace file. It also indicates whether the trace messages can be turned off by the user. In the table mean:

Abbreviation

Grouping

Indention

Can be Toggled by User

IC

IC

>

yes

IR

IC

<

yes

IE

--

=

no

IA

IC

=

yes

IV

IC

=

yes

FC

FC

>

yes

FR

FC

<

yes

FA

FC

=

yes

EE

--

=

no

VS

--

=

no

UM

--

=

no

AC

AC

>

yes

AR

AC

<

yes

NI

--

=

no

TE

--

=

no

TD

--

=

no

SV

--

=

yes

PR

PR

>

yes

PD

PR

<

yes

SQ

SQ

>

yes

EQ

SQ

<

yes

BC

BC

>

yes

BR

BC

<

yes

RC

RC

>

yes

RR

RC

<

yes

MC

MC

>

yes

ME

ME

=

no

ML

ME

=

no

MR

MC

<

yes

DS

--

=

yes

FE

--

=

yes

SE

--

=

yes

EX

--

=

yes

DE

--

=

yes

XR

XR

>

yes

XD

XR

<

yes

SC

SC

>

yes

SR

SC

<

yes

WE

--

=

yes

EC

--

>

yes

ER

EC

<

yes

9.3 Time Marks during Tracing

The option ‑IDMtracetime <No.> is used to protocol the absolute or relative time needed for functions and rules during program run. It is thus possible to identify very time-consuming functions or rules for which tuning measures could then be taken .

There are three types of time measurement, which can be set using the <No.> parameter:

0
No times are logged in the trace file.
1

This value indicates start time mode. In this mode all start and end times are logged. The time needed for a single structure may then be calculated with the difference. In this mode only the system and user time will be considered.

The times are given in format [hh:mm:ss:uuu] at the beginning of line:

  • hh = hours
  • mm = minutes
  • ss = seconds
  • uuu = milliseconds
2

This value indicates the trace time mode. In this mode the time difference to the last logged call is given. It is thus possible to easily recognize how much time is needed for individual actions.

In this mode the time difference to the last trace output is given in the format [sss:uuu] at the beginning of line:

  • ss = seconds
  • uuu = milliseconds
3

This value specifies the real-time mode. In this case the real time is indicated for each action to be logged in the trace file.

In this mode the real time is given in format [hh:mm:ss] at the beginning of line:

  • hh = hours
  • mm = minutes
  • ss = seconds

9.4 Safety Tracing

Availability

The safety mode of tracing is available in the IDM versions A.05.01.g3 and A.05.01.h as well as from A.05.02.e.

Safety tracing is a special trace file mode. In order to keep the trace file running during long application sessions without experiencing a slower running system and the use of too many resources, safety tracing uses a limited ring buffer that is held in the memory. For this use the option ‑IDMstracefile <filepath> instead of ‑IDMtracefile <filepath> or when using ‑IDMtracefile <filepath> switch on safety mode with the option ‑IDMstrace.

With respect to the ring buffer, limited means that the number of lines and the number of characters per line (without indents) is restricted. In addition, the length of the string values (typically displayed in "…") is shortened and the string length is attached in brackets [ ]. The limitations can be influenced via the option ‑IDMstraceopts. For the hierarchical indentation in the trace file two blank spaces are used. This cannot be influenced by the option ‑IDMindent. If the issued lines are discontiguous this is marked by a line and a colon. If the maximum length of the line is exceeded, this is marked with a tilde (~).

The content of the ring buffer is written to the trace file only after the application has been ended. It is necessary to have an active exception catcher in order to guarantee that files are saved in case of system crashes (see chapter “Exception Catcher”).

Switching off the tracing or the output of certain trace codes is not possible in the safety tracing.

The following limitations apply within the safety tracing:

 

Minimum

Maximum

Default

Bytes per line

20

65,536

200

Lines

20

100,000

1,000

String length

 

 

40

Indent depth

 

50 (100 white spaces)