Skip to content
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

Write perfmap and jitdump files to /tmp by default #88776

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

tommcdon
Copy link
Member

Perfmaps and Jitdumps is a Linux kernel feature that allows .NET to symbolicate dynamically generated code with perf_events. The perfmap/jitdump files are processed by the the Linux perf tool to generate human readable callstacks for CPU traces, for example. The Linux implementation looks for the perfmap/jitdump files in /tmp (please see https://elixir.bootlin.com/linux/v6.4.3/source/tools/perf/util/symbol.c#L1838). The .NET implementation defaults to writing to /tmp but this can be overridden with the $TMPDIR environment variable. This leads to incorrect behavior in environments where $TMPDIR is in use. This code change alters the behavior and will use /tmp regardless of $TMPDIR settings. There is a minor fix included with this change that correctly sets perfmap location if DOTNET_PerfMapJitDumpPath is set.

Co-authored-by: David Mason <davmason@microsoft.com>
@ghost
Copy link

ghost commented Jul 12, 2023

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Perfmaps and Jitdumps is a Linux kernel feature that allows .NET to symbolicate dynamically generated code with perf_events. The perfmap/jitdump files are processed by the the Linux perf tool to generate human readable callstacks for CPU traces, for example. The Linux implementation looks for the perfmap/jitdump files in /tmp (please see https://elixir.bootlin.com/linux/v6.4.3/source/tools/perf/util/symbol.c#L1838). The .NET implementation defaults to writing to /tmp but this can be overridden with the $TMPDIR environment variable. This leads to incorrect behavior in environments where $TMPDIR is in use. This code change alters the behavior and will use /tmp regardless of $TMPDIR settings. There is a minor fix included with this change that correctly sets perfmap location if DOTNET_PerfMapJitDumpPath is set.

Author: tommcdon
Assignees: tommcdon
Labels:

area-Diagnostics-coreclr, area-VM-coreclr

Milestone: -

@tommcdon tommcdon added this to the 8.0.0 milestone Jul 12, 2023
Copy link
Member

@davmason davmason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tommcdon
Copy link
Member Author

All failures are known issues, merging.

@tommcdon tommcdon merged commit e4c5b3e into dotnet:main Jul 13, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants