Skip to content

Add new provider for gc-collect profile - #3531

Merged
dramos020 merged 1 commit into
dotnet:mainfrom
dramos020:private_gc_events
Jan 10, 2023
Merged

Add new provider for gc-collect profile#3531
dramos020 merged 1 commit into
dotnet:mainfrom
dramos020:private_gc_events

Conversation

@dramos020

@dramos020 dramos020 commented Nov 30, 2022

Copy link
Copy Markdown
Contributor

Adds the profile mentioned in #3521 in order to include private gc events in the gc-collect profile. Can see this working by using the following sample application:

using System.Collections;

class ConsoleTest{
    public static void Main(){
        List<int> nums = new List<int> {};

        Console.WriteLine("Currently Running");
     
        while(true){
            List<object> objects = new List<object>();
            for (int i = 0; i < 100000; ++i)
            {
                objects.Add(new object());
            }
            objects.Clear();
        }
    }
}

and dotnet-trace to collect a trace:

dotnet-trace collect --profile gc-collect -n sampleapp

This results in the following events being generated, making note of the private gc events:
private gc events

@dramos020
dramos020 marked this pull request as ready for review January 10, 2023 18:55
@dramos020
dramos020 requested a review from a team as a code owner January 10, 2023 18:55
@dramos020
dramos020 requested a review from davmason January 10, 2023 18:56

@hoyosjs hoyosjs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hoyosjs

hoyosjs commented Jan 10, 2023

Copy link
Copy Markdown
Member

cc: @cshung @Maoni0

@tommcdon tommcdon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@Maoni0

Maoni0 commented Jan 10, 2023

Copy link
Copy Markdown
Member

thanks @hoyosjs! I'm curious why those rundown events are there even though they are not in the list of events we collect for this profile?

@davmason

Copy link
Copy Markdown
Contributor

Currently dotnet-trace is hardcoded to always request rundown, the true as the second parameter here is to request rundown:

session = diagnosticsClient.StartEventPipeSession(providerCollection, true, (int)buffersize);

We should generally have an option to skip rundown, I opened #3597 to track it.

@davmason davmason left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks Daniel!

@dramos020
dramos020 merged commit 21dbb38 into dotnet:main Jan 10, 2023
@Maoni0

Maoni0 commented Jan 10, 2023

Copy link
Copy Markdown
Member

great, thanks @dramos020 for doing this work, and @davmason for the new issue!

@github-actions github-actions Bot locked and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants