Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Change heap dumps to use HEAP2 as the default#127321
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7fe8771
First basic HEAP2 and dump option cleanup
hoyosjs a731fb4
Remove first level of HEAP2 branches
hoyosjs 594da9f
Update src/coreclr/debug/createdump/crashinfo.cpp
hoyosjs 025eaa8
Apply suggestions from code review
hoyosjs 6caf968
Fix final feedback
hoyosjs 9ef63b9
Merge branch 'juhoyosa/heap2-default' of https://github.com/hoyosjs/r…
hoyosjs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1865,97 +1865,51 @@ HRESULT ClrDataAccess::EnumMemWriteDataSegment() | ||
| //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| // | ||
| // Custom Dump. Depending on the value of g_ECustomDumpFlavor, different dump | ||
| // will be taken. You can set this global variable using hosting API | ||
| // ICLRErrorReportingManager::BeginCustomDump. | ||
| // Custom dumps enumerate the minimal CLR state needed for | ||
| // MiniDumpWithFullAuxiliaryState: thread stacks, modules, CLR statics, and any | ||
| // memory reached implicitly from those roots. | ||
| // | ||
| //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| HRESULT ClrDataAccess::EnumMemoryRegionsWorkerCustom() | ||
| { | ||
| SUPPORTS_DAC; | ||
| HRESULT status = S_OK; | ||
| ECustomDumpFlavor eFlavor; | ||
| eFlavor = DUMP_FLAVOR_Default; | ||
| m_enumMemFlags = CLRDATA_ENUM_MEM_MINI; | ||
hoyosjs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| // clear all of the previous cached memory | ||
| Flush(); | ||
| if (eFlavor == DUMP_FLAVOR_Mini) | ||
| // Iterating to all threads' stacks | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpAllThreadsStack(m_enumMemFlags); ) | ||
| if (FAILED(status)) | ||
| { | ||
| // Iterating to all threads' stacks | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpAllThreadsStack(m_enumMemFlags); ) | ||
| // Iterating to module list. | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpModuleList(m_enumMemFlags); ) | ||
| // | ||
| // iterating through static that we care | ||
| // | ||
| // collect CLR static | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRStatic(m_enumMemFlags); ) | ||
| // we are done... | ||
| // now dump the memory get dragged in implicitly | ||
| m_dumpStats.m_cbImplicitly = m_instances.DumpAllInstances(m_enumMemCb); | ||
| return status; | ||
| } | ||
| else if (eFlavor == DUMP_FLAVOR_CriticalCLRState) | ||
| { | ||
| // We need to walk Threads stack to view managed frames. | ||
| // Iterating through module list | ||
| // Iterating to all threads' stacks | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpAllThreadsStack(m_enumMemFlags); ) | ||
| // Iterating to module list. | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpModuleList(m_enumMemFlags); ) | ||
| // | ||
| // iterating through static that we care | ||
| // | ||
| // collect CLR static | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRStatic(m_enumMemFlags); ) | ||
| // Collecting some CLR secondary critical data | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRHeapCrticalStatic(m_enumMemFlags); ) | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemWriteDataSegment(); ) | ||
| // we are done... | ||
| // now dump the memory get dragged in implicitly | ||
| m_dumpStats.m_cbImplicitly = m_instances.DumpAllInstances(m_enumMemCb); | ||
| } | ||
| else if (eFlavor == DUMP_FLAVOR_NonHeapCLRState) | ||
| // Iterating to module list. | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemDumpModuleList(m_enumMemFlags); ) | ||
| if (FAILED(status)) | ||
| { | ||
| // since all CLR hosted heap will be dump by the host, | ||
| // the EE structures that are not loaded using LoadLibrary will | ||
| // be included by the host. | ||
| // | ||
| // Thus we only need to include mscorwks's critical data and ngen images | ||
| m_enumMemFlags = CLRDATA_ENUM_MEM_HEAP; | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRStatic(m_enumMemFlags); ) | ||
| // Collecting some CLR secondary critical data | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRHeapCrticalStatic(m_enumMemFlags); ) | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemWriteDataSegment(); ) | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCollectImages(); ) | ||
| return status; | ||
| } | ||
| else | ||
| // | ||
| // iterating through static that we care | ||
| // | ||
| // collect CLR static | ||
| CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( status = EnumMemCLRStatic(m_enumMemFlags); ) | ||
| if (FAILED(status)) | ||
| { | ||
| status = E_INVALIDARG; | ||
| return status; | ||
| } | ||
| return S_OK; | ||
| // we are done... | ||
| // now dump the memory get dragged in implicitly | ||
| m_dumpStats.m_cbImplicitly = m_instances.DumpAllInstances(m_enumMemCb); | ||
| return status; | ||
| } | ||
hoyosjs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| @@ -1999,7 +1953,7 @@ HRESULT ClrDataAccess::EnumMemoryRegionsWrapper(IN CLRDataEnumMemoryFlags flags) | ||
| // triage micro-dump | ||
| status = EnumMemoryRegionsWorkerMicroTriage(flags); | ||
| } | ||
| else if (flags == CLRDATA_ENUM_MEM_HEAP || flags == CLRDATA_ENUM_MEM_HEAP2) | ||
| else if (flags == CLRDATA_ENUM_MEM_HEAP2) | ||
| { | ||
| status = EnumMemoryRegionsWorkerHeap(flags); | ||
| } | ||
| @@ -2091,16 +2045,7 @@ ClrDataAccess::EnumMemoryRegions(IN ICLRDataEnumMemoryRegionsCallback* callback, | ||
| ClearDumpStats(); | ||
| if (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) | ||
| { | ||
| // heap dump | ||
| if (flags == CLRDATA_ENUM_MEM_HEAP2) | ||
| { | ||
| DacLogMessage("EnumMemoryRegions(CLRDATA_ENUM_MEM_HEAP2)\n"); | ||
| } | ||
| else | ||
| { | ||
| flags = CLRDATA_ENUM_MEM_HEAP; | ||
| } | ||
| status = EnumMemoryRegionsWrapper(flags); | ||
| status = EnumMemoryRegionsWrapper(CLRDATA_ENUM_MEM_HEAP2); | ||
| } | ||
| else if (miniDumpFlags & MiniDumpWithFullAuxiliaryState) | ||
| { | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.