Skip to content

Update High CPU Tutorial - #29112

Merged
mikelle-rogers merged 6 commits into
mainfrom
dev/mirogers/debug-high-CPU
Apr 28, 2022
Merged

mikelle-rogers merged 6 commits into
mainfrom
dev/mirogers/debug-high-CPU

Conversation

@mikelle-rogers

Copy link
Copy Markdown
Member

Initial changes to clarify tutorial

Summary

Update tutorial for clarity

Fixes dotnet/diagnostics/2901

Initial changes to clarify tutorial
Comment thread docs/core/diagnostics/debug-highcpu.md Resolved
Comment thread docs/core/diagnostics/debug-highcpu.md Resolved
Comment thread docs/core/diagnostics/debug-highcpu.md Resolved
Comment thread docs/core/diagnostics/debug-highcpu.md Resolved
mikelle-rogers and others added 3 commits April 20, 2022 12:03
Show how perfview opens from step one.
This reverts commit 33a3a73.

Images not needed
Updated counters section to follow a natural flow, increased detail regarding reasoning behind trace options and opening perfview.
@mikelle-rogers
mikelle-rogers marked this pull request as ready for review April 25, 2022 21:32
@mikelle-rogers
mikelle-rogers requested review from a team and tommcdon as code owners April 25, 2022 21:32

@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.

Left a comment for your consideration

When analyzing an app with high CPU usage, you need a diagnostics tool that can provide insights into what the code is doing. The usual choice is a profiler, and there are different profiler options to choose from.

### [Linux](#tab/linux)

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.

Should we explain why we suggest using the Linux perf tool and not dotnet-trace? I'm guessing the reason is something like: Although Dotnet-Trace is cross-platform but since Event Pipe "CPU" traces only measure elapsed time and not actual CPU time.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had the same question. @josalem Why are we using the Linux perf tool and not dotnet-trace?

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.

dotnet-trace is great for CPU investigations to a certain point. The limitations of safe-point bias and managed-only callstacks means that it can't give exact information the same way a kernel-aware profiler like perf can.

If your performance investigation stops at managed code, generally dotnet-trace will be sufficient. If you are analyzing exact timing of your application and it involves native code, you may need something like perf.

I think of it like two differently powered magnifying glasses. You can start with dotnet-trace and then look at a higher resolution using perf (or ETW on Windows).

@mikelle-rogers mikelle-rogers self-assigned this Apr 26, 2022
@mikelle-rogers
mikelle-rogers requested a review from josalem April 26, 2022 22:35
@mikelle-rogers
mikelle-rogers merged commit 0850832 into main Apr 28, 2022
@mikelle-rogers
mikelle-rogers deleted the dev/mirogers/debug-high-CPU branch April 28, 2022 16:29
@mikelle-rogers
mikelle-rogers restored the dev/mirogers/debug-high-CPU branch April 28, 2022 16:42
@gewarren
gewarren deleted the dev/mirogers/debug-high-CPU branch April 1, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diagnosing CPU usage with dotnet-trace and VS

5 participants