- 论坛徽章:
- 0
|
mount: mounting nodev on /dev/oprofile failed
问题现象:
# ./opcontrol --init
nfs: server 192.168.167.251 not responding, still trying
nfs: server 192.168.167.251 OK
grep: /etc/mtab: No such file or directory
mount: mounting nodev on /dev/oprofile failed
grep: /etc/mtab: No such file or directory
#
解决方法:
在/etc目录下创建mtab文件,并添加如下内容
nodev /dev/oprofile oprofilefs rw 0 0
具体命令:
Touch
mtab
Vi mtab
添加
nodev /dev/oprofile oprofilefs rw 0 0
注意千万别少了
no 变成 dev /dev/oprofile oprofilefs rw 0 0
不能正确挂在 oprofilefs,会出现如下提示:
# ./opcontrol --init
cat: can't open '/dev/oprofile/cpu_type': No such file or directory
Unable to open cpu_type file for reading
Make sure you have done opcontrol --init
cpu_type 'unset' is not valid
you should upgrade oprofile or force the use of timer mode
执行 ./opcontrol --init 没有问题
没有指定内核的情况下性能监测
命令如下:
# ./opcontrol --init ---> 初始化阶段,该命令会加载oprofile.ko模块,mount oprofilefs。成功后会在/dev/oprofile/目录下导出
一些文件和目录如: cpu_type, dump, enable, pointer_size, stats/
# ./opcontrol --setup --no-vmlinux
---> 配置OProfile不去检测内核, 如果要检测内核则用: ./opcontrol --setup --vmlinux=内核所在目录
# ./opcontrol --start ---> 启动OProfile伺服程序 oprofiled, 它周期性地把采样数据写到 /var/lib/oprofile/samples/目录。
log文件在/var/lib/oprofile/oprofiled.log
# ./opcontrol --dump ---> 在分析数据前需要先把所有的数据都读到/var/lib/oprofile/samples/目录下,执行这个命令就是这个目
的。
# ./opreport ---> 分析数据,制作报告。
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
187460 99.6523 no-vmlinux
541 0.2876 oprofiled
54 0.0287 ld-linux.so.2
36 0.0191 libc.so.6
21 0.0112 busybox
1 5.3e-04 libc-2.3.3.so
1 5.3e-04 libcrypt-2.3.3.so
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/43047/showart_365029.html |
|