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

filename with line == 0? #164

Open
dalon-work opened this issue Oct 8, 2020 · 4 comments
Open

filename with line == 0? #164

dalon-work opened this issue Oct 8, 2020 · 4 comments

Comments

@dalon-work
Copy link

I've probably done something wrong, but when I look at the profiles, some of the profiles list a filename.cc:0 as the title. Do you know how to address this? It's not very helpful :-)

Thanks.

Dalon

@emeryberger
Copy link
Member

Are you compiling with -g? Anyway, a repro case would be useful - thanks!

@dalon-work
Copy link
Author

I am compiling with -g. In fact, I was really confused when I wasn't getting any useful output at first, then realized I'd forgotten that step.

A repro case won't be easy, as this is proprietary code I'm working with. We do rely heavily on inlining to provide good performance. I wonder if the debug info is messed up somehow because of it?

I'll see if I can create a minimal working example.

Speaking of which, coz is also picking up on an inlined operator -= function as needing to be sped up, but this function is completely inlined. My guess is the dwarf information is still listing this as a function on the lines where it is used, but that isn't all that helpful. Do you know if there is a way to fix this issue?

I'm really impressed by this tool. Thank you!

Dalon

@emeryberger
Copy link
Member

Coz can end up pointing out a line as important for performance that can't obviously be sped up at a micro-level; it doesn't know how easy it is to optimize code, just where code should be optimized. The paper has a number of examples like this that we encountered (and both Charlie & I have talked about this in various talks), which may be helpful at least as an illustration of how you can approach performance optimization in such cases.

I look forward to the minimal working example!

@adri326
Copy link

adri326 commented Nov 28, 2020

I am able to reproduce a similar issue with Rust. I have a few inlined functions in the files that have reports at line 0; however one in particular, moves.rs, has only one inlined function never used anywhere else in the code. I do not have a minimal example to show you there, but the source code for the project that I have been profiling with coz is open-source:

Code: https://github.com/adri326/5dchess-tools (the coz branch has the coz library imported: https://github.com/adri326/5dchess-tools/tree/coz); it is a set of tree search algorithms for the game "5D Chess with Multiverse Timetravel"
Profile: After ~6h of running an iterative deepening depth-first search over and over, coz came up with the following chart: profile.coz.zip
Point of interest: the inlined function in moves.rs is never used, yet coz has an entry for moves.rs:0

Note that I did take care to add debug = 1 to my Cargo.toml and that coz seemed to be happy with it.

I am very new to this amazing tool; these results are a little underwhelming, although they do give me a few insights on what I should optimize next.

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