| # Check perf2bolt pre-aggregated and perfscript profile emission from branch-stack perf data. |
| |
| REQUIRES: system-linux, perf-brstack |
| |
| RUN: %clang %S/Inputs/perf_test.c -no-pie -fuse-ld=lld -o %t |
| RUN: perf record -Fmax -j any,u,save_type -e cycles:u -o %t.perf.data -- %t |
| RUN: perf2bolt %t -p=%t.perf.data -o %t.fdata -ignore-build-id |
| RUN: sort %t.fdata > %t.fdata.sorted |
| # Pre-aggregated output: compare perf->preagg->fdata vs perf->fdata |
| RUN: perf2bolt %t -p=%t.perf.data -o %t.preagg -ignore-build-id --profile-format=preagg |
| RUN: perf2bolt %t -pa -p=%t.preagg -o %t.pa.roundtrip.fdata -ignore-build-id |
| RUN: sort %t.pa.roundtrip.fdata > %t.pa.roundtrip.fdata.sorted |
| RUN: diff %t.fdata.sorted %t.pa.roundtrip.fdata.sorted |
| # Perfscript output: compare perf->perfscript->fdata vs perf->fdata |
| RUN: perf2bolt %t -p=%t.perf.data -o %t.perfscript -ignore-build-id --profile-format=perfscript |
| RUN: perf2bolt %t -ps -p=%t.perfscript -o %t.ps.roundtrip.fdata -ignore-build-id |
| RUN: sort %t.ps.roundtrip.fdata > %t.ps.roundtrip.fdata.sorted |
| RUN: diff %t.fdata.sorted %t.ps.roundtrip.fdata.sorted |