1. 15 4月, 2010 4 次提交
    • M
      perf probe: Support basic type casting · 11a1ca35
      Masami Hiramatsu 提交于
      Add basic type casting for arguments to perf probe. This allows
      users to specify the actual type of arguments. Of course, if
      user sets invalid types, kprobe-tracer rejects that.
      
      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: <20100412171722.3790.50372.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      11a1ca35
    • M
      perf probe: Query basic types from debuginfo · 4984912e
      Masami Hiramatsu 提交于
      Query the basic type information (byte-size and signed-flag) from
      debuginfo and pass that to kprobe-tracer. This is especially useful
      for tracing the members of data structure, because each member has
      different byte-size on the memory.
      
      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: <20100412171715.3790.23730.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4984912e
    • M
      perf probe: Use the last field name as the argument name · df0faf4b
      Masami Hiramatsu 提交于
      Set the last field name to the argument name when the argument
      is refering a data-structure member.
      
      e.g.
       ./perf probe --add 'vfs_read file->f_mode'
       Add new event:
         probe:vfs_read       (on vfs_read with f_mode=file->f_mode)
      
       This probe records file->f_mode, but the argument name becomes "f_mode".
      
      This enables perf-trace command to parse trace event format correctly.
      
      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: <20100412171700.3790.72961.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      df0faf4b
    • M
      perf probe: Support argument name · 48481938
      Masami Hiramatsu 提交于
      Set given names to event arguments. The syntax is same as kprobe-tracer,
      you can add 'NAME=' right before each argument.
      
      e.g.
        ./perf probe vfs_read foo=file
      
       then, 'foo' is set to the argument name as below.
      
        ./perf probe -l
        probe:vfs_read       (on vfs_read@linux-2.6-tip/fs/read_write.c with foo)
      
      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: <20100412171653.3790.74624.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48481938
  2. 23 3月, 2010 1 次提交
  3. 19 3月, 2010 1 次提交
    • I
      perf events: Fix false positive build warning with older GCC's · 55632770
      Ingo Molnar 提交于
      gcc 4.2.1 produces:
      
       util/probe-event.c: In function 'add_perf_probe_events':
       util/probe-event.c:883: warning: 'tev' may be used uninitialized in this function
       make: *** [util/probe-event.o] Error 1
      
      Newer GCCs get this right.
      
      To work it around, initialize the variable to NULL so that older GCCs see
      it as initialized too.
      
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      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>
      55632770
  4. 17 3月, 2010 7 次提交
    • I
      perf probe: Fix !dwarf build · 3b0d5164
      Ingo Molnar 提交于
      Fix the !drawf build.
      
      This uses the existing NO_DWARF_SUPPORT mechanism we use for that,
      but it's really fragile and needs a cleanup. (in a separate patch)
      
      1) Such uses:
      
       #ifndef NO_DWARF_SUPPORT
      
      are double inverted logic a'la 'not not'. Instead the flag should
      be called DWARF_SUPPORT.
      
      2) Furthermore, assymetric #ifdef polluted code flow like:
      
              if (need_dwarf)
       #ifdef NO_DWARF_SUPPORT
                      die("Debuginfo-analysis is not supported");
       #else   /* !NO_DWARF_SUPPORT */
                      pr_debug("Some probes require debuginfo.\n");
      
              fd = open_vmlinux();
      
      is very fragile and not acceptable. Instead of that helper functions
      should be created and the dwarf/no-dwarf logic should be separated more
      cleanly.
      
      3) Local variable #ifdefs like this:
      
       #ifndef NO_DWARF_SUPPORT
              int fd;
       #endif
      
      Are fragile as well and should be eliminated. Helper functions achieve
      that too.
      
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      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>
      3b0d5164
    • M
      perf probe: Add data structure member access support · 7df2f329
      Masami Hiramatsu 提交于
      Support accessing members in the data structures. With this,
      perf-probe accepts data-structure members(IOW, it now accepts
      dot '.' and arrow '->' operators) as probe arguemnts.
      
      e.g.
      
       ./perf probe --add 'schedule:44 rq->curr'
      
       ./perf probe --add 'vfs_read file->f_op->read file->f_path.dentry'
      
      Note that '>' can be interpreted as redirection in command-line.
      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: <20100316220626.32050.57552.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7df2f329
    • 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
    • M
      perf probe: Add --dry-run option · f4d7da49
      Masami Hiramatsu 提交于
      Add --dry-run option for debugging and testing.
      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: <20100316220605.32050.6571.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f4d7da49
    • M
      perf probe: Move add-probe routine to util/ · e0faa8d3
      Masami Hiramatsu 提交于
      Move add-probe routine to util/probe_event.c. This simplifies
      main routine for reducing maintenance cost.
      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: <20100316220537.32050.72214.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e0faa8d3
    • M
      perf probe: Use wrapper functions · 31facc5f
      Masami Hiramatsu 提交于
      Use wrapped functions as much as possible, to check out of
      memory conditions in perf probe.
      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: <20100316220530.32050.53951.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      31facc5f
  5. 13 3月, 2010 1 次提交
  6. 26 2月, 2010 2 次提交
    • 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: Show more lines after last line · 5c8d1cbb
      Masami Hiramatsu 提交于
      Show 2 more lines after the last probe-able line.
      This will clearly show the last closed-brace of
      inline 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: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133604.6725.76820.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5c8d1cbb
  7. 22 2月, 2010 1 次提交
    • M
      perf probe: Init struct probe_point and set counter correctly · 388c3aab
      Masami Hiramatsu 提交于
      Clear struct probe_point before using it in
      show_perf_probe_events(), and set pp->found counter correctly in
      synthesize_perf_probe_point(). Without this initialization,
      clear_probe_point() will free random addresses.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20100218181652.26547.57790.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      388c3aab
  8. 13 1月, 2010 2 次提交
    • 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
    • M
      perf probe: Show probe list in pager · 72041334
      Masami Hiramatsu 提交于
      Show probe list in pager, because the list can be longer than
      a page.
      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: <20100105224710.19431.61542.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      72041334
  9. 30 12月, 2009 1 次提交
  10. 17 12月, 2009 1 次提交
    • M
      perf probe: Check new event name · b7702a21
      Masami Hiramatsu 提交于
      Check new event name is same syntax as a C symbol in perf command.
      In other words, checking the name is as like as other tracepoint
      events.
      
      This can prevent user to create an event with useless name (e.g.
      foo|bar, foo*bar).
      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: 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: 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: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091216222415.14459.71383.stgit@dhcp-100-2-132.bos.redhat.com>
      [ v2: minor cleanups ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b7702a21
  11. 16 12月, 2009 9 次提交
    • M
      perf probe: Fix to show which probe point is not found · 7ef17aaf
      Masami Hiramatsu 提交于
      Fix perf probe to show which probe point is not found.
      With out this patch, it shows just "No probe point found."
      This doesn't help users if they specify several probes.
      e.g.
      
       # perf probe -f --add schedule --add test
        Fatal: No probe point found.
      
      This patch makes error message more helpful as below.
      
       # perf probe --add schedule --add test
        Fatal: Probe point 'test' not found. - probe not added.
      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: <20091215153247.17436.49068.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7ef17aaf
    • M
      perf probe: Reject second attempt of adding same-name event · d761b08b
      Masami Hiramatsu 提交于
      Reject second attempt of adding same-name event. This patch
      also provides --force option which allows user to add additional
      probe events on the same-name event.
      
      e.g.
      (the first attempt : success)
       ./perf probe schedule
       Added new event:
         probe:schedule                           (on schedule+0)
      
      (the second attempt : failure)
       ./perf probe schedule:11
       Error: event "schedule" already exists. (Use -f to force duplicates.)
         Fatal: Can't add new event.
      
      (the second attempt with -f : successfully added)
       ./perf probe -f schedule:11
       Added new event:
         probe:schedule_1                         (on schedule+45)
      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: <20091215153225.17436.15166.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d761b08b
    • 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
    • M
      perf probe: Add glob matching support on --del · bbbb521b
      Masami Hiramatsu 提交于
      Add glob-expression matching support on --del option.
      You can use wildcards for specifying deleting events.
      e.g.
      
       Clear all probe events:
      
       # perf probe --del '*'
      
       Clear probes on schedule():
      
       # perf probe --del 'schedule*'
      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: <20091215153210.17436.12327.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bbbb521b
    • M
      perf probe: Use strlist__for_each macros in probe-event.c · adf365f4
      Masami Hiramatsu 提交于
      Use strlist__for_each macros instead of using strlist__entry()
      and index variable.
      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: <20091215153203.17436.52039.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      adf365f4
    • M
      perf probe: Fix --del to update current event list · 3e340590
      Masami Hiramatsu 提交于
      Fix --del option to update current existing event list
      after perf probe deleted an event.
      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: <20091215153149.17436.61265.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e340590
    • M
      perf probe: Fix --del to show info instead of warning · f6bbff77
      Masami Hiramatsu 提交于
      Fix --del option to show info message instead of warning
      if failing to find specified event.
      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: <20091215153142.17436.7793.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f6bbff77
    • M
      perf probe: Check the result of e_snprintf() · 7e990a51
      Masami Hiramatsu 提交于
      Fix show_perf_probe_event() to check the result of e_snprintf().
      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: <20091215153121.17436.34674.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7e990a51
    • M
      perf probe: Cleanup struct session in builtin-probe.c · fac13fd5
      Masami Hiramatsu 提交于
      Clean up struct session in builtin-probe.c, including
      change need_dwarf to bool and move listing flag into
      struct session as list_events flag.
      
      This also changes parse_perf_probe_event() interface
      due to code readability.
      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: <20091215153114.17436.77000.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fac13fd5
  12. 10 12月, 2009 1 次提交
  13. 09 12月, 2009 4 次提交
    • M
      perf probe: Support --del option · fa28244d
      Masami Hiramatsu 提交于
      Support perf probe --del <event> option. Currently,
      perf probe can have only one event for each --del option.
      If you'd like to delete several probe events, you need
      to specify --del for each events.
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220323.10142.62079.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa28244d
    • M
      perf probe: Remove event suffix number _0 · 17f88fcd
      Masami Hiramatsu 提交于
      Remove event suffix number _0 if it is the first.
      The first event has no suffix, and from the second,
      each event has suffix number counted from _1. This
      reduces typing cost :-).
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220301.10142.50031.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      17f88fcd
    • M
      perf probe: Change probe-added message more user-friendly · a9b495b0
      Masami Hiramatsu 提交于
      Change probe-added message more user-friendly expression and
      show usage of new events.
      
      Before:
      Added new event: p:probe/schedule_0 schedule+10 prev=%ax cpu=%bx
      
      After:
      Added new event:
        probe:schedule_1                         (on schedule+1 with prev cpu)
      
      You can now use it on all perf tools, such as:
      
              perf record -e probe:schedule_1 -a sleep 1
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220247.10142.91642.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a9b495b0
    • M
      perf probe: Change event list format · 278498d4
      Masami Hiramatsu 提交于
      Change event list format for user readability. perf probe --list
      shows event list in "[GROUP:EVENT] EVENT-DEFINITION" format, but
      this format is different from the output of perf-list, and
      EVENT-DEFINITION is a bit blunt. This patch changes the format to
      more user friendly one.
      
      Before:
      [probe:schedule_0]	schedule+10 prev cpu
      
      After:
        probe:schedule_0                         (on schedule+10 with prev cpu)
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20091208220240.10142.42916.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      278498d4
  14. 08 12月, 2009 2 次提交
    • M
      perf probe: Check e_snprintf() format string · 84988450
      Masami Hiramatsu 提交于
      Check e_snprintf() format string by gcc, and fix a bug of
      e_snprintf() caller.
      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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091207170053.19230.7690.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      84988450
    • M
      perf probe: Fix event namelist to duplicate string · e1d2017b
      Masami Hiramatsu 提交于
      Fix event namelist to duplicate string. Without duplicating, adding
      multiple probes causes stack overwrite bug, because it reuses a
      buffer on stack while the buffer is already added in the namelist.
      String duplication solves this bug because only contents of the
      buffer is copied to the namelist.
      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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091207170046.19230.55557.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e1d2017b
  15. 02 12月, 2009 1 次提交
  16. 01 12月, 2009 2 次提交
    • M
      perf probe: Simplify event naming · b498ce1f
      Masami Hiramatsu 提交于
      Simplify event naming as <symbol>_<seqnum>. Each event name is
      globally unique (group name is not checked). So, if there is
      schedule_0, next probe event on schedule() will be schedule_1.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091201002024.10235.2353.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b498ce1f
    • M
      perf probe: Add --list option for listing current probe events · 4de189fe
      Masami Hiramatsu 提交于
      Add --list option for listing currently defined probe events
      in the kernel. This shows events in below format;
      
       [group:event]	<perf-probe probe-definition>
      
      for example:
      
       [probe:schedule_0]	schedule+30 cpu
      
      Note that source file/line information is not supported yet.
      So even if you added a probe by line, it will be shown in
      <symbol+offset>.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      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>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091201002017.10235.76575.stgit@harusame>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4de189fe