Skip to content
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

Regex error with callgrind for paths containing numbers #32

Open
FauxFaux opened this issue Mar 17, 2017 · 5 comments
Open

Regex error with callgrind for paths containing numbers #32

FauxFaux opened this issue Mar 17, 2017 · 5 comments

Comments

@FauxFaux
Copy link

The simplest possible project fails for me:

% cargo init --bin hello
     Created binary (application) project
% cd hello
% cargo profiler callgrind --release

Compiling hello in release mode...

Profiling hello with callgrind...
error: Regex error -- please file a bug. In bug report, please include the original output file from profiler, e.g. from valgrind --tool=cachegrind --cachegrind-out-file=cachegrind.txt

% valgrind --tool=cachegrind --cachegrind-out-file=cachegrind.txt target/release/hello
==19861== Cachegrind, a cache and branch-prediction profiler
==19861== Copyright (C) 2002-2015, and GNU GPL'd, by Nicholas Nethercote et al.
==19861== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==19861== Command: target/release/hello
==19861== 
--19861-- warning: L3 cache found, using its data for the LL simulation.
Hello, world!
==19861== 
==19861== I   refs:      621,681
==19861== I1  misses:      2,045
==19861== LLi misses:      1,860
==19861== I1  miss rate:    0.33%
==19861== LLi miss rate:    0.30%
==19861== 
==19861== D   refs:      199,643  (141,498 rd   + 58,145 wr)
==19861== D1  misses:      4,892  (  3,346 rd   +  1,546 wr)
==19861== LLd misses:      3,590  (  2,166 rd   +  1,424 wr)
==19861== D1  miss rate:     2.5% (    2.4%     +    2.7%  )
==19861== LLd miss rate:     1.8% (    1.5%     +    2.4%  )
==19861== 
==19861== LL refs:         6,937  (  5,391 rd   +  1,546 wr)
==19861== LL misses:       5,450  (  4,026 rd   +  1,424 wr)
==19861== LL miss rate:      0.7% (    0.5%     +    2.4%  )
% 

Here's the output cachegrind.txt.

Versions:

cargo 0.16.0-nightly (6e0c18c 2017-01-27)
% uname -rm
4.10.0-11-generic x86_64
valgrind-3.12.0
@FauxFaux
Copy link
Author

I'm guessing that wasn't the right valgrind command. However, I don't think:

valgrind --tool=callgrind --callgrind-out-file=callgrind.txt target/release/hello

...is right either, as the output it prints is very different to the line of code that's breaking in the profiler.

@FauxFaux
Copy link
Author

Ah right. It's because my path has a number in.

Lines like:

Profiled target:  /var/tmp/faux170317.0/hello/target/release/hello (PID 22911, part 1)

..match the insanity regex:

\d+\s*[a-zA-Z]*$*_*:*/+\.*@*-*|\d+\s*[a-zA-Z]*$*_*\?+:*/*\.*-*@*-*

..due to a lack of any kind of anchoring.

@FauxFaux FauxFaux changed the title Regex error with callgrind on hello world (Ubuntu 17.04) Regex error with callgrind for paths containing numbers Mar 17, 2017
FauxFaux added a commit to FauxFaux/cargo-profiler that referenced this issue Mar 17, 2017
@sourcefrog
Copy link

Thanks for trying to fix it. Even built from your branch I get another regex error though, maybe from a different point.

@sourcefrog
Copy link

callgrind.out.txt.gz

@jounathaen
Copy link

I have the same problem with a path containing numbers.

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

3 participants