我收集了一些perf数据,使用:
perf sched record –g我需要分析这个命令生成的perf.data。
我使用以下命令进行分析:
perf report 我看到了多个赛程:
62K sched:sched_switch ▒
0 sched:sched_stat_wait ▒
0 sched:sched_stat_sleep ▒
0 sched:sched_stat_iowait ▒
120K sched:sched_stat_runtime ▒
10 sched:sched_process_fork ▒
31K sched:sched_wakeup ▒
10 sched:sched_wakeup_new ▒
873 sched:sched_migrate_task 在我打开其中一个活动之后,我看到了这样的情况:
+ 80.00% 0.00% ksmtuned bash [.] make_child
+ 80.00% 0.00% ksmtuned libc-2.17.so [.] __libc_fork
+ 80.00% 0.00% ksmtuned [kernel.kallsyms] [k] stub_clone
+ 80.00% 0.00% ksmtuned [kernel.kallsyms] [k] sys_clone
+ 80.00% 80.00% ksmtuned [kernel.kallsyms] [k] do_fork
+ 10.00% 0.00% bash bash [.] make_child我无法解释这个信息。以下是我的问题:
1)显示%值的前两列是什么? 2)为什么%值不加到100 %?3)这些数字的意义是什么?
发布于 2017-02-19 00:26:39
perf sched record是perf的特殊变体,我认为使用perf sched子命令分析结果perf.data文件更为正确。
perf sched:http://man7.org/linux/man-pages/man1/perf-sched.1.html上有手册页
'perf sched record <command>' to record the scheduling events of an arbitrary workload. 'perf sched latency' to report the per task scheduling latencies and other scheduling properties of the workload. 'perf sched script' to see a detailed trace of the workload that was recorded... 'perf sched replay' to simulate the workload that was recorded via perf sched record. (this is done by starting up mockup threads that mimic the workload based on the events in the trace. These threads can then replay the timings (CPU runtime and sleep patterns) of the workload as it occurred when it was recorded - and can repeat it a number of times, measuring its performance.) 'perf sched map' to print a textual context-switching outline of workload captured via perf sched record. Columns stand for individual CPUs, and the two-letter shortcuts stand for tasks that are running on a CPU. A '\*' denotes the CPU that had the event, and a dot signals an idle CPU.
还有2009年的信描述了perf sched的功能:https://lwn.net/Articles/353295/“宣布'perf‘:捕获、测量和分析调度程序延迟和行为的实用程序”,而perf sched record结果的推荐用法是perf sched latency而不是perf report
..。尝试实现这一宏伟目标的实用程序的实验版本:新的“perf”工具系列,它使用性能事件从调度和延迟的角度客观地描述任意工作负载。 “currently”目前有五个子命令: perf sched记录#任意工作负载的低开销记录perf时延#每个任务延迟指标输出perf sched map #显示上下文切换perf sched跟踪的摘要/映射#输出细粒度跟踪perf sched重放#使用简单线程重放捕获的工作负载。 桌面用户通常会使用'perf记录‘来捕获跟踪(这会创建perf.data),使用'perf延迟’工具来检查延迟(分析perf.data中的跟踪)。其他工具也使用已经记录的perf.data。
https://stackoverflow.com/questions/42018376
复制相似问题