Profiling of C++ Code - 2022.2 English - UG1393

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2022-12-07
Version
2022.2 English

For C++ code the provided objects are:

user_range
This object captures the start time and end time of a measured range of activity with the specified ID. The object constructor is:
user_range(const char* label, const char* tooltip);
user_event
This object marks an event occurring at single point in time, adding the specified label onto the timeline trace. The object constructor is:
user_event() 

Use the user_range to construct an object and start keeping track of time immediately upon construction. Usage details of the user_range objects:

  • If a user_range is instantiated using the default constructor, no time is marked until the user calls user_range.start() with the label and tooltip.
  • You can instantiate a user_range object passing the label and tooltip strings. This starts monitoring the range immediately.
  • You must call user_range.start() and user_range.end() to capture ranges of time you are interested in.
  • If user_range.end() is not called, then any range being tracked lasts until the user_range object is destructed.
  • The user_range object can be reused any number of times, by calling user_range.start()/user_range.end() pairs in the host code.
  • Sequential calls to user_range.start() ignore all but the first call until user_range.end() terminates the range.
  • Sequential calls to user_range.end() ignore all but the first call until user_range.start() starts a new range.

Usage of the user_event objects:

  • A user_event object must be instantiated using the default constructor.
  • Calls to user_event.mark() creates a user marker on the timeline trace at that particular time.
  • user_event.mark() takes an optional const char* argument which appears as a label on the timeline trace.

The debug_profile example of the Vitis_Accel_Examples demonstrates user event profiling in a host application. With your host application properly instrumented, XRT can capture profile data from these user-defined ranges and events, as well as the standard XRT API-based events. You must enable profiling in thexrt.ini file as explained previously.