Skip to content

Commit a7b4a27

Browse files
Merge pull request #10451 from MicrosoftDocs/main638652170540212652sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents df938e0 + cd930f7 commit a7b4a27

8 files changed

+38
-10
lines changed

docs/profiling/dotnet-counters-tool.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The .NET Counters tool allows you to visualize [dotnet counters](/dotnet/core/di
1717
> [!NOTE]
1818
> The .NET Counters tool requires Visual Studio 2019 version 16.7 or later and targets .NET Core 3.0+ and .NET 5+.
1919
20+
For additional information on learning to use the .NET Counters tool effectively, see [Case study: Isolate a performance issue](../profiling/isolate-performance-issue.md).
21+
2022
## Setup
2123

2224
1. Open the Performance Profiler (**Alt + F2** or **Debug -> Performance Profiler**) in Visual Studio.

docs/profiling/flame-graph.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,53 @@ monikerRange: '>= vs-2022'
1313

1414
# Identify hot paths with a flame graph (C#, Visual Basic, C++, F#)
1515

16-
The **Flame Graph** in the CPU Usage and Instrumentation tools help you identify hot paths in your code by visualizing a call tree. Flame graphs are a visualization of categorized data, created to visualize stack traces of profiled software so that the most frequent code paths can be identified quickly and accurately. The graph gives a visual overview of where time is being spent in your application and you can click on specific nodes to dig into them further.
16+
Visual Studio profiling tools for CPU utilization and instrumentation include the **Flame Graph** view. The **Flame Graph** helps you identify *hot paths* in your code by showing a visualization of the call tree. The *hot path* is the call stack for the functions that are using the most CPU or the most time, and is often a good place to look for potential performance optimizations. The graph gives a visual overview of where time is being spent in your application and you can click on specific nodes to dig into them further.
1717

18-
![Screenshot showing Flame Graph with tooltips displayed.](./media/vs-2022/flame-graph-tooltips.png "Flame Graph with tooltips displayed")
18+
:::image type="content" source="./media/vs-2022/flame-graph-tooltips.gif" alt-text="Screenshot showing Flame Graph with context menu displayed." lightbox="media/vs-2022/flame-graph-tooltips.gif":::
1919

2020
For a tutorial that shows how to improve performance using the flame graph, see [Case study: Beginner's guide to optimizing code](../profiling/optimize-code-using-profiling-tools.md). For information on the CPU profiler, see [Analyze performance by using CPU profiling](../profiling/cpu-usage.md).
2121

2222
## Investigate hot paths
2323

24-
1. The Flame Graph view is in the details view of the tool, above the source line highlighting view. After you've stopped your profiling session, you can view the Flame Graph by clicking **Open details**.
24+
The Flame Graph view is in the details view of *.diagession* report.
2525

26-
![Screenshot showing Open details selected.](./media/vs-2022/flame-graph-open-details.png "Open details view selected")
26+
1. [Start a profiling session](../profiling/cpu-usage.md#collect-cpu-utilization-data) with either the CPU Usage or Instrumentation tool.
27+
28+
1. After you've stopped your profiling session and the report loads, select **Open details**.
29+
30+
![Screenshot showing Open Details selected.](./media/vs-2022/flame-graph-open-details.png "Open details view selected")
2731

2832
1. Select **Flame Graph** in the Current View dropdown selection.
2933

3034
![Screenshot showing Flame Graph view selected.](./media/vs-2022/flame-graph-view.png "Flame Graph view selected")
3135

3236
The Flame Graph view appears.
3337

34-
![Screenshot showing Flame Graph overview displayed.](./media/vs-2022/flame-graph-overview.png "Flame Graph overview displayed")
38+
:::image type="content" source="./media/vs-2022/flame-graph-overview.png" alt-text="Screenshot showing Flame Graph overview displayed." lightbox="media/vs-2022/flame-graph-overview.png":::
39+
40+
The hot path is the code path using the most CPU or the most time as you look downward through the call tree.
41+
42+
By default, the data shown in the Flame Graph represents the same data as shown in the **Call tree** view for the data collection period. Specifically, for CPU Usage, it shows the **Total CPU** values. This value is inclusive, so it includes CPU utilization (that is, CPU computation time) used by calls to the function, and any other functions called by the function. In the same way, for Instrumentation, the graph shows the values equivalent to the **Total** column in the call tree view.
43+
44+
However, if you select a node, the selected node becomes the new baseline and uses 100% of the flame graph width. This allows you to better visualize a complex call tree and view long names when they're truncated or hidden. Here is an example of a flame graph that shows a more complex call tree.
45+
46+
:::image type="content" source="./media/vs-2022/flame-graph-complex-call-tree.gif" alt-text="Screenshot showing Flame Graph for a complex call tree." lightbox="media/vs-2022/flame-graph-complex-call-tree.gif":::
47+
48+
To view details about any node, select the node.
49+
50+
Choose **Reset Zoom** to return to the default view.
51+
52+
You can also navigate to different views in the profiling report by selecting a node, and then choosing an option such as **View in call tree** from the context menu.
53+
54+
:::image type="content" source="./media/vs-2022/flame-graph-view-in-call-tree.png" alt-text="Screenshot showing Flame Graph option to view in call tree." lightbox="media/vs-2022/flame-graph-view-in-call-tree.png":::
55+
56+
## Flip the Flame Graph
57+
58+
By default, the flame graph in the tool is shown upside down or as an *icicle chart*, where the y-axis is counting stack depth downwards from zero at the top.
3559

36-
1. By default, the flame graph in the tool is shown upside down or as an "icicle chart," where the y-axis is counting stack depth downwards from zero at the top. You can view the standard flame chart layout by clicking **Flip Flame Graph**.
60+
You can view a standard flame chart layout by clicking **Flip Flame Graph**.
3761

38-
![Screenshot showing Flip Flame Graph selected.](./media/vs-2022/flame-graph-flip.png "Flip Flame Graph selected")
62+
![Screenshot showing Flip Flame Graph selected.](./media/vs-2022/flame-graph-flip.png "Flip Flame Graph selected")
3963

4064
## Navigate in the flame graph
4165

@@ -53,5 +77,5 @@ In the Flame Graph view, you can navigate by clicking on a node with a mouse or
5377

5478
## Related content
5579

56-
- [Diagnose high latency with CPU Insights](../profiling/cpu-insights.md)
80+
- [Case study: Beginner's guide to optimizing code](../profiling/optimize-code-using-profiling-tools.md)
5781
- [Analyze CPU usage without debugging](../profiling/cpu-usage.md)

docs/profiling/instrumentation-overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ To use this tool from the command-line, see the following article:
5858

5959
## Related content
6060

61-
- [First look at profiling tools](../profiling/profiling-feature-tour.md)
61+
- [Case study: Isolate a performance issue](../profiling/isolate-performance-issue.md)
6262
- [Improving Visual Studio performance with the new Instrumentation Tool](https://devblogs.microsoft.com/visualstudio/improving-visual-studio-performance-with-the-new-instrumentation-tool/).
63+
- [First look at profiling tools](../profiling/profiling-feature-tour.md)

docs/profiling/instrumentation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ monikerRange: '>= vs-2022'
1616
With the release of Visual Studio 2022 version 17.5, you can use the new dynamic Instrumentation tool. This tool shows the exact number of times your functions are called and is faster than the previous version of the Instrumentation tool. This tool supports .NET Core instrumentation without needing PDBs.
1717
Starting in Visual Studio 2022 version 17.6 Preview 2, the tool also supports C/C++.
1818

19-
The tool is similar to the CPU Usage tool except it's based on wall clock time instead of CPU utilization. This means blocked time such as time spent waiting for locks will show up in the instrumentation trace, unlike the CPU Usage tool. For additional information on learning to use the Instrumentation tool effectively, see [Instrumentation Overview](../profiling/instrumentation-overview.md) and [Improving Visual Studio performance with the new Instrumentation Tool](https://devblogs.microsoft.com/visualstudio/improving-visual-studio-performance-with-the-new-instrumentation-tool/).
19+
The tool is similar to the CPU Usage tool except it's based on wall clock time instead of CPU utilization. This means blocked time such as time spent waiting for locks will show up in the instrumentation trace, unlike the CPU Usage tool. For additional information on learning to use the Instrumentation tool effectively, see [Instrumentation Overview](../profiling/instrumentation-overview.md) and [Case study: Isolate a performance issue](../profiling/isolate-performance-issue.md).
2020

2121
## Instrument your application
2222

@@ -102,4 +102,5 @@ Here is more information on the column values:
102102
## Related content
103103

104104
- [Instrumentation](../profiling/instrumentation.md)
105+
- [Improving Visual Studio performance with the new Instrumentation Tool](https://devblogs.microsoft.com/visualstudio/improving-visual-studio-performance-with-the-new-instrumentation-tool/)
105106
- [First look at profiling tools](../profiling/profiling-feature-tour.md)
Loading
Loading
Binary file not shown.
Loading

0 commit comments

Comments
 (0)