Skip to content

Commit ec57cd7

Browse files
[SYCL] Fix sycl::queue XPTI instrumentation (#6021)
According to SYCLInstrumentationUsingXPTI.md "sym_line_no" must be int32_t, not an arbitrary string. Add "sym_column_no" metadata while we're here as well. Also, the check for whether we have source code location information seemed wrong and I'm fixing it here.
1 parent c2362e0 commit ec57cd7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void *queue_impl::instrumentationProlog(const detail::code_location &CodeLoc,
201201
xpti::utils::StringHelper NG;
202202
Name = NG.nameWithAddress<queue_impl *>("queue.wait", this);
203203

204-
if (!CodeLoc.fileName()) {
204+
if (CodeLoc.fileName()) {
205205
// We have source code location information
206206
Payload =
207207
xpti::payload_t(Name.c_str(), CodeLoc.fileName(), CodeLoc.lineNumber(),
@@ -236,7 +236,9 @@ void *queue_impl::instrumentationProlog(const detail::code_location &CodeLoc,
236236
xpti::addMetadata(WaitEvent, "sym_function_name", CodeLoc.functionName());
237237
xpti::addMetadata(WaitEvent, "sym_source_file_name", CodeLoc.fileName());
238238
xpti::addMetadata(WaitEvent, "sym_line_no",
239-
std::to_string(CodeLoc.lineNumber()));
239+
static_cast<int32_t>((CodeLoc.lineNumber())));
240+
xpti::addMetadata(WaitEvent, "sym_column_no",
241+
static_cast<int32_t>((CodeLoc.columnNumber())));
240242
}
241243
xptiNotifySubscribers(StreamID, xpti::trace_wait_begin, nullptr, WaitEvent,
242244
QWaitInstanceNo,

0 commit comments

Comments
 (0)