-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix EventPipe on Android CoreClr. #112270
Fix EventPipe on Android CoreClr. #112270
Conversation
EventPipe CMake was causing issues when building CoreClr due to creating two versions of ep-shared-config.h with different set of variables when targeting iOS/tvOS/Android. Both include paths ended up being added and together with EventPipe's unity build, this caused issues since the wrong ep-shared-config.h was picked up, incorrect enabled default listeners as result of having wrong values for FEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT and FEATURE_PERFTRACING_PAL_TCP. Mono doesn't have this issue since it only creates one ep-shared-config.h. Commit makes sure we only setup on ep-shared-config.h and eventpipe libraries adds the include folder to its library targets. Commit also adds support to set DOTNET_DiagnosticPorts as part of building Android sample to simplify enable/disable diagnostics, similar to how Mono Android sample works. Couple of smaller adjustments to ApkBuilder.
bfeec11
to
77b9c7a
Compare
// NOTE, using DOTNET_DiagnosticPorts requires app build using AndroidAppBuilder and RuntimeComponents to include 'diagnostics_tracing' component | ||
#ifdef DIAGNOSTIC_PORTS | ||
setenv ("DOTNET_DiagnosticPorts", DIAGNOSTIC_PORTS, true); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the same for AppleAppBuilder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean for NAOT on iOS? Not sure if that has been enabled yet. But once we do, then we could add this for iOS inline with what we do on Mono.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(NativeAOT for iOS shipped since .NET 8; CoreCLR for iOS Simulator landed on main last month)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, but what I don't know if NATO + iOS also includes EventPipe support, do you know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the CoreCLR for iOS Simulator I believe we should do similar work to make sure EventPipe is build using right flags + include similar support in AppleAppBuilder, but we could do that as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know, but what I don't know if NATO + iOS also includes EventPipe support, do you know?
Yes, it does, in theory...although I am not sure if it ever worked or if it was tested. The GC heap events were not wired so I never bothered to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventpipe infra changes look good to me
EventPipe CMake was causing issues when building CoreClr due to creating two versions of ep-shared-config.h with different set of variables when targeting iOS/tvOS/Android. Both include paths ended up being added and together with EventPipe's unity build, this caused issues since the wrong ep-shared-config.h was picked up, incorrect enabled default listeners as result of having wrong values for FEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT and
FEATURE_PERFTRACING_PAL_TCP. Mono doesn't
have this issue since it only creates one ep-shared-config.h.
Commit makes sure we only setup on ep-shared-config.h and eventpipe libraries adds the include folder to its library targets.
Commit also adds support to set DOTNET_DiagnosticPorts as part of building Android sample to simplify enable/disable diagnostics, similar to how Mono Android sample works.
Couple of smaller adjustments to ApkBuilder.