Skip to content

How to add events to the instrumented runtime

Engil edited this page May 21, 2021 · 1 revision

This page describes how one can add events to the instrumented runtime in Multicore OCaml.

There is two components to event definitions in the runtime:

  • tools/eventlog_metadata.in which contains the CTF metadata definition for the runtime events
  • runtime/caml/eventlog.h which contains the enum mapping to these events as used in the runtime code.

To successfully add events, these should be added first to the eventlog.h file and then ported back to the eventlog_metadata.in file.

One note about adding events to these files:

They should be appended in the definitions rather than be put in alphabetical order: ordering is important to keep retro-compatibility with previous definition of the trace format.

Once these events are added to both files, the resulting traces can be decoded using either babeltrace2 or using eventlog-tools after updating its decoder.

To update eventlog-tools to support your newly added events, edit lib/consts.ml and append your new definitions there.

Note: do note that you need to use the multicore branch of eventlog-tools. master is for trunk only purposes for now.

Once the new event definitions are added, existing tooling should work immediately and process these events.