Re: opcontrol does not create results

Michael Petlan <[email protected]>
Newsgroups gmane.linux.oprofile
Organization Red Hat
Message-ID <1427410392.3851.92.camel@Rudolf-RHEL-7>
On Thu, 2015-03-26 at 19:30 +0100, Lentes, Bernd wrote:
> Micael wrote
> 
[.....]
> Hi Michael,
> 
> thanks for your help and patience. I think we are coming closer to the solution. I found the debuginfo kernel.
> But now I have another problem:
> 
> I followed your guidance. But when I issue an "opcontrol --start", I get the following message:
> 
> idcc-devel:~ # opcontrol --start
> Using default event: CPU_CLK_UNHALTED:100000:0:1:1
> Using 2.6+ OProfile kernel interface.
> Reading module info.
> Using log file /var/lib/oprofile/oprofiled.log
> Daemon started.
> Profiler running.
> idcc-devel:~ #

You're running oprofile in the "normal" mode, which uses _hardware_ CPU
features (counters, events) for profiling. Modern CPUs are equipped with
various hardware counters, which are able to count many events, for
example various cache misses, instructions issued, prediction misses, or
just CPU clockticks. Oprofile is here to be able to count the events and
catch samples which are related to the executed code, and they can point
to some bottlenecks in it etc.

Those features are usually not available for VM guests. It's not a rule,
since AFAIK KVM can enable its VM guests to use the hardware counters of
the host. But by default, let's say that it's not available at VMs.

For such cases, there is a fallback TIMER mode in oprofile, which allows
you to do similar sampling, but the samples are not generated by
hardware events, but by some "artificial" scheduled software interrupts.

The timer mode is enabled by the command `modprobe oprofile timer=1`. It
loads the kernel module and tells it that it should use the timer mode
instead of trying to use the HW. You'd need to unload the module and
kill the daemon and also remove all the previous measurements by
`opcontrol --deinit` and `opcontrol --reset`, then load the module by
the mentioned command.

> 
> I get no results for profiling:

That's expectable, because you're running a VM guest (if I remember
correctly).

> 
> idcc-devel:~ # opreport
> opreport error: No sample file found: try running opcontrol --dump
> or specify a session containing sample files
> 
> The appropriate folder is empty:
> 
> idcc-devel:~ # l /var/lib/oprofile/samples/current/
> total 8
> drwxr-xr-x 2 root root 4096 Mar 26 19:18 ./
> drwxr-xr-x 7 root root 4096 Mar 26 19:18 ../
> idcc-devel:~ #
> 
> I'm pretty sure that when I got the results i provided per e-mail, the " Using default event: CPU_CLK_UNHALTED:100000:0:1:1" didn't appear. Is that the reason that I don't get results ?
> I think so. How can I get rid of it ?
> 

Yes, because you've already used the timer mode which gave you results.

> Here is my configuration:
> 
> idcc-devel:~ # opcontrol --status
> Daemon not running
> Separate options: library kernel
> vmlinux file: /usr/lib/debug/boot/vmlinux-2.6.16.60-0.103.1-smp.debug
this looks like a correct vmlinux file ---^^

> Image filter: none
> Call-graph depth: 0
> 
> idcc-devel:~ # cat .oprofile/daemonrc
> NR_CHOSEN=0
> SEPARATE_LIB=1
> SEPARATE_KERNEL=1
> SEPARATE_THREAD=0
> SEPARATE_CPU=0
> VMLINUX=/boot/vmlinux-2.6.16.60-0.103.1-smp.gz
      ^^^
As William Cohen noticed, this is NOT a correct path for the vmlinux
file.

> IMAGE_FILTER=
> CPU_BUF_SIZE=0
> CALLGRAPH=0
> idcc-devel:~ #
> 
> Bernd
> 

Hope it helps.
Michael

> 
> 
> 
> Helmholtz Zentrum München
> Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH)
> Ingolstädter Landstr. 1
> 85764 Neuherberg
> www.helmholtz-muenchen.de
> Aufsichtsratsvorsitzende: MinDir´in Bärbel Brumme-Bothe
> Geschäftsführer: Prof. Dr. Günther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen
> Registergericht: Amtsgericht München HRB 6466
> USt-IdNr: DE 129521671



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.