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

Support cachegrind as a tool #72

Open
mohe2015 opened this issue Jan 9, 2024 · 2 comments
Open

Support cachegrind as a tool #72

mohe2015 opened this issue Jan 9, 2024 · 2 comments

Comments

@mohe2015
Copy link

mohe2015 commented Jan 9, 2024

Hi,

when you want to diff two profiles using cg_annotate --diff it seems like this is only possible for cachegrind but not callgrind. Would it be possible to add support for running cachegrind too?

@gamma0987
Copy link

Hi. Yeah, callgrind diffs are only possible with flamegraphs but not with a command-line tool in the terminal. There is a the option to produce differential flamegraphs with

LibraryBenchmarkConfig::default()
    .flamegraph(FlamegraphConfig::default().kind(FlamegraphKind::Differential))

and you can view the resulting svg file in the browser.

Although adding cachegrind to the tools is certainly possible, there won't be a calibration run or something similar to optimize the statistics to the benchmarking function as it is possible with callgrind. So far, it didn't make much sense to offer a cachegrind run...

However, with the upcoming release of iai-callgrind there are the valgrind client requests available and since valgrind version v3.22, the cachegrind client requests start_instrumentation and stop_instrumentation, so maybe it starts making sense to add cachegrind to the available tools.

@gamma0987
Copy link

I thought a little bit more about this and I currently see two different possibilities. Add an option to run cachegrind (with all limitations) instead of callgrind. Or, add an option to run cachegrind in addition to callgrind. In both cases you're on your own to optimize the benchmark run for example with client requests if your valgrind version is recent enough. What do you think?

Out of curiosity, have you tried differential flamegraphs? Or, do you still prefer cg_annotate --diff?

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

2 participants