From: Maynard J. <may...@us...> - 2014-02-03 16:07:54
|
On 02/02/2014 09:54 AM, Xin Tong wrote: > I would like profile kernel modules loaded by a user process. I am > running KVM which loads kvm-intel.ko and kvm.ko. I am getting symbols > for vmlinux because i passed my vmlinux with debuginfo to operf. > kvm*.ko shows up in the profile but with out symbols. Hi, Xin, First, some questions . . . What version of oprofile are you using? What is the exact operf command you're using to collect the profile? Are you running operf as root or a normal user? > > I tried to use > > sudo opreport --symbols /usr/lib/debug/lib/modules/3.11.0-13 -l -g -d As the man page of opreport says, the general syntax of the command is: opreport [ options ] [profile specification] The "/usr/lib/debug/lib/modules/3.11.0-13" is *not* a valid profile specification; as specified, opreport will interpret that as an image specification and look for an image name of /usr/lib/debug/lib/modules/3.11.0-13 in the profile data. Since /usr/lib/debug/lib/modules/3.11.0-13 is a directory, not an image (i.e., executable, shared lib, kernel module), opreport exits with the message "no sample files found: profile specification too strict ?". If you ran operf as root or have /proc/sys/kernel/kptr_restrict set to 0, then it will have collected kernel module samples -- and from what you show me about the sample files under oprofile_data, it seems you do have modules samples. Passing '----image-path /lib/modules/`uname -r`' to opreport will enable opreport to resolve those kernel module samples to function names. Then, if you have the kernel debuginfo package(es) installed (version must match version of running kernel), then opreport will automatically find and use them when you pass the "-g / --debug-info" option. One caveat to the above, though . . . When I developed the operf tool, I did not have access to a KVM environment, so profiling KVM guest/host inter-communication likely won't work. I just don't know. I would welcome reports of your experiences, and would especially welcome any patches you write to provide KVM support. It's just not been a high priority on my radar. On a related note, the perf tool has a 'perf kvm' mode, but in my little bit of dabbling with trying to use it, I never could get it to "work". Could have been user error, or misinterpreting the man page and other help documents (http://www.linux-kvm.org/page/Perf_events), or maybe a buggy implementation on the platform I was using it on. -Maynard > --xml -o current.opm, > > but got > > Using /home/xtong/oprofile_data/samples/ for samples directory. > error: no sample files found: profile specification too strict ? > > I looked into oprofile_data and it seems there are samples collected > for the kvm*.ko modules. Any insight ? > > xtong@aristotle:~/oprofile_data/samples/current$ find . -name kvm > ./{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm > ./{kern}/ksmd/{dep}/{kern}/kvm > xtong@aristotle:~/oprofile_data/samples/current$ cd > ./{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm > xtong@aristotle:~/oprofile_data/samples/current/{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm$ > xtong@aristotle:~/oprofile_data/samples/current/{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm$ > ls > CPU_CLK_UNHALTED.100000.0.3437.3437.all CPU_CLK_UNHALTED.100000.0.3437.3440.all > xtong@aristotle:~/oprofile_data/samples/current/{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm$ > ls -ltrh > total 48K > -rw-r--r-- 1 root root 2.7K Feb 2 10:37 CPU_CLK_UNHALTED.100000.0.3437.3437.all > -rw-r--r-- 1 root root 41K Feb 2 10:37 CPU_CLK_UNHALTED.100000.0.3437.3440.all > xtong@aristotle:~/oprofile_data/samples/current/{root}/usr/bin/qemu-system-x86_64/{dep}/{kern}/kvm$ > > Thank you, > Xin > > ------------------------------------------------------------------------------ > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > |