Skip to content

Conversation

@davmason
Copy link
Contributor

Add apis to the dac to get generation specific data for SOS.

@davmason davmason added this to the 5.0 milestone Jun 13, 2020
@davmason davmason requested review from Maoni0, leculver and noahfalk June 13, 2020 08:05
@davmason davmason self-assigned this Jun 13, 2020
@ghost
Copy link

ghost commented Jun 13, 2020

Tagging subscribers to this area: @tommcdon
Notify danmosemsft if you want to be subscribed.

@davmason
Copy link
Contributor Author

Corresponding SOS changes in dotnet/diagnostics#1228

@Maoni0
Copy link
Member

Maoni0 commented Jun 13, 2020

it seems like the idea of this is to get 1 more than what NUMBERGENERATIONS. I had thought we'd do this by just getting the actual number of generations (you can add a method to GC's dac interface) instead of still hardcoding it. is there a problem doing that? that would allow us to accommodate more generations if need to instead of every time GC adds a new gen dac will have to be updated yet again.

@davmason
Copy link
Contributor Author

it seems like the idea of this is to get 1 more than what NUMBERGENERATIONS. I had thought we'd do this by just getting the actual number of generations (you can add a method to GC's dac interface) instead of still hardcoding it. is there a problem doing that? that would allow us to accommodate more generations if need to instead of every time GC adds a new gen dac will have to be updated yet again.

No problem at all. It's just hard coded everywhere in SOS so I was in that mindset. I just pushed changes to get the total number of generations from the GC. It looks like there is an interface version for the gc->dac stuff, but it is unused since the dac is built along the runtime. I did not bump the version, but can if it's necessary for any reason.

Copy link
Contributor

@leculver leculver left a comment

Choose a reason for hiding this comment

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

Nice work! I have a couple of minor things I would suggest changing before this gets checked in. Thanks!

Copy link
Contributor

@leculver leculver left a comment

Choose a reason for hiding this comment

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

LGTM

@Maoni0
Copy link
Member

Maoni0 commented Jun 16, 2020

that's great; thanks!

I noticed there are a ton of white space changes in gc.cpp. would you mind making a separate PR that just includes those changes alone? I too noticed recently there seems to be some sort of enforcement of the non trailing white space (I dunno why this is enforced).

return S_OK;
}

HRESULT ClrDataAccess::GetGenerationTable(unsigned int cGenerations, struct DacpGenerationData *pGenerationData, unsigned int *pNeeded)
Copy link
Member

Choose a reason for hiding this comment

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

unsigned int *pNeeded [](start = 113, length = 21)

is the only purpose of this arg is for verification on the sos side?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's so you can request the number of generations and dynamically allocated an array of the right size

unsigned int count;
if (SUCCEEDED(pSos->GetGenerationTable(0, NULL, &count)
{
    DacpGenerationData *pGenerationData = new DacpGenerationData[count];
    pSos->GetGenerationTable(count, pGenerationData, NULL);
}

Copy link
Member

Choose a reason for hiding this comment

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

I see. I didn't know it was going to be called this way. makes sense. thanks!

Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

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

LGTM; thanks for doing this, @davmason!

@@ -1 +0,0 @@
README No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

Anything was supposed to change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I'm not sure what was even changing that file. I wasn't opening it purposefully but every time I went to add a commit it was in the list

@VSadov
Copy link
Member

VSadov commented Jun 17, 2020

#define NUMBERGENERATIONS 4

Maybe add a comment here for the future that this number is now off intentionally for compat reasons. Perhaps a similar comment around DAC_NUMBERGENERATIONS as well.


Refers to: src/coreclr/src/gc/gcinterface.dac.h:21 in da453e0. [](commit_id = da453e0, deletion_comment = False)

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks!!

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

LGTM modulo a few comments inline, thanks @davmason!

@davmason davmason merged commit 3705185 into dotnet:master Jun 18, 2020
@davmason davmason deleted the poh_dac branch June 18, 2020 05:30
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
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.

5 participants