1. 17 Oct, 2009 9 commits
    • Masami Hiramatsu's avatar
      perf: Add perf-probe document · 595c3649
      Masami Hiramatsu authored
      Add perf-probe subcommand document and add it to command-list.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000827.16556.73539.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      595c3649
    • Masami Hiramatsu's avatar
      perf: Add DIE_IF() macro for error checking · 9769833b
      Masami Hiramatsu authored
      Add DIE_IF() macro and replace ERR_IF() with it, and use
      linux/stringify.h.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000818.16556.82452.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9769833b
    • Masami Hiramatsu's avatar
      perf: Use eprintf() for debug messages in perf-probe · 89c69c0e
      Masami Hiramatsu authored
      Replace debug() macro with eprintf() and add -v option for
      showing those messages in perf-probe.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000810.16556.38013.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      89c69c0e
    • Masami Hiramatsu's avatar
      perf: Use die() for error cases in perf-probe · 074fc0e4
      Masami Hiramatsu authored
      Use die() for exiting perf-probe with errors. This replaces
      perror_exit(), msg_exit() and fprintf()+exit() with die(), and
      uses die() in semantic_error().
      
      This also renames 'die' local variables to 'dw_die' for avoiding
      name confliction.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000801.16556.46866.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      074fc0e4
    • Masami Hiramatsu's avatar
      perf: Check libdwarf APIs for perf probe · 4c20194c
      Masami Hiramatsu authored
      Check libdwarf APIs for perf probe in tools/perf/Makefile. Since
      dwarf_get_ranges() has been added from libdwarf 20081231 (and
      it's the newest function used in probe-finder.c), this just
      checks whether the function is defined.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000752.16556.92051.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4c20194c
    • Masami Hiramatsu's avatar
      x86: Add AMD prefetch and 3DNow! opcodes to opcode map · d1baf5a5
      Masami Hiramatsu authored
      Add AMD prefetch and 3DNow! opcode including FEMMS. Since 3DNow!
      uses the last immediate byte as an opcode extension byte, x86
      insn just treats the extenstion byte as an immediate byte
      instead of a part of opcode (insn_get_opcode() decodes first
      "0x0f 0x0f" bytes.)
      
      Users who are interested in analyzing 3DNow! opcode still can
      decode it by analyzing the immediate byte.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000744.16556.27881.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d1baf5a5
    • Masami Hiramatsu's avatar
      x86: Add MMX/SSE opcode groups to opcode map · 8c95bc3e
      Masami Hiramatsu authored
      Add missing MMX/SSE opcode groups to x86 opcode map.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000736.16556.29061.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8c95bc3e
    • Masami Hiramatsu's avatar
      tracing/kprobes: Add failure messages for debugging · e63cc239
      Masami Hiramatsu authored
      Add verbose failure messages to kprobe-tracer for debugging.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000728.16556.16713.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e63cc239
    • Masami Hiramatsu's avatar
      tracing/kprobes: Update kprobe-tracer selftest against new syntax · f397af06
      Masami Hiramatsu authored
      Update kprobe-tracer selftest since command syntax has been
      changed.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000720.16556.26343.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f397af06
  2. 12 Oct, 2009 7 commits
    • Masami Hiramatsu's avatar
      perf probe: Add perf probe command support without libdwarf · 23e8ec0d
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      23e8ec0d
    • Masami Hiramatsu's avatar
      perf: Add perf probe subcommand, a kprobe-event setup helper · 4ea42b18
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      4ea42b18
    • Masami Hiramatsu's avatar
      tracing/kprobes: Robustify fixed field names against variable field names conflicts · e93f4d85
      Masami Hiramatsu authored
      Rename probe-common fixed field names to harder conflictable names,
      because current 'ip', 'func', and other probe field names are easily in
      conflict with user-specified variable names.
      Signed-off-by: default avatarMasami 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: <20091007222814.1684.407.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      e93f4d85
    • Masami Hiramatsu's avatar
      tracing/kprobes: Avoid field name confliction · a703d946
      Masami Hiramatsu authored
      Check whether the argument name is in conflict with other field names
      while creating a kprobe through the debugfs interface.
      
      Changes in v3:
       - Check strcmp() == 0 instead of !strcmp().
      
      Changes in v2:
       - Add common_lock_depth to reserved name list.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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: <20091007222807.1684.26880.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      a703d946
    • Masami Hiramatsu's avatar
      tracing/kprobes: Make special variable names more self-explainable · 2e06ff63
      Masami Hiramatsu authored
      Rename special variables to more self-explainable names as below:
      - $rv to $retval
      - $sa to $stack
      - $aN to $argN
      - $sN to $stackN
      Signed-off-by: default avatarMasami 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: <20091007222759.1684.3319.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      2e06ff63
    • Masami Hiramatsu's avatar
      tracing/kprobes: Remove '$ra' special variable · 99329c44
      Masami Hiramatsu authored
      Remove '$ra' (return address) because it is already shown at the head of
      each entry.
      Signed-off-by: default avatarMasami 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: <20091007222748.1684.12711.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      99329c44
    • Masami Hiramatsu's avatar
      tracing/kprobes: Add $ prefix to special variables · 405b2651
      Masami Hiramatsu authored
      Add $ prefix to the special variables(e.g. sa, rv) of kprobe-tracer.
      This resolves consistency issues between kprobe_events and perf-kprobe.
      
      The main goal is to avoid conflicts between local variable names of
      probed functions, used by perf probe, and special variables used
      in the kprobe event creation interface (stack values, etc...) and
      also available from perf probe.
      
      ie: we don't want rv (return value) to conflict with a local variable
      named rv in a probed function.
      Signed-off-by: default avatarMasami 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: <20091007222740.1684.91170.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      405b2651
  3. 03 Oct, 2009 3 commits
    • Masami Hiramatsu's avatar
      tracing/ftrace: Fix to check create_event_dir() when adding new events · 88f70d75
      Masami Hiramatsu authored
      Check result of event_create_dir() and add ftrace_event_call to
      ftrace_events list only if it is succeeded. Thanks to Li for pointing
      it out.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20090925182054.10157.55219.stgit@omoto>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      88f70d75
    • Masami Hiramatsu's avatar
      x86: Add VIA processor instructions in opcodes decoder · c0b11d3a
      Masami Hiramatsu authored
      Add VIA processor's Padlock instructions(MONTMUL, XSHA1, XSHA256)
      as parts of the kernel may use them.
      
      This fixes the following crash in opcodes decoder selftests:
      
       make[2]: `scripts/unifdef' is up to date.
         TEST    posttest
       Error: c145cf71:        f3 0f a6 d0             repz xsha256
       Error: objdump says 4 bytes, but insn_get_length() says 3 (attr:0)
       make[1]: *** [posttest] Error 2
       make: *** [bzImage] Error 2
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20090925182037.10157.3180.stgit@omoto>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      c0b11d3a
    • Masami Hiramatsu's avatar
      tracing/kprobes: Use global event perf buffers in kprobe tracer · a1a138d0
      Masami Hiramatsu authored
      Use new percpu global event buffer instead of stack in kprobe
      tracer while tracing through perf.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: K.Prasad <prasad@linux.vnet.ibm.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20090925182011.10157.60140.stgit@omoto>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      a1a138d0
  4. 23 Sep, 2009 21 commits