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

Add IAI_CALLGRIND_<triple>_VALGRIND_INCLUDE #101

Open
qRoC opened this issue Mar 21, 2024 · 7 comments · May be fixed by #104
Open

Add IAI_CALLGRIND_<triple>_VALGRIND_INCLUDE #101

qRoC opened this issue Mar 21, 2024 · 7 comments · May be fixed by #104

Comments

@qRoC
Copy link

qRoC commented Mar 21, 2024

For cross compilation like CARGO_TARGET_<triple>_RUNNER.

Example:

IAI_CALLGRIND_X86_64_UNKNOWN_LINUX_GNU_VALGRIND_INCLUDE
@gamma0987
Copy link

Thanks for your interest in iai-callgrind!

Can you please explain a little bit more? What do you expect iai-callgrind to do when it encounters such a environment variable?

@qRoC
Copy link
Author

qRoC commented Mar 24, 2024

Hi, from doc:

When building iai-callgrind with client requests, the valgrind header files must exist in your standard include path (most of the time /usr/include). This is usually the case if you've installed valgrind with your distribution's package manager. If not, you can point the IAI_CALLGRIND_VALGRIND_INCLUDE environment variable to the include path. So, if the headers can be found in /home/foo/repo/valgrind/{valgrind.h, callgrind.h, ...}, the correct include path would be IAI_CALLGRIND_VALGRIND_INCLUDE=/home/foo/repo (not /home/foo/repo/valgrind)

so for cross benches I must to set this variable every time, example:

IAI_CALLGRIND_VALGRIND_INCLUDE=/aarch64/valgrind/include cargo bench --target aarch64-unknown-linux-gnu

IAI_CALLGRIND_VALGRIND_INCLUDE=/x86_64/valgrind/include cargo bench --target x86_64-unknown-linux-gnu

My proposal:

  1. Find IAI_CALLGRIND_<triple>_VALGRIND_INCLUDE variable
  2. Find IAI_CALLGRIND_VALGRIND_INCLUDE
  3. ...

This allows to set the path once per target:

IAI_CALLGRIND_AARCH64_UNKNOWN_LINUX_GNU_VALGRIND_INCLUDE=/aarch64/valgrind/include
IAI_CALLGRIND_X86_64_UNKNOWN_LINUX_GNU_VALGRIND_INCLUDE=/x86_64/valgrind/include

Then just run benches:

cargo bench --target aarch64-unknown-linux-gnu
cargo bench --target x86_64-unknown-linux-gnu

@qRoC
Copy link
Author

qRoC commented Mar 24, 2024

Also, it would be nice if the reports were grouped by target (now - the comparison with the last launch, regardless of the target)

@gamma0987
Copy link

Thanks for clarifying. Sounds good. Regarding the grouping, you should already be able to achieve something like that by saving baselines per target. See the README https://github.com/iai-callgrind/iai-callgrind?tab=readme-ov-file#comparing-with-baselines.

@qRoC
Copy link
Author

qRoC commented Mar 25, 2024

Regarding the grouping, you should already be able to achieve something like that by saving baselines per target.

I think this is a little different - there is no point in comparing two targets, moreover it looks terrible and is easy to make a mistake:

cargo bench --target aarch64-unknown-linux-gnu -- --save-baseline=aarch64_main
cargo bench --target aarch64-unknown-linux-gnu -- --save-baseline=aarch64_new
cargo bench --target x86_64-unknown-linux-gnu -- --save-baseline=x86_64_main
cargo bench --target x86_64-unknown-linux-gnu -- --save-baseline=x86_64_new

@gamma0987
Copy link

It's not the same and maybe not ideal for this usecase but for the time being there's a possibility to achieve a comparison between the same target and you're not completely lost. Maybe consider using just, a Makefile or a little script etc. to avoid the typing and typos? I'm going to have a look into it asap. I didn't have much time time to work on iai-callgrind lately.

@qRoC
Copy link
Author

qRoC commented Mar 26, 2024

I didn't have much time time to work on iai-callgrind lately.

I was just interested to hear your opinion. This way I can do the PR when I have time.

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