public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Chase Douglas <chase.douglas@canonical.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND][PATCH v2] perf probe: add kernel source path option
Date: Thu, 17 Jun 2010 19:50:10 -0300	[thread overview]
Message-ID: <20100617225010.GB20602@ghostprotocols.net> (raw)
In-Reply-To: <1276543590-10486-1-git-send-email-chase.douglas@canonical.com>

Corrected Masami-san address,

Em Mon, Jun 14, 2010 at 03:26:30PM -0400, Chase Douglas escreveu:
> The probe plugin requires access to the source code for some operations.
> The source code must be in the exact same location as specified by the
> DWARF tags, but sometimes the location is an absolute path that cannot
> be replicated by a normal user. This change adds the -s|--source option
> to allow the user to specify the root of the kernel source tree.
> 
> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>

Just tested it, works as advertised:

[root@emilia mingo]# perf probe -L __schedule | head -22
Debuginfo analysis failed. (-2)
  Error: Failed to show lines. (-2)
[root@emilia mingo]# perf probe -s /usr/src/debug/kernel-rt-2.6.33.4-rt20.19.el5rt/linux-2.6.33.4.x86_64 -L __schedule | head -22
<__schedule:0>
      0  {
         	struct task_struct *prev, *next;
         	unsigned long *switch_count;
         	struct rq *rq;
         	int cpu;
         
      6  	cpu = smp_processor_id();
      7  	rq = cpu_rq(cpu);
      8  	rcu_sched_qs(cpu);
      9  	prev = rq->curr;
     10  	switch_count = &prev->nivcsw;
         
     12  	release_kernel_lock(prev);
         
         	schedule_debug(prev);
         
     16  	preempt_disable();
         
     18  	if (sched_feat(HRTICK))
     19  		hrtick_clear(rq);
         
[root@emilia mingo]# cat /sys/kernel/debug/sched_features
FAIR_SLEEPERS GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER NO_HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN 
[root@emilia mingo]# perf probe __schedule:19
Add new event:
  probe:__schedule     (on __schedule:19)

You can now use it on all perf tools, such as:

	perf record -e probe:__schedule -aR sleep 1

[root@emilia mingo]# perf record -e probe:__schedule -aR sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.061 MB perf.data (~2684 samples) ]
[root@emilia mingo]# perf report | head -15
#
# (For a higher level overview, try: perf report --sort comm,dso)
#
[root@emilia mingo]# echo HRTICK > /sys/kernel/debug/sched_features
[root@emilia mingo]# cat /sys/kernel/debug/sched_features
FAIR_SLEEPERS GENTLE_FAIR_SLEEPERS NO_NORMALIZED_SLEEPER START_DEBIT WAKEUP_PREEMPT ADAPTIVE_GRAN ASYM_GRAN NO_WAKEUP_SYNC NO_WAKEUP_OVERLAP SYNC_WAKEUPS AFFINE_WAKEUPS SYNC_LESS NO_SYNC_MORE NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY NO_ARCH_POWER HRTICK NO_DOUBLE_TICK LB_BIAS LB_SHARES_UPDATE ASYM_EFF_LOAD OWNER_SPIN 
[root@emilia mingo]# perf record -e probe:__schedule -aR sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.528 MB perf.data (~66766 samples) ]
[root@emilia mingo]# perf report | head -15
# Events: 19K cycles
#
# Overhead          Command       Shared Object  Symbol
# ........  ...............  ..................  ......
#
    38.42%             init                   0  [k] 0000000000000000
     5.42%     sirq-timer/0  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/5  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/4  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/3  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/2  [kernel.kallsyms]   [k] kernel_thread_helper
     5.41%     sirq-timer/1  [kernel.kallsyms]   [k] kernel_thread_helper
     5.40%     sirq-timer/7  [kernel.kallsyms]   [k] kernel_thread_helper
     5.40%     sirq-timer/6  [kernel.kallsyms]   [k] kernel_thread_helper
     5.26%          swapper                   0  [k] 0000000000000000
[root@emilia mingo]#

Really cool stuff, thanks for your patch and to Masami for his amazing work on
'perf probe'.

I think we should look at usual places like debuginfo packages and
/usr/src/linux-`uname`, ~/git/linux-2.6/, etc, but that is something for a
follow on patch.

Best Regards,

- Arnaldo

  parent reply	other threads:[~2010-06-17 23:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 19:26 [RESEND][PATCH v2] perf probe: add kernel source path option Chase Douglas
2010-06-15  1:03 ` Arnaldo Carvalho de Melo
2010-06-15  5:17 ` Masami Hiramatsu
2010-06-17 22:50 ` Arnaldo Carvalho de Melo [this message]
2010-06-18 10:17 ` [tip:perf/core] perf probe: Add " tip-bot for Chase Douglas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100617225010.GB20602@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=chase.douglas@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox