Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sycl/tools/pi-trace/pi_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ std::mutex GIOMutex;

sycl::xpti_helpers::PiArgumentsHandler ArgHandler;

#if defined(_WIN64) || defined(_WIN32) /* Windows */
#define PI_TRACE_CALLBACK_API XPTI_CALLBACK_API inline
#else /* Not Windows */
#define PI_TRACE_CALLBACK_API XPTI_CALLBACK_API
#endif

// The lone callback function we are going to use to demonstrate how to attach
// the collector to the running executable
XPTI_CALLBACK_API void tpCallback(uint16_t trace_type,
Expand All @@ -37,7 +43,7 @@ XPTI_CALLBACK_API void tpCallback(uint16_t trace_type,
// Based on the documentation, every subscriber MUST implement the
// xptiTraceInit() and xptiTraceFinish() APIs for their subscriber collector to
// be loaded successfully.
XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
PI_TRACE_CALLBACK_API void xptiTraceInit(unsigned int major_version,
unsigned int minor_version,
const char *version_str,
const char *stream_name) {
Expand All @@ -62,11 +68,11 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
}
}

XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) {
PI_TRACE_CALLBACK_API void xptiTraceFinish(const char *stream_name) {
// NOP
}

XPTI_CALLBACK_API void tpCallback(uint16_t TraceType,
PI_TRACE_CALLBACK_API void tpCallback(uint16_t TraceType,
xpti::trace_event_data_t *Parent,
xpti::trace_event_data_t *Event,
uint64_t Instance, const void *UserData) {
Expand Down