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_rangeis instantiated using the default constructor, no time is marked until the user callsuser_range.start()with the label and tooltip. - You can instantiate a
user_rangeobject passing the label and tooltip strings. This starts monitoring the range immediately. - You must call
user_range.start()anduser_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 theuser_rangeobject is destructed. - The
user_rangeobject can be reused any number of times, by callinguser_range.start()/user_range.end()pairs in the host code. - Sequential calls to
user_range.start()ignore all but the first call untiluser_range.end()terminates the range. - Sequential calls to
user_range.end()ignore all but the first call untiluser_range.start()starts a new range.
Usage of the user_event objects:
- A
user_eventobject 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 optionalconst char*argument which appears as a label on the timeline trace.
With your host application properly instrumented, XRT can capture profile data from these user-defined ranges and events, in addition to the standard XRT API-based events. You must enable profiling in the xrt.ini file as explained previously.