Skip to content

Commit 8655a1e

Browse files
fix(ci): Enable CPU profiling and add dotnet tools to PATH
- Add dotnet tools directory to PATH for subsequent steps - Switch from --providers to --profile cpu-sampling for actual CPU profiling - This generates flamegraphs with real stack traces instead of empty traces Previous approach only captured runtime events (GC, JIT) without CPU samples. The cpu-sampling profile includes Microsoft-DotNETCore-SampleProfiler which captures stack traces at 1ms intervals, enabling proper performance analysis. Tested locally with act - generates 22KB trace with actual profiling data. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e34e7da commit 8655a1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/dotnet.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ jobs:
102102
dotnet-version: 8.0.x
103103
- name: Install dotnet-trace
104104
run: dotnet tool install --global dotnet-trace
105+
- name: Add dotnet tools to PATH
106+
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
105107
- name: Restore Dependencies
106108
run: dotnet restore ProbotSharp.sln
107109
- name: Restore HelloWorldBot
@@ -146,7 +148,7 @@ jobs:
146148
run: |
147149
echo "Collecting trace from HelloWorldBot process..."
148150
echo "TMPDIR is set to: $TMPDIR"
149-
dotnet-trace collect --name HelloWorldBot --providers Microsoft-Windows-DotNETRuntime --duration 00:00:30 -o trace.nettrace || (echo "Trace collection failed!" && exit 1)
151+
dotnet-trace collect --name HelloWorldBot --profile cpu-sampling --duration 00:00:30 -o trace.nettrace || (echo "Trace collection failed!" && exit 1)
150152
- name: Convert trace to Speedscope format
151153
run: dotnet-trace convert trace.nettrace --format Speedscope
152154
- name: Upload flamegraph artifact

0 commit comments

Comments
 (0)