简体   繁体   English

如何解释kcachegrind的结果

[英]How to interpret results from kcachegrind

Could anyone tell me how to interest the results from kcachegrind. 谁能告诉我如何对kcachegrind的结果感兴趣。

I had two versions of my code (v1, v2) both compiled in debug mode. 我有两个版本的代码(v1,v2)都在调试模式下编译。 I ran them through valgrind with options: 我通过valgrind用选项运行它们:

valgrind --tool=callgrind -v ....

The output files thus generated are opened in kcachegrind. 这样生成的输出文件在kcachegrind中打开。 Now I already found the version v2 of the code runs more faster than first version, v1 as it meant to be. 现在我已经发现代码的版本v2运行速度比第一版v1更快,因为它意味着。 But how do i inperet a result from kcachegrind's call graph. 但是我如何从kcachegrind的调用图中获得结果。

In kcachegrind All Callers tab, I have the following columns: Incl. , Distance, Called, Caller 在kcachegrind All Callers选项卡中,我有以下列: Incl. , Distance, Called, Caller Incl. , Distance, Called, Caller . Incl. , Distance, Called, Caller

IIUC, Called and caller are the no of times the 'caller' was called in the program. IIUC, Calledcaller者在节目中被称为“来电者”。 But I dont know about others. 但我不了解其他人。

Another thing is when selecting a particular function and then the 'callers' tab it shows some more information. 另一件事是在选择特定功能然后在“呼叫者”选项卡上显示更多信息。 Ir, Ir per call, count, caller and in the types tab: `EventType, Incl. Ir, Ir per call, count, caller和types选项卡:`EventType,Incl。 Self, short, Formula. 自我,简短,公式。

I dont have any idea here. 我在这里没有任何想法。

So far I had read these questions: 到目前为止,我读过这些问题:

KCachegrind interpretation confusion Confused about profiling result KCachegrind解释混淆 对分析结果 感到 困惑

I use QCacheGrind, so I apologize if something on my screen isn't quite the same as what you see. 我使用QCacheGrind,所以如果屏幕上的内容与您看到的内容不完全相符,我深表歉意。 From what I understand, QCacheGrind is a direct Qt port of KCacheGrind. 据我所知,QCacheGrind是KCacheGrind的直接Qt端口。 Additionally, I have the ability to toggle between an Instruction Count and a % of total instructions. 此外,我还能够在指令计数和总指令的百分比之间切换。 For consistency I will refer to the Instruction Count view on any column that can be toggled in this way. 为了保持一致性,我将参考任何可以这种方式切换的列的指令计数视图。

The "All Callers" tab columns should represent the following: “所有呼叫者”选项卡列应表示以下内容:

  • Incl.: The number of instructions that this function generated as a whole broken down by each caller. Incl。:每个调用者对此函数整体生成的指令数进行细分。 Because callers are a hierarchy (hence the distance column) there may be several that have the same value if your call stack is deep. 因为调用者是层次结构(因此是距离列),所以如果调用堆栈很深,则可能有几个具有相同的值。

  • Distance: How many function calls separated is the selected line from the function that is selected in the Flat Profile panel. 距离:分隔的函数调用数是从“平面纵断面”面板中选择的函数中选定的行。

  • Called: The number of time the Caller called the a function that ultimately led to the execution of the selected function). 调用:调用者调用最终导致执行所选函数的函数的时间数。

  • Caller: The function that directly called or called another caller of your selected function (as determined by Distance). 调用者:直接调用或调用所选函数的另一个调用者的函数(由Distance确定)。

The Callers tab is more straightforward. “呼叫者”选项卡更简单。 It shows the functions that have a distance of 1 from your selected function. 它显示与所选功能的距离为1的函数。 In other words, these are the functions that directly invoke your selected function. 换句话说,这些是直接调用所选函数的函数。

  • Ir: The number of instructions executed in total by the selected function after being called by this caller. Ir:此调用者调用后由所选函数执行的指令总数。

  • Ir per call: The number of instructions executed per call. 每次通话:每次通话执行的指令数。

  • Count: The number of times the selected function was called by the caller. 计数:调用者调用所选函数的次数。

  • Caller: The function that directly called the selected function. 调用者:直接调用所选函数的函数。

For Events, see this page for the handbook. 有关活动,请参阅页面以获取该手册。 I suspect that if you didn't define your own types all you should see is "Instruction Fetch" and possibly "Cycle Estimation." 我怀疑如果你没有定义自己的类型,你应该看到的是“指令获取”,可能还有“周期估计”。 The quick breakdown on these columns is as follows: 这些列的快速细分如下:

  • Incl.: Again the total instructions performed by this function and all functions it calls beneath it. Incl。:再次由此函数执行的总指令以及它在其下面调用的所有函数。

  • Self: The instructions performed exclusively by this function. Self:由此功能专门执行的指令。 This counter only tracks instructions used by this function, not any instruction used by functions that are called by this function. 此计数器仅跟踪此函数使用的指令,而不跟踪此函数调用的函数使用的任何指令。

  • Short and Formula: These columns are used when defining a custom Event Type. 短和公式:定义自定义事件类型时使用这些列。 Yours should either be blank or very short (like CEst = Ir) unless you end up defining your own Types. 你的应该是空白或非常短(如CEst = Ir),除非你最终定义自己的类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM