1. 26 2月, 2010 13 次提交
    • M
      perf probe: Fix bugs in line range finder · 3cb8bc6a
      Masami Hiramatsu 提交于
      Fix find_line_range_by_line() to init line_list and remove
      misconseptional found marking which should be done when
      real lines are found (if there is no lines probe-able,
      find_line_range() should return 0).
      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: <20100225133527.6725.52418.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3cb8bc6a
    • M
      perf probe: Update perf probe document · ee391de8
      Masami Hiramatsu 提交于
      Update perf-probe.txt to suit to current perf-probe command
      and add some examples.
      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: <20100225133519.6725.58816.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ee391de8
    • M
      perf probe: Do not show --line option without dwarf support · f3ab481c
      Masami Hiramatsu 提交于
      Do not show --line option in help message when perf
      doesn't support dwarf.
      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: <20100225133512.6725.88423.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f3ab481c
    • M
      kprobes: Add documents of jump optimization · b26486bf
      Masami Hiramatsu 提交于
      Add documentations about kprobe jump optimization to
      Documentation/kprobes.txt.
      
      Changes in v10:
       - Editorial fixups by Jim Keniston.
      
      Changes in v8:
       - Update documentation and benchmark results.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NJim Keniston <jkenisto@us.ibm.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133504.6725.79395.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b26486bf
    • M
      kprobes/x86: Support kprobes jump optimization on x86 · c0f7ac3a
      Masami Hiramatsu 提交于
      Introduce x86 arch-specific optimization code, which supports
      both of x86-32 and x86-64.
      
      This code also supports safety checking, which decodes whole of
      a function in which probe is inserted, and checks following
      conditions before optimization:
       - The optimized instructions which will be replaced by a jump instruction
         don't straddle the function boundary.
       - There is no indirect jump instruction, because it will jumps into
         the address range which is replaced by jump operand.
       - There is no jump/loop instruction which jumps into the address range
         which is replaced by jump operand.
       - Don't optimize kprobes if it is in functions into which fixup code will
         jumps.
      
      This uses text_poke_multibyte() which doesn't support modifying
      code on NMI/MCE handler. However, since kprobes itself doesn't
      support NMI/MCE code probing, it's not a problem.
      
      Changes in v9:
       - Use *_text_reserved() for checking the probe can be optimized.
       - Verify jump address range is in 2G range when preparing slot.
       - Backup original code when switching optimized buffer, instead of
         preparing buffer, because there can be int3 of other probes in
         preparing phase.
       - Check kprobe is disabled in arch_check_optimized_kprobe().
       - Strictly check indirect jump opcodes (ff /4, ff /5).
      
      Changes in v6:
       - Split stop_machine-based jump patching code.
       - Update comments and coding style.
      
      Changes in v5:
       - Introduce stop_machine-based jump replacing.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133446.6725.78994.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0f7ac3a
    • M
      x86: Add text_poke_smp for SMP cross modifying code · 3d55cc8a
      Masami Hiramatsu 提交于
      Add generic text_poke_smp for SMP which uses stop_machine()
      to synchronize modifying code.
      This stop_machine() method is officially described at "7.1.3
      Handling Self- and Cross-Modifying Code" on the intel's
      software developer's manual 3A.
      
      Since stop_machine() can't protect code against NMI/MCE, this
      function can not modify those handlers. And also, this function
      is basically for modifying multibyte-single-instruction. For
      modifying multibyte-multi-instructions, we need another special
      trap & detour code.
      
      This code originaly comes from immediate values with
      stop_machine() version. Thanks Jason and Mathieu!
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133438.6725.80273.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3d55cc8a
    • M
      kprobes/x86: Cleanup save/restore registers · f007ea26
      Masami Hiramatsu 提交于
      Introduce SAVE/RESOTRE_REGS_STRING for cleanup
      kretprobe-trampoline asm code. These macros will be used for
      emulating interruption.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133430.6725.83342.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f007ea26
    • M
      kprobes/x86: Boost probes when reentering · 0f94eb63
      Masami Hiramatsu 提交于
      Integrate prepare_singlestep() into setup_singlestep() to boost
      up reenter probes, if possible.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133423.6725.12071.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0f94eb63
    • M
      kprobes: Jump optimization sysctl interface · b2be84df
      Masami Hiramatsu 提交于
      Add /proc/sys/debug/kprobes-optimization sysctl which enables
      and disables kprobes jump optimization on the fly for debugging.
      
      Changes in v7:
       - Remove ctl_name = CTL_UNNUMBERED for upstream compatibility.
      
      Changes in v6:
      - Update comments and coding style.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133415.6725.8274.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b2be84df
    • M
      kprobes: Introduce kprobes jump optimization · afd66255
      Masami Hiramatsu 提交于
      Introduce kprobes jump optimization arch-independent parts.
      Kprobes uses breakpoint instruction for interrupting execution
      flow, on some architectures, it can be replaced by a jump
      instruction and interruption emulation code. This gains kprobs'
      performance drastically.
      
      To enable this feature, set CONFIG_OPTPROBES=y (default y if the
      arch supports OPTPROBE).
      
      Changes in v9:
       - Fix a bug to optimize probe when enabling.
       - Check nearby probes can be optimize/unoptimize when disarming/arming
         kprobes, instead of registering/unregistering. This will help
         kprobe-tracer because most of probes on it are usually disabled.
      
      Changes in v6:
       - Cleanup coding style for readability.
       - Add comments around get/put_online_cpus().
      
      Changes in v5:
       - Use get_online_cpus()/put_online_cpus() for avoiding text_mutex
         deadlock.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133407.6725.81992.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      afd66255
    • M
      kprobes: Introduce generic insn_slot framework · 4610ee1d
      Masami Hiramatsu 提交于
      Make insn_slot framework support various size slots.
      Current insn_slot just supports one-size instruction buffer
      slot. However, kprobes jump optimization needs larger size
      buffers.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133358.6725.82430.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      4610ee1d
    • M
      kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE · d498f763
      Masami Hiramatsu 提交于
      Change RELATIVEJUMP_INSTRUCTION macro to RELATIVEJUMP_OPCODE
      since it represents just the opcode byte.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Acked-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Anders Kaseorg <andersk@ksplice.com>
      Cc: Tim Abbott <tabbott@ksplice.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      LKML-Reference: <20100225133349.6725.99302.stgit@localhost6.localdomain6>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d498f763
    • A
      perf annotate: Defer allocating sym_priv->hist array · 628ada0c
      Arnaldo Carvalho de Melo 提交于
      Because symbol->end is not fixed up at symbol_filter time, only
      after all symbols for a DSO are loaded, and that, for asm
      symbols, may be bogus, causing segfaults when hits happen in
      these symbols.
      Reported-by: NDavid Miller <davem@davemloft.net>
      Reported-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NDavid Miller <davem@davemloft.net>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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>
      Cc: <stable@kernel.org> # for .33.x. Does not apply cleanly, needs backport.
      LKML-Reference: <20100225155740.GB8553@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      628ada0c
  2. 25 2月, 2010 8 次提交
    • A
      perf symbols: Improve debugging information about symtab origins · 3846df2e
      Arnaldo Carvalho de Melo 提交于
      Be more clear about DSO long names and tell from which file
      kernel symbols were obtained, all in --verbose mode:
      
          [root@mica ~]# perf report -v > /dev/null
          Looking at the vmlinux_path (5 entries long)
          Using /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux for symbols
          [root@mica ~]# mv /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux /tmp/dd
          [root@mica ~]# perf report -v > /dev/null
          Looking at the vmlinux_path (5 entries long)
          Using /proc/kallsyms for symbols
          [root@mica ~]#
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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: <1266866139-6361-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3846df2e
    • A
      perf top: Use a macro instead of a constant variable · c7ad21af
      Arnaldo Carvalho de Melo 提交于
      To overcome a silly gcc warning:
      
       cc1: warnings being treated as errors
       builtin-top.c: In function ‘lookup_sym_source’:
       builtin-top.c:291: warning: not protecting local variables:
       variable length buffer make: *** [builtin-top.o] Error 1
       make: *** Waiting for unfinished jobs....
      
      That is emitted for this:
      
      	const size_t pattern_len = BITS_PER_LONG / 4 + 2;
      	char pattern[pattern_len + 1];
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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: <1266866062-6287-1-git-send-email-acme@infradead.org>
      [ -v2: macroify the naming style ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c7ad21af
    • Z
      perf symbols: Check the right return variable · 37fe5fcb
      Zhang, Yanmin 提交于
      In function dso__split_kallsyms(), curr_map saves the return value
      of map__new2. So check it instead of var map after the call returns.
      Signed-off-by: NZhang Yanmin <yanmin_zhang@linux.intel.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org> # for .33.x
      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>
      LKML-Reference: <1267066851.1726.9.camel@localhost>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      37fe5fcb
    • F
      perf/scripts: Tag syscall_name helper as not yet available · c2fbaa4b
      Frederic Weisbecker 提交于
      syscall_name() helper, which resolves a syscall arch number to
      its name, is not yet available as we first need to implement
      event injection for it to work.
      
      Remove it from the documentation or tag its references as
      unavailable yet. Once it's implemented, we can just revert
      the current patch.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      c2fbaa4b
    • T
      perf/scripts: Add perf-trace-python Documentation · cff68e58
      Tom Zanussi 提交于
      Also small update to perf-trace-perl and perf-trace docs.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-13-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      cff68e58
    • T
      perf/scripts: Remove unnecessary PyTuple resizes · 44ad9cd8
      Tom Zanussi 提交于
      If we know the size of a tuple in advance, there's no need to resize
      it - start out with the known size in the first place.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1266822779.6426.4.camel@tropicana>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      44ad9cd8
    • T
      perf/scripts: Add syscall tracing scripts · 4d161f03
      Tom Zanussi 提交于
      Adds a set of scripts that aggregate system call totals and system
      call errors.  Most are Python scripts that also test basic
      functionality of the new Python engine, but there's also one Perl
      script added for comparison and for reference in some new
      Documentation contained in a later patch.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-8-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      4d161f03
    • T
      perf/scripts: Add Python scripting engine · 7e4b21b8
      Tom Zanussi 提交于
      Add base support for Python scripting to perf trace.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-6-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      7e4b21b8
  3. 24 2月, 2010 5 次提交
    • T
      perf/scripts: Remove check-perf-trace from listed scripts · 266fe2f2
      Tom Zanussi 提交于
      The check-perf-trace script only checks Perl functionality, and
      doesn't really need to be listed as as user script anyway.
      
      This only removes the '-report' shell script, so although it doesn't
      appear in the listing, the '-record' shell script and the check perf
      trace perl script itself is still available and can still be run
      manually as such:
      
      $ libexec/perf-core/scripts/perl/bin/check-perf-trace-record
      $ perf trace -s libexec/perf-core/scripts/perl/check-perf-trace.pl
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-6-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      266fe2f2
    • T
      perf/scripts: Move Perl scripting files to scripting-engines dir · 82d156cd
      Tom Zanussi 提交于
      Create a scripting-engines directory to contain scripting engine
      implementation code, in anticipation of the addition of new scripting
      support.  Also removes trace-event-perl.h.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-5-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      82d156cd
    • T
      perf/scripts: Move common code out of Perl-specific files · 7397d80d
      Tom Zanussi 提交于
      This stuff is needed by all scripting engines; move it from the Perl
      engine source to a more common place.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-4-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      7397d80d
    • T
      perf/scripts: Fix bug in Util.pm · e26207a3
      Tom Zanussi 提交于
      Fix bogus calculation.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-3-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      e26207a3
    • T
      perf/scripts: Fix supported language listing option · f526d68b
      Tom Zanussi 提交于
      'perf trace -s list' prints a list of the supported scripting
      languages.  One problem with it is that it falls through and prints
      the trace as well.  The use of 'list' for this also makes it easy to
      confuse with 'perf trace -l', used for listing available scripts.  So
      change 'perf trace -s list' to 'perf trace -s lang' and fixes the
      fall-through problem.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Keiichi KII <k-keiichi@bx.jp.nec.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1264580883-15324-2-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      f526d68b
  4. 22 2月, 2010 2 次提交
  5. 08 2月, 2010 4 次提交
    • A
      perf record: Fix existing process callgraph symbol · f7e7ee36
      austin_zhang@linux.intel.com 提交于
      When 'perf record -g' a existing process, even with debuginfo
      packages, still cannnot get symbol from 'perf report'.
      
      try:
      
       perf record -g -p `pidof xxx` -f
       perf report
      
          68.26%    :1181           b74870f2  [.] 0x000000b74870f2
                    |
                    |--32.09%-- 0xb73b5b44
                    |          0xb7487102
                    |          0xb748a4e2
                    |          0xb748633d
                    |          0xb73b41cd
                    |          0xb73b4467
                    |          0xb747d531
      
      The reason is: for existing process, in __cmd_record(),
      the pid is 0 rather than the existing process id.
      Signed-off-by: NAustin Zhang <austin_zhang@linux.intel.com>
      Acked-by: NPeter 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>
      LKML-Reference: <4710.10.255.24.35.1265389362.squirrel@linux.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f7e7ee36
    • M
      x86/alternatives: Fix build warning · 076dc4a6
      Masami Hiramatsu 提交于
      Fixes these warnings:
      
       arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
       arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
       arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
       arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
       arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
      
      Caused by:
      
        2cfa1978: ftrace/alternatives: Introducing *_text_reserved functions
      
      Changes in v2:
        - Use local variables to compare, instead of type casts.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      LKML-Reference: <20100205171647.15750.37221.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      076dc4a6
    • A
      perf top: Use address pattern in lookup_sym_source · 5f485364
      Arnaldo Carvalho de Melo 提交于
      Because we may have aliases, like __GI___strcoll_l in
      /lib64/libc-2.10.2.so that appears in objdump as:
      
      $ objdump --start-address=0x0000003715a86420 \
                 --stop-address=0x0000003715a872dc -dS /lib64/libc-2.10.2.so
      
      0000003715a86420 <__strcoll_l>:
        3715a86420:	55                   	push   %rbp
        3715a86421:	48 89 e5             	mov    %rsp,%rbp
        3715a86424:	41 57                	push   %r15
      [root@doppio linux-2.6-tip]#
      
      So look for the address exactly at the start of the line instead
      so that annotation can work for in these cases.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Kirill Smelkov <kirr@landau.phys.spbu.ru>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1265550376-12665-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5f485364
    • K
      perf top: Fix annotate for userspace · ee11b90b
      Kirill Smelkov 提交于
      First, for programs and prelinked libraries, annotate code was
      fooled by objdump output IPs (src->eip in the code) being
      wrongly converted to absolute IPs. In such case there were no
      conversion needed, but in
      
         src->eip = strtoull(src->line, NULL, 16);
         src->eip = map->unmap_ip(map, src->eip); // = eip + map->start - map->pgoff
      
      we were reading absolute address from objdump (e.g. 8048604) and
      then almost doubling it, because eip & map->start are
      approximately close for small programs.
      
      Needless to say, that later, in record_precise_ip() there was no
      matching with real runtime IPs.
      
      And second, like with `perf annotate` the problem with
      non-prelinked *.so was that we were doing rip -> objdump address
      conversion wrong.
      
      Also, because unlike `perf annotate`, `perf top` code does
      annotation based on absolute IPs for performance reasons(*), new
      helper for mapping objdump addresse to IP is introduced.
      
      (*) we get samples info in absolute IPs, and since we do lots of
          hit-testing on absolute IPs at runtime in record_precise_ip(), it's
          better to convert objdump addresses to IPs once and do no conversion
          at runtime.
      
      I also had to fix how objdump output is parsed (with hardcoded
      8/16 characters format, which was inappropriate for ET_DYN dsos
      with small addresses like '4ac')
      
      Also note, that not all objdump output lines has associtated
      IPs, e.g. look at source lines here:
      
          000004ac <my_strlen>:
          extern "C"
          int my_strlen(const char *s)
           4ac:   55                      push   %ebp
           4ad:   89 e5                   mov    %esp,%ebp
           4af:   83 ec 10                sub    $0x10,%esp
          {
              int len = 0;
           4b2:   c7 45 fc 00 00 00 00    movl   $0x0,-0x4(%ebp)
           4b9:   eb 08                   jmp    4c3 <my_strlen+0x17>
      
              while (*s) {
                  ++len;
           4bb:   83 45 fc 01             addl   $0x1,-0x4(%ebp)
                  ++s;
           4bf:   83 45 08 01             addl   $0x1,0x8(%ebp)
      
      So we mark them with eip=0, and ignore such lines in annotate
      lookup code.
      Signed-off-by: NKirill Smelkov <kirr@landau.phys.spbu.ru>
      [ Note: one hunk of this patch was applied by Mike in 57d81889 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1265550376-12665-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ee11b90b
  6. 05 2月, 2010 1 次提交
    • M
      kprobes: Add mcount to the kprobes blacklist · 5ecaafdb
      Masami Hiramatsu 提交于
      Since mcount function can be called from everywhere,
      it should be blacklisted. Moreover, the "mcount" symbol
      is a special symbol name. So, it is better to put it in
      the generic blacklist.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: systemtap <systemtap@sources.redhat.com>
      Cc: DLE <dle-develop@lists.sourceforge.net>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20100205062433.3745.36726.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5ecaafdb
  7. 04 2月, 2010 7 次提交