Re: opcontrol does not create results
Michael Petlan <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Organization | Red Hat |
| Message-ID | <1428918213.21299.38.camel@Rudolf-RHEL-7> |
On Fri, 2015-04-10 at 17:57 +0200, Lentes, Bernd wrote:
[...]
> Hi,
>
> i invoked "opannotate -s -o annotate -i __do_softirq -d /usr/src/linux/" and afterwards "less annotate/usr/src/linux-2.6.16.60-0.103.1/kernel/softirq.c".
> What I got:
>
> :asmlinkage void __do_softirq(void)
> :{ /* __do_softirq total: 18024 100.000 */
> : struct softirq_action *h;
> : __u32 pending;
> : int max_restart = MAX_SOFTIRQ_RESTART;
> : int cpu;
> :
> : pending = local_softirq_pending();
> :
> : local_bh_disable();
> : cpu = smp_processor_id();
> :restart:
> : /* Reset the pending bitmask before enabling irqs */
> : set_softirq_pending(0);
> :
> : local_irq_enable();
> :
> : h = softirq_vec;
> :
> : do {
> 18024 100.000 : if (pending & 1) {
> : h->action(h);
> : rcu_bh_qsctr_inc(cpu);
> : }
> : h++;
> : pending >>= 1;
> : } while (pending);
> :
> : local_irq_disable();
> :
> : pending = local_softirq_pending();
> : if (pending && --max_restart)
> : goto restart;
> :
> : if (pending)
> : wakeup_softirqd();
> :
> : __local_bh_enable();
> :}
>
> and at the end:
>
> /*
> * Total samples for file : "kernel/softirq.c"
> *
> * 18024 100.000
> */
>
>
> /*
> * Command line: opannotate -s -o annotate -i __do_softirq -d /usr/src/linux/
> *
> * Interpretation of command line:
> * Output annotated source file with samples
> * Output all files
> *
> * CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> * Profiling through timer interrupt
> */
>
>
> What I understand is that __do_softirq has 18024 samples and all the samples spent their time in
> do {
> if (pending & 1) {
> h->action(h);
> rcu_bh_qsctr_inc(cpu);
> }
> h++;
> pending >>= 1;
> } while (pending);
>
> Having a look at "Understanding the Linux Kernel" I find:
> " For each bit set in the pending local variable, it executes the corresponding softirq function; recall that the function address for the softirq with index n is stored in softirq_vec[n]->action."
> So here is where the respective softirq is startet. But which one ? How can I find out that ? Is there e.g. a way to check the variable h or pending ?
>
>
> Bernd
>
>
Hi,
I am not sure whether your kernel would support that, but maybe
systemtap could help you investigating this. It is a tool that
instruments various tracepoints in kernel, so everytime such tracepoint
is being hit, a "probe" function is executed. So you can put some
printing code into the probe function and it would report you data such
as local variables, etc.
This is how an entry point of a kernel function is traced:
stap -e 'probe kernel.function("some_kernel_function") { printf("%s\n",$$vars) }'
It will compile a snippet of code, which is injected into kernel...
But you should think twice where you put the snippet, because it can
cause an overhead when you instrument a function, which is executed
really often. I am not sure whether I can recommend using it on a
production server... :-)
For further documentation you may refer to:
https://sourceware.org/systemtap/tutorial/
https://sourceware.org/systemtap/SystemTap_Beginners_Guide/index.html
Michael
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF