gpt4 book ai didi

profiling - 性能错误 : The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/)

转载 作者:行者123 更新时间:2023-12-01 10:20:02 70 4
gpt4 key购买 nike

我正在使用 perf 来监控系统的某些事件。但是,我收到以下错误,我不知道它来自哪里,因为该事件列在 perf 列表中

sudo perf record -e msr/tsc/-a

Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?

如何检查是否配置了 CONFIG_PERF_EVENTS=y 内核支持?

**部分测试结果:

sudo dmesg | grep "perf\|pmu"**
[ 0.029179] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
[ 0.029179] ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[ 9475.406967] perf: interrupt took too long (2509 > 2500), lowering kernel.perf_event_max_sample_rate to 79500
[ 9475.990901] perf: interrupt took too long (3146 > 3136), lowering kernel.perf_event_max_sample_rate to 63500
[ 9476.886941] perf: interrupt took too long (3942 > 3932), lowering kernel.perf_event_max_sample_rate to 50500
[76057.268195] perf: interrupt took too long (4934 > 4927), lowering kernel.perf_event_max_sample_rate to 40500
[167368.007839] perf: interrupt took too long (6171 > 6167), lowering kernel.perf_event_max_sample_rate to 32250
[168338.165608] perf: interrupt took too long (7804 > 7713), lowering kernel.perf_event_max_sample_rate to 25500

性能列表 |grep msr

  msr/aperf/                                         [Kernel PMU event]
msr/mperf/ [Kernel PMU event]
msr/pperf/ [Kernel PMU event]
msr/smi/ [Kernel PMU event]
msr/tsc/

sudo uname -aLinux bla 4.9.0-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

sudo/proc/config.gz 返回找不到命令任何帮助/想法表示赞赏。

最佳答案

通过使用组抽样,可以使用 perf record 收集此信息。比如下面的命令

perf record -a -e '{cycles,msr/aperf/,msr/tsc/}:S'

根据cycle(第一个计数器)溢出收集所有三个事件的值。未记录的 :S 修饰符是必需的,它确保只有组的领导者触发样本。要查看此信息,请使用 perf report --group,该参数可能不是必需的。恐怕每个样本的实际值只在非常冗长的 perf script -D 中可见。

关于profiling - 性能错误 : The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (msr/tsc/),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53374880/

70 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com