diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h index 9437e605e4ec..7c0ee78b8728 100644 --- a/src/inc/eventtracebase.h +++ b/src/inc/eventtracebase.h @@ -100,7 +100,7 @@ enum EtwThreadFlags #define ETWFireEvent(EventName) #define ETW_TRACING_INITIALIZED(RegHandle) (TRUE) -#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::Enabled() || EventEnabled##EventDescriptor()) +#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) #define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) #define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor()) #define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::Enabled() || XplatEventLogger::IsEventLoggingEnabled()) @@ -111,7 +111,7 @@ enum EtwThreadFlags #define ETWFireEvent(EventName) #define ETW_TRACING_INITIALIZED(RegHandle) (TRUE) -#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor()) +#define ETW_EVENT_ENABLED(Context, EventDescriptor) (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsEventLoggingEnabled()) #define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor()) #define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsEventLoggingEnabled()) diff --git a/src/scripts/genEventPipe.py b/src/scripts/genEventPipe.py index fc4570bf14ca..a8d891861ad9 100644 --- a/src/scripts/genEventPipe.py +++ b/src/scripts/genEventPipe.py @@ -437,7 +437,7 @@ def generateEventPipeImplFiles( return false; }} - *(T *)(buffer + offset) = value; + memcpy(buffer + offset, (char *)&value, sizeof(T)); offset += sizeof(T); return true; }} diff --git a/src/scripts/genEventing.py b/src/scripts/genEventing.py index 123ce81be4f3..8079bec262fa 100644 --- a/src/scripts/genEventing.py +++ b/src/scripts/genEventing.py @@ -285,7 +285,7 @@ def generateClrallEvents(eventNodes,allTemplates): clrallEvents.append(eventName) clrallEvents.append("() {return ") clrallEvents.append("EventPipeEventEnabled" + eventName + "() || ") - clrallEvents.append("EventXplatEnabled" + eventName + "();}\n\n") + clrallEvents.append("(XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabled" + eventName + "());}\n\n") #generate FireEtw functions fnptype = [] fnbody = [] @@ -815,4 +815,4 @@ def main(argv): if __name__ == '__main__': return_code = main(sys.argv[1:]) - sys.exit(return_code) \ No newline at end of file + sys.exit(return_code) diff --git a/src/scripts/genLttngProvider.py b/src/scripts/genLttngProvider.py index 382cb746754e..de537d0f1a77 100644 --- a/src/scripts/genLttngProvider.py +++ b/src/scripts/genLttngProvider.py @@ -732,7 +732,7 @@ def generateLttngFiles(etwmanifest,eventprovider_directory): return false; } - *(T *)(buffer + offset) = value; + memcpy(buffer + offset, (char *)&value, sizeof(T)); offset += sizeof(T); return true; }