Bug 379438 - kcachegrind duplicates calls
Summary: kcachegrind duplicates calls
Status: ASSIGNED
Alias: None
Product: kcachegrind
Classification: Developer tools
Component: general (show other bugs)
Version: 0.7.4kde
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Josef Weidendorfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-02 13:25 UTC by Igor
Modified: 2017-05-02 19:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pictures (58.10 KB, image/png)
2017-05-02 13:25 UTC, Igor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2017-05-02 13:25:45 UTC
Created attachment 105310 [details]
pictures

Hi guys!

I'm trying to understand the callgrind format and stuck with some little problem in kcachegrind.
I wrote this simple example:

events: Ir

fn=(105) func1

fn=(1) main
cfn=(105)
calls=1 1
0 1

fn=(105)
cfn=(105)
calls=5 0
0 1

In kcachegrind it looks like in pincture 1 - summary number of calls is 6. But when I double clicked on func1 it multiplicates "self calls" by 2 (pic. 2) - now there are 10 calls (but row named "called" holds normal number - 6). What is this and how I can disable this multiplication?

Thank you!
Comment 1 Josef Weidendorfer 2017-05-02 19:22:54 UTC
Thanks for the report.

The visualized call graph is a part of the full call graph,
generated on the fly both in caller and callee direction of
the selected function.

I obviously have a bug here when the selected function calls
itself recursively. The 5x call count is added to the edge two
times: once when going into caller direction and another time
when adding the callee direction.

I have to think about the correct solution here. I probably should
remember when I visited a call edge to not pass it again
in the other direction...