dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.92k stars 526 forks source link

Port GREF logging to .NET 6+ EventSource infrastructure #6822

Open jonathanpeppers opened 2 years ago

jonathanpeppers commented 2 years ago

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.NET 6

Description

The .NET Podcast app shows dotnet trace output for:

image

https://github.com/xamarin/xamarin-android/blob/af2875138afada68a870cc803c3e8dcd2e85ff6f/src/Mono.Android/Android.Runtime/AndroidRuntime.cs#L178-L188

https://github.com/xamarin/xamarin-android/blob/af2875138afada68a870cc803c3e8dcd2e85ff6f/src/Mono.Android/Android.Runtime/AndroidRuntime.cs#L206-L211

This logging is almost always disabled, but we call into unmanaged code to increment an integer.

We could ideally port this logging to EventSource and do everything on the managed side -- avoid p/invoke for these.

Steps to Reproduce

Get dotnet trace output for an .NET 6 app.

Did you find any workaround?

No response

Relevant log output

No response

jonathanpeppers commented 2 years ago

FYI this an idea for the future.