All XRT related actions from the host application are automatically tracked for profiling, through either theOpenCL API calls, or the XRT API calls. However, you can also profile the host application beyond the XRT related events, capturing event data based on user-specified actions or events. This feature provides two types of custom profiling:
- User range
- Profiles the specified start/end times across a range of code. This captures the span of time within which an action occurs in the host application.
- User events
- Marks an event in the timeline. The user event is added to the timeline waveform at whatever point in time it occurs.
Tip: You can use these features
early in the design process as described in Baselining Functionality and Performance, even prior to separating functions to run in the
Xilinx device hardware.
Using custom profiling requires a few changes in your host application
source code and build process. You must make use of C or C++ API in your code, as
described below, and you must include the xrt_coreutil
library when linking your host application.
- The C/C++ API are described below, but can also be found at the following URL: https://github.com/Xilinx/XRT/blob/master/src/runtime_src/core/include/experimental/xrt_profile.h
- For both C and C++ you must add the following:
#include xrt/core/include/experimental/xrt_profile.h
- When linking host code, add
-lxrt_coreutil
to the compiler command line.