Show TOC

Background documentationTracing

 

In BRFplus, you can request the system to create a processing log to keep track of all processing steps during function execution. The trace information is stored in the system and can be reviewed at any point in time. The trace functionality follows an approach of only writing a minimum of data to the system. This is accomplished by logging object references and data changes rather than explicitly writing down all available information about a given object at a certain point in time. This strategy keeps the database small and reduces performance decreases. You can control the trace functionality with the help of the IV_TRACE_MODE parameter of method IF_FDT_FUNCTION~PROCESS.

The trace tool is also used by the simulation tool that is available for functions, expressions, and actions. Here, the trace contains all the processing steps that the system performs for the given parameters in a simulation run.

Prerequisites

One of the following prerequisites must be fulfilled:

  • All objects to be traced are versioned.

  • If not all objects to be traced are versioned: The timestamp of all objects in a trace is equal or older than the timestamp of the trace itself.

For more information, see the Trace and Versioning section below.

Features

Lean Trace versus Technical Trace

You can decide to which degree of detail information shall be logged by the system. The following alternatives are available:

  • No trace

    If the calling application does not request any sort of trace for a function, the system simply executes the function, and returns the calculated result. None of the processing steps are logged. This leads, of course, to the best performance results.

  • Lean trace

    In lean trace mode, the system records only those steps of the process flow that directly lead to the end of the process. For example, if the program contains a CASE statement where an input value can be tested against five different values and only the last attempt leads to a matching result, then lean trace does not mention the four unsuccessful attempts but only the fifth one.

  • Technical trace

    As opposed to lean trace, the technical trace records each single step of the process flow, regardless of whether a step contributes to the successful completion of the processing or not. If, for example, a routine walks through 20 different steps until it finally turns out that this was the wrong path, the technical trace would make this visible, while lean trace would hide these steps from the user.

Trace and Versioning

The strategy of writing only a minimum of trace data requires that all BRFplus objects that are involved in the traced function must be versioned. Otherwise, the system could not identify the involved objects properly. This would lead to errors when the trace data is displayed. The versioning requirement is relaxed only under one special condition: If all objects involved in a trace have not been changed since the trace was recorded, then the system is still able to evaluate and display the trace. Otherwise, the system displays an error message when you try to access the trace.

When a function is called with the request for logging trace data, but with objects involved that are not versioned, the system behavior depends on the setting of the IV_TRACE_MODE parameter of method IF_FDT_FUNCTION~PROCESS:

  • L (for Lean Trace)

    The system executes the function in interpretation mode. Code generation is not possible in this situation.

  • R (for Lean Trace Required)

    The system does not execute the function and raises an exception. This is due to the conflict of a function that cannot be traced and, at the same time, is required to be traced. This conflict cannot be resolved, so execution stops here.

In addition to the parameter values mentioned above, the IV_TRACE_MODE parameter can also hold the following values:

  • T (for Technical Trace)

    With this parameter value, the system writes a verbose and complete log while the function is being executed. The technical trace contains information about every processing step of the function, including all the steps that do not directly lead to the successful completion of the processing. This trace mode is mainly intended for code analysis and debugging. It is not recommended for productive use due to performance reasons.

  • ““ (empty)

    If no value is passed to the parameter, this indicates that no trace information shall be written while the function is executed.

Constraints

In certain use cases, information to be recorded in the trace is passed to the trace dynamically via parameters. For technical reasons, this can lead to trace lines where the information provided exceeds the maximum line length and therefore must be truncated. However, if you look at the trace in the context of the function simulation tool, the complete information is available by hovering the mouse over the truncated line. Here, the untruncated information is given in the tooltip.

More Information

Versioning

Simulation