Skip to content

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

Open
@kouvel

Description

@kouvel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions