我正在尝试在奔腾 D 处理器(Dell OptiPlex-GX620 桌面)上运行的 Ubuntu 12.10 下使用 oprofile 0.9.8。当我尝试像“operf ls”这样简单的东西时,我得到了
perf_event_open failed with Invalid argument
Caught runtime_error: Internal Error. Perf event setup failed.
Error running profiler
我通过安装带有 timer=1 的模块(见下文),使用 sudo 下的 opcontrol 命令在传统模式下成功运行 oprofile。
看来 operf 对此配置不满意 - 这是新的首选方法。
我已验证所有依赖包都已加载。
在 oprofile 网站上,他们没有将奔腾 D 称为单独的架构,因此不确定它是否使用常规的奔腾架构。
我到处搜索,找不到类似这样的报道。如果您能在此处找出问题,我们将不胜感激。
附言当我使用 opcontrol 以旧模式运行时,我取得了一些成功:
denham@denham-OptiPlex-GX620:~$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged. Please see the man page for operf.
Using default event: GLOBAL_POWER_EVENTS:100000:1:1:1
Error: counter 0 not available nmi_watchdog using this resource ? Try:
opcontrol --deinit
echo 0 > /proc/sys/kernel/nmi_watchdog
**When I force the module to be installed with timer=1**
denham@denham-OptiPlex-GX620:~$ sudo opcontrol --deinit
Unloading oprofile module
denham@denham-OptiPlex-GX620:~$ sudo modprobe oprofile timer=1
denham@denham-OptiPlex-GX620:~$ sudo opcontrol --no-vmlinux
denham@denham-OptiPlex-GX620:~$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged. Please see the man page for operf.
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
denham@denham-OptiPlex-GX620:~$ ./a
^C
denham@denham-OptiPlex-GX620:~$ sudo opcontrol --shutdown
Stopping profiling.
Killing daemon.
denham@denham-OptiPlex-GX620:~$ opreport --callgraph
Using /var/lib/oprofile/samples/ for samples directory.
warning: /no-vmlinux could not be found.
warning: [vdso] (tgid:1697 range:0xb77ab000-0xb77ac000) could not be found.
warning: [vdso] (tgid:1728 range:0xb77b6000-0xb77b7000) could not be found.
warning: [vdso] (tgid:3310 range:0xb7702000-0xb7703000) could not be found.
CPU: CPU with timer interrupt, speed 2992.41 MHz (estimated)
Profiling through timer interrupt
samples % image name app name symbol name
-------------------------------------------------------------------------------
31878 81.1868 no-vmlinux no-vmlinux /no-vmlinux
31878 100.000 no-vmlinux no-vmlinux /no-vmlinux [self]
-------------------------------------------------------------------------------
2820 7.1820 a a main
2820 100.000 a a main [self]
-------------------------------------------------------------------------------
1065 2.7123 vino-server vino-server /usr/lib/vino/vino-server
1065 100.000 vino-server vino-server /usr/lib/vino/vino-server [self]
-------------------------------------------------------------------------------
1056 2.6894 a a b
1056 100.000 a a b [self]
-------------------------------------------------------------------------------
1013 2.5799 a a c
1013 100.000 a a c [self]
-------------------------------------------------------------------------------
968 2.4653 a a d
968 100.000 a a d [self]
-------------------------------------------------------------------------------
264 0.6724 libc-2.15.so libc-2.15.so /lib/i386-linux-gnu/libc-2.15.so
. . . . .
最佳答案
不知道这是否是主要问题,但错误消息显示 -
"Error: counter 0 not available nmi_watchdog using this resource. Try: opcontrol --deinit echo 0 > /proc/sys/kernel/nmi_watchdog".
要摆脱这种情况,您必须禁用 NMI 看门狗内核参数。在 Ubuntu 上,它是通过 grub
-
编辑
/etc/default/grub
并将“nmi_watchdog=0”
添加到GRUB_CMDLINE_LINUX
。然后运行
sudo update-grub
并检查值cat/proc/sys/kernel/nmi_watchdog
(应为“0”)。如果需要,重新启动以安装新配置。
关于linux - oprofile 0.9.8 在带有 Pentium D 的 Ubuntu 12.10 下失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14984600/