Skip to content

Cannot profile local rustc #854

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

Closed
Nicholas-Baron opened this issue Mar 24, 2021 · 5 comments
Closed

Cannot profile local rustc #854

Nicholas-Baron opened this issue Mar 24, 2021 · 5 comments
Assignees

Comments

@Nicholas-Baron
Copy link

I am trying to address the rustc regression shown here.
I have checked out the latest version of this repo and cannot use profile_local.
Build steps:

  • rustc with ./x.py b --stage 2 library/test
  • rustc-perf with cargo build (same result with --release)

The following command will fail:

./target/release/collector profile_local cachegrind ../rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc mine --include diesel

with this output:

Profiling with Cachegrind
1 benchmark remaining
Preparing diesel
Running diesel: Check + [Full, IncrFull, IncrUnchanged, IncrPatched]
collector error: Failed to profile 'diesel' with Cachegrind, recorded: failed to obtain pkgid in '"/tmp/.tmpZsNXtr"'

Caused by:
    No such file or directory (os error 2)
collector error: 1 benchmarks failed
@Mark-Simulacrum
Copy link
Member

I wasn't able to reproduce this change after building same as you did - I wonder if you can check that valgrind --tool=cachegrind echo works for you... but it also looks like there's some error with a pkgid not resolving, not sure why that would be.

@Nicholas-Baron
Copy link
Author

valgrind --tool=cachegrind echo "Hello World" gives the following output:

==2865== Cachegrind, a cache and branch-prediction profiler
==2865== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==2865== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==2865== Command: echo Hello\ world
==2865==
--2865-- warning: L3 cache found, using its data for the LL simulation.
Hello world
==2865==
==2865== I   refs:      180,780
==2865== I1  misses:      1,201
==2865== LLi misses:      1,182
==2865== I1  miss rate:    0.66%
==2865== LLi miss rate:    0.65%
==2865==
==2865== D   refs:       62,641  (44,565 rd   + 18,076 wr)
==2865== D1  misses:      2,314  ( 1,701 rd   +    613 wr)
==2865== LLd misses:      1,958  ( 1,379 rd   +    579 wr)
==2865== D1  miss rate:     3.7% (   3.8%     +    3.4%  )
==2865== LLd miss rate:     3.1% (   3.1%     +    3.2%  )
==2865==
==2865== LL refs:         3,515  ( 2,902 rd   +    613 wr)
==2865== LL misses:       3,140  ( 2,561 rd   +    579 wr)
==2865== LL miss rate:      1.3% (   1.1%     +    3.2%  )

So I assume valgrind works.

@pnkfelix pnkfelix self-assigned this Apr 21, 2021
@tgnottingham
Copy link
Contributor

@Nicholas-Baron Does this error still occur for you? Can you reproduce it with RUST_LOG=trace? Based on the output and inspection of the code, it kind of looks like the path to cargo that it's using internally points to some non-existent file. The logs should give us more of a clue.

@Nicholas-Baron
Copy link
Author

@tgnottingham It seems to be work now. The profile is taking a long time, but that is expected with valgrind.
When it finishes, I will close this issue, as it seems to have been resolved.

@Nicholas-Baron
Copy link
Author

Looks like it did work. Now time to interpret the results folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants