需要帮助理解 kcachedgrind 输出
我正在使用 valgrind callgrind 在 gtk 上分析程序。然后我使用 kcachedgrind 读取结果。我在这里捕获了 kcachedgrind 的更新屏幕截图: http://i41.tinypic.com/168spk0.jpg 。它说函数 gtk_moz_embed_new() 的成本为“15.61%”。 但我不明白这怎么可能。函数 gtk_moz_embed_new() 实际上只有 1 行:它只是调用 g_object_new()。
GtkWidget *
gtk_moz_embed_new(void)
{
return GTK_WIDGET(g_object_new(GTK_TYPE_MOZ_EMBED, NULL));
}
您能帮助理解结果或如何使用 kcachedgrind 吗?
谢谢。
I am using valgrind callgrind to profile a program on gtk. And then I use kcachedgrind to read the result. I have captured an update a screenshot of kcachedgrind here: http://i41.tinypic.com/168spk0.jpg. It said the function gtk_moz_embed_new() costed '15.61%'.
But I dont understand how is that possible. the function gtk_moz_embed_new() literally has 1 line: and it is just calling a g_object_new().
GtkWidget *
gtk_moz_embed_new(void)
{
return GTK_WIDGET(g_object_new(GTK_TYPE_MOZ_EMBED, NULL));
}
Can you please help understanding the result or how to use kcachedgrind.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,这应该意味着(或多或少)函数
gtk_moz_embed_new()
在应用程序运行的时间中执行了 15.61%。您会看到,该函数返回对其他函数(或类或其他函数)的内联调用,这些函数也需要时间来执行。当它们全部完成后,函数
gtk_moz_embed_new()
实际上会返回一个值。出于同样的原因,main() 需要 99% 的时间来执行,它会在执行完其中包含的所有代码后完成执行。请注意,
gtk_moz_embed_new()
的self
值为 0,这是“独占成本”,这意味着该函数本身并没有真正花费任何时间来执行(它实际上只是一个返回)调用)但准确地说:
If i remember correctly that should mean (more or less) that function
gtk_moz_embed_new()
was executing 15.61% of the time the the app was running.You see, that function returns an inline call to other functions (or classes or whatever) that also take time to execute. When they are all done it's then that the function
gtk_moz_embed_new()
acutally returns a value. The very same reason it takesmain()
99% of the time to execute, it finisesh execution after all included code in it is executed.Note that
self
value for thegtk_moz_embed_new()
is 0 which is "exclusive cost" meaning that function it self did not really took any time to execute (it's really only a return call)But to be exact: