Skip to content

Commit 62422f9

Browse files
[XPTI][SYCL] remove filtered XPTI enabling check from XPTIScope (#10642)
collectors could be subscribed for only one trace type from begin-end pair. In this case the logic with filtered check causes wrong logic. --------- Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 5778ead commit 62422f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sycl/source/detail/xpti_registry.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,18 @@ class XPTIScope {
222222
/// @brief Method that emits begin/end trace notifications
223223
/// @return Current class
224224
XPTIScope &scopedNotify(uint16_t TraceType) {
225-
TraceType &= 0xfffe;
225+
// Keep this data even if no subscribers are for this TraceType (begin).
226+
// Someone could still use (end) emitted from destructor.
227+
MTraceType = TraceType & 0xfffe;
228+
MScopedNotify = true;
226229
if (xptiCheckTraceEnabled(MStreamID, TraceType) && MTP) {
227-
MTraceType = TraceType;
228-
MScopedNotify = true;
229230
xptiNotifySubscribers(MStreamID, MTraceType, nullptr, MTraceEvent,
230231
MInstanceID, static_cast<const void *>(MUserData));
231232
}
232233
return *this;
233234
}
234235
~XPTIScope() {
236+
MTraceType = MTraceType | 1;
235237
if (xptiCheckTraceEnabled(MStreamID, MTraceType) && MTP && MScopedNotify) {
236238
if (MTraceType == (uint16_t)xpti::trace_point_type_t::signal ||
237239
MTraceType == (uint16_t)xpti::trace_point_type_t::graph_create ||
@@ -240,8 +242,6 @@ class XPTIScope {
240242
MTraceType == (uint16_t)xpti::trace_point_type_t::diagnostics)
241243
return;
242244

243-
MTraceType = MTraceType | 1;
244-
245245
// Only notify for a trace type that has a begin/end
246246
xptiNotifySubscribers(MStreamID, MTraceType, nullptr, MTraceEvent,
247247
MInstanceID, static_cast<const void *>(MUserData));

0 commit comments

Comments
 (0)