Skip to content

Fix collector llvm-lines #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ jobs:
toolchain: beta
override: true

- name: Install profilers
run: |
cargo install cargo-llvm-lines

- name: Configure environment
run: |
sudo apt-get update
Expand Down
4 changes: 2 additions & 2 deletions ci/check-benchmarks.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

set -e -x;
set -eE -x;

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

# Install a toolchain.
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
Expand Down
21 changes: 17 additions & 4 deletions ci/check-profiling.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
#
# This script is basically just a smoke test. It only tests `eprintln`
# profiling because setting up the other profilers is something of a hassle.
# This script only tests some of the profilers at the moment. More coverage
# would be nice.

set -e -x;
set -eE -x;

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

# Install a toolchain.
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
Expand All @@ -28,5 +28,18 @@ test -f results/eprintln-Test-helloworld-Debug-Full
test -f results/eprintln-Test-helloworld-Opt-Full
test ! -e results/eprintln-Test-helloworld-Doc-Full

# Profile with llvm-lines.
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
cargo run -p collector --bin collector -- \
profile_local llvm-lines $bindir/rustc Test \
--builds Debug \
--cargo $bindir/cargo \
--include futures \
--runs Full

# Check the output is present and looks something like it should.
test -f results/ll-Test-futures-Debug-Full
grep -q "Lines.*Copies.*Function name" results/ll-Test-futures-Debug-Full

kill $PING_LOOP_PID
exit 0
2 changes: 1 addition & 1 deletion collector/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl Profiler {
}
}
Profiler::LlvmLines => match build_kind {
BuildKind::Debug | BuildKind::Opt => Some("rustc"),
BuildKind::Debug | BuildKind::Opt => Some("llvm-lines"),
BuildKind::Check | BuildKind::Doc => None,
},
}
Expand Down