Skip to content

The Transformations

Anurag Dogra edited this page Apr 18, 2019 · 4 revisions

Timestamp Transformation

An otf2 trace contains three clock properties:

  1. Time resolution – Ticks per seconds.
  2. Global offset – The smallest timestamp among events.
  3. Trace Length – The total time-span between the smallest and greatest timestamp among all event timestamps.

At present, the Time resolution and Global offset of the merged trace are equal to that of the first trace in the merging process. The timestamps of the events are adjusted with respect to the clock properties of the first trace.

For example, there are trace A and trace B as inputs to otf2_merger.

We have computed the "Relative Clock Factor (RCF)" between trace A (first trace) and trace B (other traces).

RCF = Time resolution of trace A / Time resolution of trace B

Calculation of modified event timestamps (belongs to trace B) with respect to the trace A clock properties.

Modified event timestamp = (Old event timestamp - Global offset of trace B) * RCF + Global offset of trace A

The remaining clock property of the merged trace, the Trace length is the largest trace length among all the traces.

Global Definitions and their IDs

There are several global definitions which are related/depended on other global definitions. In the case of string definitions, string IDs are part of almost all other global definitions. Hence, we come up with the proper transformation logic/mapping for the respective global definitions. The transformation logic/mapping make sure the definitions are modified with respect to the previous trace and other depended global definitions. To deep-dive, a user can also look on source code ("maps.cpp" and "maps.h").

Event Definitions

The event definitions consist of several events which are depended on locations. Therefore, each location creates its own event file which merger reads. The read event definitions go through the transformation logic/mapping and directly written out in the new location event file.