dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.07k stars 4.69k forks source link

LTTng support for Mono runtime #65181

Open stefan-sf-ibm opened 2 years ago

stefan-sf-ibm commented 2 years ago

Description

The document Performance Tracing on Linux speaks only about CoreCLR when it comes to LTTng. Thus, I'm wondering whether LTTng is supported while using the Mono runtime.

What makes me curios is that while building the .NET6 SDK with Mono as its primary runtime flavor I see that genLttngProvider.py is executed and code for the LTTng event provider is generated. However, a trace, for example generated via perfcollect does not include any user space event. In contrast if the same example is run with a .NET6 SDK utilizing CoreCLR, then user space events are recorded.

Can someone shed some light on whether LTTng is supported for Mono runtime?

Reproduction Steps

Run perfcollect collect foobar and use a .NET6 SDK with Mono as its primary runtime flavor:

dotnet new console
export DOTNET_PerfMapEnabled=1
export DOTNET_EnableEventLog=1
dotnet run

Afterwards inspect the trace file via babeltrace:

perfcollect view foobar.trace.zip -viewer lttng

Expected behavior

Thousands of user space events.

Actual behavior

Not a single event is shown.

Regression?

No response

Known Workarounds

No response

Configuration

Other information

No response

uweigand commented 2 years ago

FYI @steveisok @directhex @leecow - this is the LTTng Mono problem we had been discussing recently ...

steveisok commented 2 years ago

/cc @lambdageek @lateralusX

lambdageek commented 2 years ago

whether LTTng is supported for Mono runtime

There is no LTTng support for Mono in .NET 6

lateralusX commented 2 years ago

LTTng support was not included in .NET 6 since main focus was hooking up regular EventPipe events (to be included in nettrace) as well as targeting mobile platforms. Since we share most of the code with CoreCLR, most of the infrastructure is currently in place and enabling LTTng for the runtime events currently emitted by Mono (a subset of runtime events emitted by CoreCLR) should be able to leverage most of that code, but we would still need to hook up, enable and test Mono LTTng support, so something that would need to go onto the backlog.