Skip to content

Commit 6610efe

Browse files
committed
Add more profiler testing.
1 parent 685a897 commit 6610efe

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797

9898
- name: Install profilers
9999
run: |
100+
sudo apt install -y valgrind
100101
cargo install cargo-llvm-lines
101102
102103
- name: Configure environment

ci/check-profiling.sh

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,62 @@ trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
1313
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1414
bindir=`cargo run -p collector --bin collector install_next`
1515

16-
# Profile with eprintln.
16+
#----------------------------------------------------------------------------
17+
# Test the profilers
18+
#----------------------------------------------------------------------------
19+
20+
# time-passes: TODO
21+
22+
# perf-record: TODO
23+
24+
# oprofile: TODO
25+
26+
# Cachegrind.
1727
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1828
cargo run -p collector --bin collector -- \
19-
profile_local eprintln $bindir/rustc Test \
29+
profile_local cachegrind $bindir/rustc Test \
30+
--builds Check \
2031
--cargo $bindir/cargo \
2132
--include helloworld \
2233
--runs Full
34+
valgrind --version # njn: temp
35+
head -100 results/cgout-Test-helloworld-Check-Full # njn: temp
36+
test -f results/cgout-Test-helloworld-Check-Full
37+
grep -q "events: Ir" results/cgout-Test-helloworld-Check-Full
38+
head -100 results/cgann-Test-helloworld-Check-Full # njn: temp
39+
test -f results/cgann-Test-helloworld-Check-Full
40+
grep -q "PROGRAM TOTALS" results/cgann-Test-helloworld-Check-Full
41+
42+
# Callgrind: TODO
43+
44+
# DHAT: TODO
45+
46+
# Massif: TODO
2347

24-
# Check that Check/Debug/Opt files are present, and that Doc files aren't
25-
# present, becuase they're not done by default.
48+
# njn: move the check/debug/opt checking later
49+
# eprintln. Note: Check/Debug/Opt files must be present, and Doc files must not
50+
# be present, because they're not collected by default.
51+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
52+
cargo run -p collector --bin collector -- \
53+
profile_local eprintln $bindir/rustc Test \
54+
--cargo $bindir/cargo \
55+
--include helloworld \
56+
--runs Full
2657
test -f results/eprintln-Test-helloworld-Check-Full
2758
test -f results/eprintln-Test-helloworld-Debug-Full
2859
test -f results/eprintln-Test-helloworld-Opt-Full
2960
test ! -e results/eprintln-Test-helloworld-Doc-Full
3061

31-
# Profile with llvm-lines.
62+
# llvm-lines.
3263
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
3364
cargo run -p collector --bin collector -- \
3465
profile_local llvm-lines $bindir/rustc Test \
3566
--builds Debug \
3667
--cargo $bindir/cargo \
37-
--include futures \
68+
--include helloworld \
3869
--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
70+
test -f results/ll-Test-helloworld-Debug-Full
71+
grep -q "Lines.*Copies.*Function name" results/ll-Test-helloworld-Debug-Full
4372

4473
kill $PING_LOOP_PID
4574
exit 0

0 commit comments

Comments
 (0)