TraceLoggingEventEnabled - fix for events with keywords (#21)
Bug in TraceLoggingEventEnabled that only occurs if the event has a keyword. `TraceLoggingEventEnabled(ProviderSymbol, "EventName")` needs to look up the requested event. Events are identified by a "ProviderName:EventName;KeywordSuffix" string. TraceLoggingEventEnabled is supposed to work by creating a "ProviderName:EventName" string, doing a prefix match on the event, and if the prefix match succeeds, we check that the next character is a ';' (meaning we matched up to the keyword prefix) or a 0 (meaning we matched the full event string). Due to a bug, instead it creates a "ProviderName:EventName;k;" string. This successfully matches as long as the event has no keywords, but it incorrectly fails to match if the event does have any keywords. Fix is to cut off the last three characters after creating the "ProviderName:EventName;k;" string.
This commit is contained in:
Родитель
ccde8556db
Коммит
39921c9feb
|
@ -1516,7 +1516,7 @@ Examples:
|
|||
pchEventFullName,
|
||||
pProvider->ProbeDesc.provider, (unsigned)strlen(pProvider->ProbeDesc.provider),
|
||||
eventName, (unsigned)strlen(eventName),
|
||||
0); // Don't add keyword suffix.
|
||||
0) - 3; // Don't add keyword suffix.
|
||||
|
||||
for (struct lttng_event_desc const **ppDesc = pEventDescStart; ppDesc != pEventDescStop; ppDesc += 1)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче