了解 Perf 工具输出

Ami*_*mar 5 linux profiling perf

我最近在我的平台上安装了 Perf 工具,并想用它来分析我的平台。我开始分析一个独立的应用程序。我使用了下面的命令

性能启动./helloworld

“./helloworld”的性能计数器统计信息:

  4.555957 task-clock                #    0.000 CPUs utilized
         1 context-switches          #    0.219 K/sec
         0 cpu-migrations            #    0.000 K/sec
       124 page-faults               #    0.027 M/sec
       <not supported> cycles
       <not supported> stalled-cycles-frontend
       <not supported> stalled-cycles-backend
       <not supported> instructions
       <not supported> branches
       <not supported> branch-misses

       60.005519331 seconds time elapsed
Run Code Online (Sandbox Code Playgroud)

现在我不确定应该如何解释这个输出。它是预期的输出吗?

另外,我应该如何处理此处提交的<不支持>,在运行命令之前我需要启用什么来支持此提交吗?

cyp*_*har 2

这些行表明您正在运行的内核缺少对分析程序的这些方面所需的特定功能的支持。由于大部分性能都在内核空间中,因此您需要确保内核支持您需要的功能。

编辑:

当涉及到在内核中启用这些功能时,这取决于情况。除非这些组件已编译为内核模块,否则您需要自己编译它们。如果它们被编译为模块,您就可以只使用modprobe它们。尝试:

find /lib/modules/`uname -r` -regex .*perf.*
Run Code Online (Sandbox Code Playgroud)

如果出现列表,请尝试modprobe输入每个模块名称。否则,您需要自己编译模块或整个内核。