简体   繁体   English

性能输出中的奇怪字符…

[英]Weird characters in perf output…

I'm trying to debug a webkit build with Linux perf that I compiled with symbols. 我正在尝试使用我用符号编译的Linux性能来调试Webkit构建。

The output of "perf report -g" has the symbols with half human readable and the other half alphanumeric values. “性能报告-g”的输出具有人类可读的一半符号和另一半个字母数字值的符号。

For example: 例如:

_ZN7WebCore12RenderObject18setAnimatableStyleEN3WTF10PassRefPtrINS_11RenderStyleEEE
    |
    |--91.30%-- _ZN7WebCore4Node14setRenderStyleEN3WTF10PassRefPtrINS_11RenderStyleEEE
    |          _ZN7WebCore7Element11recalcStyleENS_4Node11StyleChangeE
    |          _ZN7WebCore7Element11recalcStyleENS_4Node11StyleChangeE
    |          _ZN7WebCore7Element11recalcStyleENS_4Node11StyleChangeE

What's happening here? 这里发生了什么事?

What's _ZN7? 什么是_ZN7?

My hunch is that this is something to do with C++ and maybe I need to compile with more options to get the symbols to be represented in perf correctly. 我的直觉是,这与C ++有关,也许我需要编译更多选项才能使符号正确表示在perf中。

ANY pointers here would be appreciated. 这里的任何指针将不胜感激。 I can't find anything about this anywhere in the documentation. 我在文档的任何地方都找不到关于此的任何内容。

These are so-called "mangled names" : The C++ compiler encodes type information into symbol names, so that the linker can correctly implement overloading, class scoping and namespaces without having to actually understand the C++ type system, and without having to support characters outside of basic alphanumerics and underscores. 这些就是所谓的“混杂名称” :C ++编译器将类型信息编码为符号名称,以便链接器可以正确地实现重载,类作用域和名称空间,而无需实际了解C ++类型系统,也不必支持外部字符基本字母数字和下划线。

You can turn these back into human-readable names with tools such as c++filt under Linux. 您可以使用诸如Linux下的c++filt工具将其转换为易于理解的名称。

For example: 例如:

$ echo _ZN7WebCore12RenderObject18setAnimatableStyleEN3WTF10PassRefPtrINS_11RenderStyleEEE | c++filt 
WebCore::RenderObject::setAnimatableStyle(WTF::PassRefPtr<WebCore::RenderStyle>)

Or in your case, perf report -g | c++filt 或者,就您而言,性能perf report -g | c++filt perf report -g | c++filt will probably do what you want. perf report -g | c++filt可能会做您想要的。

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

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