Skip to content

Add C++ sampling profiler support with FANTOM_PROFILE_CPP#55735

Open
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D92155573
Open

Add C++ sampling profiler support with FANTOM_PROFILE_CPP#55735
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D92155573

Conversation

@sammy-SC
Copy link
Contributor

Summary:
Add support for profiling C++ code in Fantom tests using Linux perf.

When FANTOM_PROFILE_CPP=1 is set, the fantom_tester binary is wrapped with perf record to capture sampling profiler data with DWARF call graphs.

Usage:

FANTOM_PROFILE_CPP=1 yarn fantom --benchmarks --testPathPattern="View-benchmark"

Output is saved to .out/cpp-traces/perf-<timestamp>.data and can be analyzed with:

perf report -i .out/cpp-traces/perf-<timestamp>.data

Differential Revision: D92155573

Summary:
Add support for profiling C++ code in Fantom tests using Linux `perf`. 

When `FANTOM_PROFILE_CPP=1` is set, the fantom_tester binary is wrapped with `perf record` to capture sampling profiler data with DWARF call graphs.

Usage:
```
FANTOM_PROFILE_CPP=1 yarn fantom --benchmarks --testPathPattern="View-benchmark"
```

Output is saved to `.out/cpp-traces/perf-<timestamp>.data` and can be analyzed with:
```
perf report -i .out/cpp-traces/perf-<timestamp>.data
```

Differential Revision: D92155573
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 25, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 25, 2026

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92155573.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants