Skip to content

Commit 67994a8

Browse files
committed
Add testing for collector llvm-lines.
1 parent be93bee commit 67994a8

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ jobs:
110110
toolchain: beta
111111
override: true
112112

113+
- name: Install profilers
114+
run: |
115+
cargo install cargo-llvm-lines
116+
113117
- name: Configure environment
114118
run: |
115119
sudo apt-get update

ci/check-profiling.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
3-
# This script is basically just a smoke test. It only tests `eprintln`
4-
# profiling because setting up the other profilers is something of a hassle.
3+
# This script only tests some of the profilers at the moment. More coverage
4+
# would be nice.
55

66
set -e -x;
77

@@ -28,5 +28,18 @@ test -f results/eprintln-Test-helloworld-Debug-Full
2828
test -f results/eprintln-Test-helloworld-Opt-Full
2929
test ! -e results/eprintln-Test-helloworld-Doc-Full
3030

31+
# Profile with llvm-lines.
32+
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
33+
cargo run -p collector --bin collector -- \
34+
profile_local llvm-lines $bindir/rustc Test \
35+
--builds Debug \
36+
--cargo $bindir/cargo \
37+
--include futures \
38+
--runs Full
39+
40+
# Check the output is present and looks something like it should.
41+
test -f results/ll-Test-futures-Debug-Full
42+
grep -q "Lines.*Copies.*Function name" results/ll-Test-futures-Debug-Full
43+
3144
kill $PING_LOOP_PID
3245
exit 0

0 commit comments

Comments
 (0)