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

Rundown events sent during .NET Core app shutdown are not used to identify methods #1016

Open
kouvel opened this issue Oct 18, 2019 · 0 comments
Labels

Comments

@kouvel
Copy link
Member

kouvel commented Oct 18, 2019

From dotnet/coreclr#27238 (comment)

Repro:

using System;
using System.Runtime.CompilerServices;
using System.Threading;

static class PerfViewTierEventsTest
{
    private static void Main()
    {
        var t = new Thread(Run);
        t.IsBackground = true;
        t.Start();

        Thread.Sleep(2000);
        Console.Write("Enter to stop: ");
        Console.ReadLine();
    }

    [MethodImpl(MethodImplOptions.NoInlining)]
    private static void Run()
    {
        while (true)
            ++s_value;
    }

    private static int s_value;
}

From command prompt:

  • set COMPlus_TieredCompilation=0
  • Build and run the repro
  • After "Enter to stop:" is printed, start profiling in PerfView
  • After a few seconds, press enter on the app and wait for it to shut down
  • Stop profiling in PerfView

CPU stacks:

Name             	Exc %	   Exc	Inc %	     Inc	Fold	                             When	   First	      Last
?!0x7ffe959f9216 	 93.6	 3,568	 93.7	   3,572	   0	 _69999999999999999990___________	 250.452	 3,858.991

Expected behavior is that the frame with the highest number of samples is correctly named and it is possible to drill into the source code to see sample counts by line.

Event stats:

Name Count AverageSize StackCount
Microsoft-Windows-DotNETRuntimeRundown/Method/DCStopVerbose 68513 337 0
Microsoft-Windows-DotNETRuntimeRundown/Method/ILToNativeMapDCStop 61645 107 0

Although counts are shown for the events, they are not listed in the Events view when PerfView is started with -KeepAllEvents.

Also not sure why there would be so many of these events, looks like the counts may be incorrect as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants