1. 11 Dec, 2009 4 commits
    • Frederic Weisbecker's avatar
      hw-breakpoints: Handle bad modify_user_hw_breakpoint off-case return value · 99ac64c8
      Frederic Weisbecker authored
      While converting modify_user_hw_breakpoint() return value, we
      forgot to handle the off-case. It's not returning a pointer
      anymore.
      
      This solves the build warning reported by Stephen Rothwell against
      linux-next.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1260529122-6260-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      99ac64c8
    • Jamie Iles's avatar
      perf tools: Allow cross compiling · cc835752
      Jamie Iles authored
      For embedded platforms, we want to be able to build the perf
      tools on a build machine to run on a different arch. This patch
      allows $CROSS_COMPILE to set the cross compiler.
      
      Additionally, if NO_LIBPERL is set, then don't use perl include
      paths as they will be for the host arch.
      Signed-off-by: default avatarJamie Iles <jamie.iles@picochip.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1260523260-15694-2-git-send-email-jamie.iles@picochip.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      cc835752
    • Li Zefan's avatar
      tracing, slab: Fix no callsite ifndef CONFIG_KMEMTRACE · 0bb38a5c
      Li Zefan authored
      For slab, if CONFIG_KMEMTRACE and CONFIG_DEBUG_SLAB are not set,
      __do_kmalloc() will not track callers:
      
       # ./perf record -f -a -R -e kmem:kmalloc
       ^C
       # ./perf trace
       ...
                perf-2204  [000]   147.376774: kmalloc: call_site=c0529d2d ...
                perf-2204  [000]   147.400997: kmalloc: call_site=c0529d2d ...
                Xorg-1461  [001]   147.405413: kmalloc: call_site=0 ...
                Xorg-1461  [001]   147.405609: kmalloc: call_site=0 ...
             konsole-1776  [001]   147.405786: kmalloc: call_site=0 ...
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Reviewed-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-mm@kvack.org <linux-mm@kvack.org>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      LKML-Reference: <4B21F8AE.6020804@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0bb38a5c
    • Li Zefan's avatar
      tracing, slab: Define kmem_cache_alloc_notrace ifdef CONFIG_TRACING · 0f24f128
      Li Zefan authored
      Define kmem_trace_alloc_{,node}_notrace() if CONFIG_TRACING is
      enabled, otherwise perf-kmem will show wrong stats ifndef
      CONFIG_KMEM_TRACE, because a kmalloc() memory allocation may
      be traced by both trace_kmalloc() and trace_kmem_cache_alloc().
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Reviewed-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-mm@kvack.org <linux-mm@kvack.org>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      LKML-Reference: <4B21F89A.7000801@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0f24f128
  2. 10 Dec, 2009 11 commits
  3. 09 Dec, 2009 14 commits
    • Xiao Guangrong's avatar
      perf sched: Fix for getting task's execution time · c0c9e721
      Xiao Guangrong authored
      In current code, task's execute time is got by reading
      '/proc/<pid>/sched' file, it's wrong if the task is created
      by pthread_create(), because every thread task has same pid.
      
      This way also has two demerits:
      
       1: 'perf sched replay' can't work if the kernel is not
          compiled with the 'CONFIG_SCHED_DEBUG' option
      
       2: perf tool should depend on proc file system
      
      So, this patch uses PERF_COUNT_SW_TASK_CLOCK to get task's
      execution time instead of reading /proc file.
      
      Changelog v2 -> v3:
      use PERF_COUNT_SW_TASK_CLOCK instead of rusage() as Ingo's
      suggestion
      Reported-by: default avatarTorok Edwin <edwintorok@gmail.com>
      Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Xiao Guangrong <ericxiao.gr@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F7322.80103@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c0c9e721
    • Frederic Weisbecker's avatar
      tracing/kprobes: Fix field creation's bad error handling · 822a6961
      Frederic Weisbecker authored
      When we define the common event fields in kprobe, we invert the error
      handling and return immediately in case of success. Then we omit
      to define specific kprobes fields (ip and nargs), and specific
      kretprobes fields (func, ret_ip, nargs). And we only define them
      when we fail to create common fields.
      
      The most visible consequence is that we can't create filter for
      k(ret)probes specific fields.
      
      This patch re-invert the success/error handling to fix it.
      Reported-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <1260263815-5167-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      822a6961
    • Xiao Guangrong's avatar
      perf_event: Cleanup for cpu_clock_perf_event_update() · ec89a06f
      Xiao Guangrong authored
      Using atomic64_xchg() instead of atomic64_read() and
      atomic64_set().
      Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F19DC.90204@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ec89a06f
    • Xiao Guangrong's avatar
      perf_event: Allocate children's perf_event_ctxp at the right time · b93f7978
      Xiao Guangrong authored
      In current code, children task will allocate memory for
      'child->perf_event_ctxp' if the parent is counted, we can
      do it only if the parent allowed children inherit it.
      
      It can save memory and reduce overhead.
      Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F19A8.5040805@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b93f7978
    • Xiao Guangrong's avatar
      perf_event: Clean up __perf_event_init_context() · aa5452d7
      Xiao Guangrong authored
      Clean up the code a bit:
      
       - define 'perf_cpu_context' variable with 'static'
       - use kzalloc() instead of kmalloc() and memset()
      Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Reviewed-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F194D.7080306@cn.fujitsu.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      aa5452d7
    • Frederic Weisbecker's avatar
      hw-breakpoints: Modify breakpoints without unregistering them · 44234adc
      Frederic Weisbecker authored
      Currently, when ptrace needs to modify a breakpoint, like disabling
      it, changing its address, type or len, it calls
      modify_user_hw_breakpoint(). This latter will perform the heavy and
      racy task of unregistering the old breakpoint and registering a new
      one.
      
      This is racy as someone else might steal the reserved breakpoint
      slot under us, which is undesired as the breakpoint is only
      supposed to be modified, sometimes in the middle of a debugging
      workflow. We don't want our slot to be stolen in the middle.
      
      So instead of unregistering/registering the breakpoint, just
      disable it while we modify its breakpoint fields and re-enable it
      after if necessary.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prasad <prasad@linux.vnet.ibm.com>
      LKML-Reference: <1260347148-5519-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      44234adc
    • Masami Hiramatsu's avatar
      perf probe: Update perf-probe document · c937fe20
      Masami Hiramatsu authored
      Add --list and --del option descriptions to perf-probe.txt.
      Signed-off-by: default avatarMasami 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>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20091208220330.10142.73296.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c937fe20
    • Masami Hiramatsu's avatar
      perf probe: Support --del option · fa28244d
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarIngo Molnar <mingo@elte.hu>
      fa28244d
    • Masami Hiramatsu's avatar
      trace-kprobe: Support delete probe syntax · a7c312be
      Masami Hiramatsu authored
      Support delete probe syntax. The syntax is "-:[group/]event".
      Signed-off-by: default avatarMasami 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: <20091208220316.10142.39192.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      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>
      a7c312be
    • Masami Hiramatsu's avatar
      perf probe: Support vmlinux on cwd by default · f984f03d
      Masami Hiramatsu authored
      Support vmlinux on current working direcotry by default and
      also update file-open messages.
      Now perf probe searches ./vmlinux too.
      Signed-off-by: default avatarMasami 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: <20091208220309.10142.33040.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f984f03d
    • Masami Hiramatsu's avatar
      perf probe: Remove event suffix number _0 · 17f88fcd
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarIngo Molnar <mingo@elte.hu>
      17f88fcd
    • Masami Hiramatsu's avatar
      perf probe: Fix add-probe command syntax without --add option · d1bde3f7
      Masami Hiramatsu authored
      Fix add-probe command syntax without --add option.
      perf-probe supports add-probe command without --add
      option. But it treats each argument as an event definition.
      e.g.
      
      perf probe func arg1 arg2
      
       is interpreted as
      
      perf probe --add func --add arg1 --add arg2
      
      But it may be useless in many cases.
      
      This patch fixes this syntax to fold those arguments into
      one event definition if there is no --add option. With this
      change, above command is interpreted as below;
      
      perf probe --add "func arg1 arg2"
      Signed-off-by: default avatarMasami 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: <20091208220254.10142.73767.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d1bde3f7
    • Masami Hiramatsu's avatar
      perf probe: Change probe-added message more user-friendly · a9b495b0
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarIngo Molnar <mingo@elte.hu>
      a9b495b0
    • Masami Hiramatsu's avatar
      perf probe: Change event list format · 278498d4
      Masami Hiramatsu authored
      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: default avatarMasami 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: default avatarIngo Molnar <mingo@elte.hu>
      278498d4
  4. 08 Dec, 2009 2 commits
  5. 07 Dec, 2009 9 commits