-
Notifications
You must be signed in to change notification settings - Fork 565
Add EventPipe tracing support #6022
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
Conversation
|
|
||
| <PropertyGroup> | ||
| <AndroidEnableProfiler Condition=" '$(AndroidEnableProfiler)' == ''">false</AndroidEnableProfiler> | ||
| <AndroidEnableHotReload Condition=" '$(AndroidEnableHotReload)' == '' and '$(Configuration)' == 'Debug' ">true</AndroidEnableHotReload> |
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.
now that I think about it do we really need a true value for this? If this is controlled by the IDE then it will be responsible for passing in the value right? I which case we should just always default to false if AndroidEnableHotReload is not already set.
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.
Is hot reload usable outside the IDE?
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.
I dunno something to ask. It is a Dev Loop feature so I would guess it kinda needs an IDE.
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.
I'd also move these settings to Microsoft.Android.Sdk.DefaultProperties.targets.
| <UseMonoRuntime Condition=" '$(UseMonoRuntime)' == '' ">true</UseMonoRuntime> | ||
|
|
||
| <!-- Mono components --> | ||
| <AndroidEnableProfiler Condition=" '$(AndroidEnableProfiler)' == ''">false</AndroidEnableProfiler> |
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.
The $(AndroidIncludeDebugSymbols) initialization should also be updated to take $(AndroidEnableProfiler) into consideration: https://github.com/xamarin/xamarin-android/blob/7e9f595f23ebd5b53385b16e3890bc90f95f6fef/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets#L302-L323
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.
What do you mean @jonpryor? The profiler is independent on whether or not the build is a debug one, it can be used in both after all
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
51e9067 to
a83436e
Compare
`EventPipe` is a dotnet mechanism to implement profiling/tracing of .NET5+ applications. It replaces the Mono logging profiler which no longer works. This commit adds support of packaging the Mono components required for EventPipe to work in the application APK as well as runtime support for initializing and enabling the profiler. Profiler is enabled by setting the `debug.mono.profile` Android system property to the appropriate value (e.g. `127.0.0.1:9000,suspend`) which is then exported by the XA runtime as an environment variable (`DOTNET_DiagnosticPorts`) which, in turn, is read by the EventPipe component in order to start profiling. Details of the process are documented in the `Documentation/guides/tracing.md` file.
a83436e to
883ec21
Compare
jonathanpeppers
left a comment
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.
Otherwise LGTM, the test failures look the same as what's failing on main right now.
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
...id.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
Outdated
Show resolved
Hide resolved
…Microsoft.Android.Sdk.AssemblyResolution.targets Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
…Microsoft.Android.Sdk.DefaultProperties.targets Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
* Add EventPipe tracing support `EventPipe` is a dotnet mechanism to implement profiling/tracing of .NET5+ applications. It replaces the Mono logging profiler which no longer works. This commit adds support of packaging the Mono components required for EventPipe to work in the application APK as well as runtime support for initializing and enabling the profiler. Profiler is enabled by setting the `debug.mono.profile` Android system property to the appropriate value (e.g. `127.0.0.1:9000,suspend`) which is then exported by the XA runtime as an environment variable (`DOTNET_DiagnosticPorts`) which, in turn, is read by the EventPipe component in order to start profiling. Details of the process are documented in the `Documentation/guides/tracing.md` file. Co-authored-by: Jonathan Peppers <jonathan.peppers@gmail.com>
EventPipeis a dotnet mechanism to implement profiling/tracing of.NET5+ applications. It replaces the Mono logging profiler which no
longer works.
This commit adds support of packaging the Mono components required for
EventPipe to work in the application APK as well as runtime support for
initializing and enabling the profiler.
Profiler is enabled by setting the
debug.mono.profileAndroid systemproperty to the appropriate value (e.g.
127.0.0.1:9000,suspend) whichis then exported by the XA runtime as an environment
variable (
DOTNET_DiagnosticPorts) which, in turn, is read by theEventPipe component in order to start profiling.
Details of the process are documented in the
Documentation/guides/tracing.mdfile.