Skip to content
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

Update High CPU Tutorial #29112

Merged
merged 6 commits into from
Apr 28, 2022
Merged

Update High CPU Tutorial #29112

merged 6 commits into from
Apr 28, 2022

Conversation

mikelle-rogers
Copy link
Member

Initial changes to clarify tutorial

Summary

Update tutorial for clarity

Fixes dotnet/diagnostics/2901

Initial changes to clarify tutorial
docs/core/diagnostics/debug-highcpu.md Outdated Show resolved Hide resolved
docs/core/diagnostics/debug-highcpu.md Show resolved Hide resolved
docs/core/diagnostics/debug-highcpu.md Show resolved Hide resolved
docs/core/diagnostics/debug-highcpu.md Outdated Show resolved Hide 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 tommcdon and a team as code owners April 25, 2022 21:32
Copy link
Member

@tommcdon tommcdon left a comment

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 a slow request, 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.
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
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
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
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 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