linux-kernel-test/tools/perf/Documentation
Masami Hiramatsu 631c9def80 perf probe: Support --line option to show probable source-code lines
Add --line option to support showing probable source-code lines.

  perf probe --line SRC:LN[-LN|+NUM]
   or
  perf probe --line FUNC[:LN[-LN|+NUM]]

This option shows source-code with line number if the line can
be probed. Lines without line number (and blue color) means that
the line can not be probed, because debuginfo doesn't have the
information of those lines.

The argument specifies the range of lines, "source.c:100-120"
shows lines between 100th to l20th in source.c file. And
"func:10+20" shows 20 lines from 10th line of func function.

e.g.
 # ./perf probe --line kernel/sched.c:1080
 <kernel/sched.c:1080>
          *
          * called with rq->lock held and irqs disabled
          */
         static void hrtick_start(struct rq *rq, u64 delay)
         {
                struct hrtimer *timer = &rq->hrtick_timer;
   1086         ktime_t time = ktime_add_ns(timer->base->get_time(), delay);

                hrtimer_set_expires(timer, time);

   1090         if (rq == this_rq()) {
   1091                 hrtimer_restart(timer);
   1092         } else if (!rq->hrtick_csd_pending) {
   1093                 __smp_call_function_single(cpu_of(rq), &rq->hrtick_csd,
   1094                 rq->hrtick_csd_pending = 1;

If you specifying function name, this shows function-relative
line number.

 # ./perf probe --line schedule
 <schedule:0>
         asmlinkage void __sched schedule(void)
      1  {
                struct task_struct *prev, *next;
                unsigned long *switch_count;
                struct rq *rq;
                int cpu;

         need_resched:
                preempt_disable();
      9         cpu = smp_processor_id();
     10         rq = cpu_rq(cpu);
     11         rcu_sched_qs(cpu);
     12         prev = rq->curr;
     13         switch_count = &prev->nivcsw;

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <20100106144534.27218.77939.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-01-13 10:09:14 +01:00
..
asciidoc.conf
examples.txt perf: Rename perf-examples.txt to examples.txt 2009-08-17 10:43:42 +02:00
Makefile perf tools: Make 'make html' work 2009-08-18 18:43:13 +02:00
manpage-1.72.xsl
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-suppress-sp.xsl
perf-annotate.txt
perf-bench.txt perf bench: Add new document about perf-bench 2009-11-10 14:14:36 +01:00
perf-buildid-list.txt perf buildid-list: Always show the DSO name 2009-11-17 07:19:54 +01:00
perf-diff.txt perf diff: Use perf_session__fprintf_hists just like 'perf record' 2009-12-16 16:53:37 +01:00
perf-help.txt
perf-kmem.txt perf kmem: Show usage if no option is specified 2009-12-10 08:30:27 +01:00
perf-list.txt
perf-probe.txt perf probe: Support --line option to show probable source-code lines 2010-01-13 10:09:14 +01:00
perf-record.txt perf tools: Add support for breakpoint events in perf tools 2009-11-23 18:18:31 +01:00
perf-report.txt perf diff: Use perf_session__fprintf_hists just like 'perf record' 2009-12-16 16:53:37 +01:00
perf-sched.txt perf sched: Add 'perf sched trace', improve documentation 2009-09-13 17:55:23 +02:00
perf-stat.txt perf stat: Fix tool option consistency: rename -S/--scale to -c/--scale 2009-08-09 12:54:37 +02:00
perf-timechart.txt perf timechart: Add a process filter 2009-10-20 07:55:50 +02:00
perf-top.txt perf top: Update man page 2009-08-09 12:54:32 +02:00
perf-trace-perl.txt perf trace: Add Documentation for perf trace Perl support 2009-11-28 10:04:27 +01:00
perf-trace.txt perf trace/scripting: Update Documentation 2009-12-15 10:31:33 +01:00
perf.txt