Skip to content

Commit 152fded

Browse files
committed
Add a test for Samply.
1 parent 4e1ed99 commit 152fded

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ jobs:
175175
echo "${PWD}/build/bin" >> $GITHUB_PATH
176176
177177
- name: Install profilers
178-
run: cargo install --version 0.4.12 cargo-llvm-lines
178+
run: |
179+
cargo install --version 0.4.12 cargo-llvm-lines
180+
cargo install samply
179181
180182
- name: Install Bytehound
181183
run: |

ci/check-profiling.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ cargo build -p collector --bin rustc-fake
3939
# oprofile: untested... it's not used much, and might have the same problems
4040
# that `perf` has due to virtualized hardware.
4141

42+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
43+
cargo run -p collector --bin collector -- \
44+
profile_local samply $bindir/rustc \
45+
--id Test \
46+
--profiles Check \
47+
--cargo $bindir/cargo \
48+
--include helloworld \
49+
--scenarios Full
50+
test -f results/samply-Test-helloworld-Check-Full
51+
# Samply output files are JSON, the first field is called "meta".
52+
grep -q "meta" results/samply-Test-helloworld-Check-Full
53+
4254
# Cachegrind.
4355
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
4456
cargo run -p collector --bin collector -- \

0 commit comments

Comments
 (0)