Skip to content

Commit

Permalink
Fix LTTng build for build environments with older liblttng-ust-dev (d…
Browse files Browse the repository at this point in the history
…otnet#27273) (dotnet#27294)

* Fix macro redefinition to use XplatEventLogger instead of simply writing FALSE

* Fix linker error

* undo newline changes

* Some changes to comment

* Move wrapper export from eventpipe.cpp to eventtrace.cpp
  • Loading branch information
sywhang authored Oct 21, 2019
1 parent a43e0c2 commit 7a8e08c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scripts/genLttngProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ def generateLttngFiles(etwmanifest,eventprovider_directory, dryRun):
lttngimpl_file.write("#include \"" + lttngevntheadershortname + "\"\n\n")

lttngimpl_file.write("""#ifndef tracepoint_enabled
#define tracepoint_enabled(provider, name) FALSE
extern "C" bool XplatEventLoggerIsEnabled();
#define tracepoint_enabled(provider, name) XplatEventLoggerIsEnabled()
#define do_tracepoint tracepoint
#endif
Expand Down
8 changes: 8 additions & 0 deletions src/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7543,3 +7543,11 @@ bool EventPipeHelper::IsEnabled(DOTNET_TRACE_CONTEXT Context, UCHAR Level, ULONG
return false;
}
#endif // FEATURE_PERFTRACING

#if defined(FEATURE_PAL) && defined(FEATURE_PERFTRACING)
// This is a wrapper method for LTTng. See https://github.com/dotnet/coreclr/pull/27273 for details.
extern "C" bool XplatEventLoggerIsEnabled()
{
return XplatEventLogger::IsEventLoggingEnabled();
}
#endif // FEATURE_PAL && FEATURE_PERFTRACING

0 comments on commit 7a8e08c

Please sign in to comment.