1. 27 4月, 2010 1 次提交
  2. 15 4月, 2010 1 次提交
    • M
      perf probe: Support DW_OP_call_frame_cfa in debuginfo · a34a9854
      Masami Hiramatsu 提交于
      When building kernel without CONFIG_FRAME_POINTER, gcc uses
      CFA (canonical frame address) for frame base. With this patch,
      perf probe just gets CFI (call frame information) from debuginfo
      and search corresponding CFA from the CFI. IOW, this allows
      perf probe works correctly on the kernel without CONFIG_FRAME_POINTER.
      
      <Before>
       ./perf probe -fn sched_slice:12 lw.weight
        Fatal: DW_OP 156 is not supported.
                    (^^^ DW_OP_call_frame_cfa)
      
      <After>
      ./perf probe -fn sched_slice:12 lw.weight
      Add new event:
        probe:sched_slice    (on sched_slice:12 with weight=lw.weight)
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100412171728.3790.98217.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a34a9854
  3. 08 4月, 2010 1 次提交
    • A
      perf tools: Reorganize some structs to save space · eed05fe7
      Arnaldo Carvalho de Melo 提交于
      Using 'pahole --packable' I found some structs that could be reorganized
      to eliminate alignment holes, in some cases getting them to be cacheline
      multiples.
      
      [acme@doppio linux-2.6-tip]$ codiff perf.old ~/bin/perf
      builtin-annotate.c:
        struct perf_session    |   -8
        struct perf_header     |   -8
       2 structs changed
      
      builtin-diff.c:
        struct sample_data         |   -8
       1 struct changed
        diff__process_sample_event |   -8
       1 function changed, 8 bytes removed, diff: -8
      
      builtin-sched.c:
        struct sched_atom      |   -8
       1 struct changed
      
      builtin-timechart.c:
        struct per_pid         |   -8
       1 struct changed
        cmd_timechart          |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      builtin-probe.c:
        struct perf_probe_point |   -8
        struct perf_probe_event |   -8
       2 structs changed
        opt_add_probe_event     |   -3
       1 function changed, 3 bytes removed, diff: -3
      
      util/probe-finder.c:
        struct probe_finder      |   -8
       1 struct changed
        find_kprobe_trace_events |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      /home/acme/bin/perf:
       4 functions changed, 43 bytes removed, diff: -43
      [acme@doppio linux-2.6-tip]$
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eed05fe7
  4. 23 3月, 2010 1 次提交
  5. 17 3月, 2010 2 次提交
    • M
      perf probe: List probes with line number and file name · fb1587d8
      Masami Hiramatsu 提交于
      Improve --list to show current exist probes with line number and
      file name. This enables user easily to check which line is
      already probed.
      
      for example:
      
       ./perf probe --list
       probe:vfs_read       (on vfs_read:8@linux-2.6-tip/fs/read_write.c)
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20100316220619.32050.48702.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fb1587d8
    • M
      perf probe: Introduce kprobe_trace_event and perf_probe_event · 4235b045
      Masami Hiramatsu 提交于
      Introduce kprobe_trace_event and perf_probe_event and replace
      old probe_point structure with it. probe_point structure is
      not enough flexible nor extensible. New data structures
      will help implementing further features.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20100316220612.32050.33806.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4235b045
  6. 16 3月, 2010 1 次提交
  7. 26 2月, 2010 5 次提交
    • M
      perf probe: Add lazy line matching support · 2a9c8c36
      Masami Hiramatsu 提交于
      Add lazy line matching support for specifying new probes.
      This also changes the syntax of perf probe a bit. Now
      perf probe accepts one of below probe event definitions.
      
      1) Define event based on function name
       [EVENT=]FUNC[@src][:RLN|+OFF|%return|;PTN] [ARG ...]
      
      2) Define event based on source file with line number
       [EVENT=]SRC:ALN [ARG ...]
      
      3) Define event based on source file with lazy pattern
       [EVENT=]SRC;PTN [ARG ...]
      
      - New lazy matching pattern(PTN) follows ';' (semicolon). And it
        must be put the end of the definition.
      - So, @src is no longer the part which must be put at the end
        of the definition.
      
      Note that ';' (semicolon) can be interpreted as the end of
      a command by the shell. This means that you need to quote it.
      (anyway you will need to quote the lazy pattern itself too,
      because it may contains other sensitive characters, like
      '[',']' etc.).
      
      Lazy matching
      -------------
      The lazy line matching is similar to glob matching except
      ignoring spaces in both of pattern and target.
      
      e.g.
      'a=*' can matches 'a=b', 'a = b', 'a == b' and so on.
      
      This provides some sort of flexibility and robustness to
      probe point definitions against minor code changes.
      (for example, actual 10th line of schedule() can be changed
       easily by modifying schedule(), but the same line matching
       'rq=cpu_rq*' may still exist.)
      
      Changes in v3:
       - Cast Dwarf_Addr to uintmax_t for printf-formats.
      
      Changes in v2:
       - Cast Dwarf_Addr to unsigned long long for printf-formats.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133611.6725.45078.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2a9c8c36
    • M
      perf probe: Check function address range strictly in line finder · 161a26b0
      Masami Hiramatsu 提交于
      Check (inlined) function address range strictly for
      improving output of probe-able lines of inline functions.
      
      Without this change, perf probe --line <function> sometimes
      showed other inline function bodies too, because it didn't
      filter out inlined functions.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133557.6725.20697.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      161a26b0
    • M
      perf probe: Use libdw callback routines · e92b85e1
      Masami Hiramatsu 提交于
      Use libdw callback functions aggressively, and remove
      local tree-search API. This change simplifies the code.
      
      Changes in v3:
       - Cast Dwarf_Addr to uintmax_t for printf-formats.
      
      Changes in v2:
       - Cast Dwarf_Addr to unsigned long long for printf-formats.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133549.6725.81499.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e92b85e1
    • M
      perf probe: Use elfutils-libdw for analyzing debuginfo · 804b3606
      Masami Hiramatsu 提交于
      Newer gcc introduces newer & richer debuginfo, and only libdw
      in elfutils project can support it. So perf probe moves onto
      elfutils-libdw from libdwarf.
      
      Changes in v3:
       - Cast Dwarf_Addr/Dwarf_Word to uintmax_t for printf-formats.
       - Recover a sign-prefix which was removed in v2 by mistake.
      
      Changes in v2:
       - Fix a type-casting bug in Makefile.
       - Cast Dwarf_Addr/Dwarf_Word to unsigned long long for printf-formats.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133542.6725.34724.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      804b3606
    • M
      perf probe: Rename probe finder functions · 81cb8aa3
      Masami Hiramatsu 提交于
      Rename *_probepoint to *_probe_point, for nothing
      but a cosmetic reason.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133534.6725.52615.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      81cb8aa3
  8. 13 1月, 2010 1 次提交
    • M
      perf probe: Support --line option to show probable source-code lines · 631c9def
      Masami Hiramatsu 提交于
      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: NMasami 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: NIngo Molnar <mingo@elte.hu>
      631c9def
  9. 28 12月, 2009 1 次提交
  10. 17 12月, 2009 1 次提交
    • M
      perf probe: Fix libdwarf include path for Debian · 27f3b24d
      Masami Hiramatsu 提交于
      Fix libdwarf include path to fit debian-like systems too.
      
      Borislav Petkov reported:
      
      > even after installing libdwarf-dev on my debian box here,
      > make in tools/perf/ still complains that it cannot find libdwarf:
      >
      > Makefile:491: No libdwarf.h found or old libdwarf.h found, disables dwarf
      > support. Please install libdwarf-dev/libdwarf-devel >= 20081231
      >
      > The problem is that the include path on debian is not
      > /usr/include/libdwarf/ but simply /usr/include because the debian
      > package libdwarf-dev puts the headers straight into
      > /usr/include.
      
      This patch adds -I/usr/include/libdwarf to BASIC_CFLAGS
      and fix probe-finder.h to include just libdwarf.h/dwarf.h.
      
      This patch also adds a workaround for the undefined _MIPS_SZLONG
      bug in libdwarf.h.
      Reported-by: NBorislav Petkov <borislav.petkov@amd.com>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      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: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Gabor Gombas <gombasg@sztaki.hu>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091216221618.13816.83296.stgit@dhcp-100-2-132.bos.redhat.com>
      [ v2: small stylistic fixlets to probe-finder.h ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      27f3b24d
  11. 16 12月, 2009 1 次提交
    • M
      perf probe: Support event name for --add option · af663d75
      Masami Hiramatsu 提交于
      Support event name syntax for --add option. This allows
      users to specify event name for each new event.
      
      The --add syntax is:
       perf probe --add '[EVENT=]SRC:LINE ARGS'
      or
       perf probe --add '[EVENT=]FUNC[+OFFS|%return|:RLN][@src] ARGS'
      
      e.g.
      
       ./perf probe --add myprobe1=schedule
      
      Note: currently group name is not supported yet, because it
      can cause name-space confliction with other tracepoint/
      hw-breakpoint events.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091215153218.17436.84675.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      af663d75
  12. 29 10月, 2009 2 次提交
    • M
      perf/probes: Support function entry relative line number · b0ef0732
      Masami Hiramatsu 提交于
      Add function-entry relative line number specifying support to
      perf-probe. This allows users to define probes by line number
      from entry of the function.
      
       e.g.
      
        perf probe schedule:16
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      LKML-Reference: <20091027204319.30545.30678.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b0ef0732
    • M
      perf/probes: Improve probe point syntax of perf-probe · 253977b0
      Masami Hiramatsu 提交于
      This changes probe point syntax of perf-probe as below
      
       <SRC>[:ABS_LN] [ARGS]
       or
       <FUNC>[+OFFS|%return][@src] [ARGS]
      
      And event name and event group name are automatically
      generated based on probe-symbol and offset as below.
      
       perfprobes/SYMBOL_OFFSET[_NUM]
      
      Where SYMBOL is the probing symbol and OFFSET is
      the byte offset from the symbol.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      LKML-Reference: <20091027204310.30545.84984.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      253977b0
  13. 17 10月, 2009 2 次提交
  14. 13 10月, 2009 2 次提交
    • M
      perf probe: Add perf probe command support without libdwarf · 23e8ec0d
      Masami Hiramatsu 提交于
      Enables 'perf probe' even if libdwarf is not installed. If libdwarf is
      not found, 'perf probe' just disables dwarf support. Users can use
      'perf probe' to set up new events by using kprobe_events format.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      LKML-Reference: <20091007222830.1684.25665.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      23e8ec0d
    • M
      perf: Add perf probe subcommand, a kprobe-event setup helper · 4ea42b18
      Masami Hiramatsu 提交于
      Add perf probe subcommand that implements a kprobe-event setup helper
      to the perf command.
      This allows user to define kprobe events using C expressions (C line
      numbers, C function names, and C local variables).
      
      Usage
      -----
       perf probe [<options>] -P 'PROBEDEF' [-P 'PROBEDEF' ...]
      
          -k, --vmlinux <file>  vmlinux/module pathname
          -P, --probe <p|r:[GRP/]NAME FUNC[+OFFS][@src]|@src:LINE [ARG ...]>
                                probe point definition, where
      		p:	kprobe probe
      		r:	kretprobe probe
      		GRP:	Group name (optional)
      		NAME:	Event name
      		FUNC:	Function name
      		OFFS:	Offset from function entry (in byte)
      		SRC:	Source code path
      		LINE:	Line number
      		ARG:	Probe argument (local variable name or
      			kprobe-tracer argument format is supported.)
      
      Changes in v4:
       - Add _GNU_SOURCE macro for strndup().
      
      Changes in v3:
       - Remove -r option because perf always be used for online kernel.
       - Check malloc/calloc results.
      
      Changes in v2:
       - Check synthesized string length.
       - Rename perf kprobe to perf probe.
       - Use spaces for separator and update usage comment.
       - Check error paths in parse_probepoint().
       - Check optimized-out variables.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      LKML-Reference: <20091008211737.29299.14784.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      4ea42b18