Skip to content

Commit 2b833c7

Browse files
Merge pull request #712 from nnethercote/fix-llvm-lines
Fix `collector llvm-lines`
2 parents 75eb821 + afea648 commit 2b833c7

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.github/workflows/ci.yml

+4
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-benchmarks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
set -e -x;
3+
set -eE -x;
44

55
bash -c "while true; do sleep 30; echo \$(date) - running ...; done" &
66
PING_LOOP_PID=$!
7-
trap 'kill $PING_LOOP_PID' ERR
7+
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
88

99
# Install a toolchain.
1010
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \

ci/check-profiling.sh

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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

6-
set -e -x;
6+
set -eE -x;
77

88
bash -c "while true; do sleep 30; echo \$(date) - running ...; done" &
99
PING_LOOP_PID=$!
10-
trap 'kill $PING_LOOP_PID' ERR
10+
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
1111

1212
# Install a toolchain.
1313
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
@@ -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

collector/src/execute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Profiler {
172172
}
173173
}
174174
Profiler::LlvmLines => match build_kind {
175-
BuildKind::Debug | BuildKind::Opt => Some("rustc"),
175+
BuildKind::Debug | BuildKind::Opt => Some("llvm-lines"),
176176
BuildKind::Check | BuildKind::Doc => None,
177177
},
178178
}

0 commit comments

Comments
 (0)