-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LLDB] Add load core time to target metrics #161581
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,6 +255,7 @@ SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) { | |
| ProcessSP process_sp(target_sp->CreateProcess( | ||
| target_sp->GetDebugger().GetListener(), "", &filespec, false)); | ||
| if (process_sp) { | ||
| ElapsedTime loadCoreTime(target_sp->GetStatistics().GetLoadCoreTime()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of doing this in two places, why not putting this into |
||
| error.SetError(process_sp->LoadCore()); | ||
| if (error.Success()) | ||
| sb_process.SetSP(process_sp); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -418,7 +418,11 @@ class CommandObjectTargetCreate : public CommandObjectParsed { | |||||
| if (process_sp) { | ||||||
| // Seems weird that we Launch a core file, but that is what we | ||||||
| // do! | ||||||
| error = process_sp->LoadCore(); | ||||||
| { | ||||||
| ElapsedTime loadCoreTime( | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| target_sp->GetStatistics().GetLoadCoreTime()); | ||||||
| error = process_sp->LoadCore(); | ||||||
| } | ||||||
|
|
||||||
| if (error.Fail()) { | ||||||
| result.AppendError(error.AsCString("unknown core file format")); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,6 +148,11 @@ TargetStats::ToJSON(Target &target, | |
| target_metrics_json.try_emplace("targetCreateTime", | ||
| m_create_time.get().count()); | ||
|
|
||
| if (m_load_core_time.get().count() > 0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to conditionally add the "loadCoreTime"? Seems a value of 0 would be just as clear and could be nice to always have the key present.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to not clutter the output with added metrics. I know it's JSON and any automation reading it probably won't be bothered but for humans it might be weird to see 'loadCoreTime' in your live debugging stats. |
||
| target_metrics_json.try_emplace("loadCoreTime", | ||
| m_load_core_time.get().count()); | ||
| } | ||
|
|
||
| json::Array breakpoints_array; | ||
| double totalBreakpointResolveTime = 0.0; | ||
| // Report both the normal breakpoint list and the internal breakpoint list. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- !minidump | ||
| Streams: | ||
| - Type: SystemInfo | ||
| Processor Arch: ARM | ||
| Platform ID: Linux | ||
| CSD Version: '15E216' | ||
| CPU: | ||
| CPUID: 0x00000000 | ||
| - Type: ModuleList | ||
| Modules: | ||
| - Base of Image: 0x0000000000001000 | ||
| Size of Image: 0x00001000 | ||
| Module Name: '/tmp/a' | ||
| CodeView Record: 4C4570420102030405060708090A0B0C0D0E0F1011121314 | ||
| - Base of Image: 0x0000000000001000 | ||
| Size of Image: 0x00001000 | ||
| Module Name: '/tmp/b' | ||
| CodeView Record: 4C4570420A141E28323C46505A646E78828C96A0AAB4BEC8 | ||
| ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @JDevlieghere welcome back from vacation! I'll make sure to fix this, this one slipped through just because I context switched back and forth from json mode so many times. Apologies!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! And no worries, that's why we have post-commit review :-)