1. 01 3月, 2012 1 次提交
  2. 31 1月, 2012 1 次提交
    • D
      perf tools: Fix broken build by defining _GNU_SOURCE in Makefile · 0a84f007
      David Daney 提交于
      When building on my Debian/mips system, util/util.c fails to build
      because commit 1aed2671 (perf kvm: Do
      guest-only counting by default) indirectly includes stdio.h before the
      feature selection in util.h is done.  This prevents _GNU_SOURCE in
      util.h from enabling the declaration of getline(), from now second
      inclusion of stdio.h, and the build is broken.
      
      There is another breakage in util/evsel.c caused by include ordering,
      but I didn't fully track down the commit that caused it.
      
      The root cause of all this is an inconsistent definition of _GNU_SOURCE,
      so I move the definition into the Makefile so that it is passed to all
      invocations of the compiler and used uniformly for all system header
      files.  All other #define and #undef of _GNU_SOURCE are removed as they
      cause conflicts with the definition passed to the compiler.
      
      All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
      and _GNU_SOURCE) are needed by the python glue code too, so they are
      moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS
      are removed.
      
      This gives me a clean build on x86_64 (fc12) and mips (Debian).
      
      Cc: David Daney <david.daney@cavium.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1326836461-11952-1-git-send-email-ddaney.cavm@gmail.comSigned-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a84f007
  3. 11 10月, 2011 1 次提交
  4. 08 8月, 2011 1 次提交
  5. 16 7月, 2011 3 次提交
  6. 06 4月, 2011 2 次提交
  7. 22 2月, 2011 2 次提交
    • A
      perf probe: Remove redundant checks · 8635bf6e
      Arnaldo Carvalho de Melo 提交于
      While fixing an error propagating problem in f809b25 I added two
      redundant checks.
      
      I did that because I didn't expect the checks to be on the while and for
      loop condition expression, where they are tested before we run the loop,
      where the 'ret' variable is set.
      
      So remove it from there and leave it just after it is actually set,
      eliminating unneded tests.
      Reported-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8635bf6e
    • A
      perf probe: Fix error propagation leading to segfault · fbee632d
      Arnaldo Carvalho de Melo 提交于
      There are two hunks in this patch that stops probe processing as soon as one
      error is found, breaking out of loops, the other fix an error propagation that
      should return a negative error number but instead was returning the result of
      "ret < 0", which is 1 and thus made several error checks fail because they test
      agains < 0.
      
      The problem could be triggered by asking for a variable that was optimized out,
      fact that should stop the whole probe processing but instead was segfaulting
      while installing broken probes:
      
      [root@emilia ~]# probe perf_mmap:55 user_lock_limit
      Failed to find the location of user_lock_limit at this address.
       Perhaps, it has been optimized out.
      Failed to find 'user_lock_limit' in this function.
      Add new events:
        probe:perf_mmap      (on perf_mmap:55 with user_lock_limit)
        probe:perf_mmap_1    (on perf_mmap:55 with user_lock_limit)
      Segmentation fault (core dumped)
      [root@emilia ~]# perf probe -l
        probe:perf_mmap      (on perf_mmap:55@git/linux/kernel/perf_event.c with user_lock_limit)
        probe:perf_mmap_1    (on perf_mmap:55@git/linux/kernel/perf_event.c with user_lock_limit)
      [root@emilia ~]#
      
      After the fix:
      
      [root@emilia ~]# probe perf_mmap:55 user_lock_limit
      Failed to find the location of user_lock_limit at this address.
       Perhaps, it has been optimized out.
      Failed to find 'user_lock_limit' in this function.
        Error: Failed to add events. (-2)
      [root@emilia ~]#
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fbee632d
  8. 17 2月, 2011 2 次提交
    • M
      perf probe: Show filename which contains target function · 8737ebde
      Masami Hiramatsu 提交于
      Show filename which contains a target function with the function name on
      "--lines" mode, because perf-probe just shows the first function even if
      there are many same-name functions.
      
      Originally adopted by Franck Bui-Huu's patch which shows file name
      instead of function name. I've just modified it to show both of function
      name and file name, because of completeness of output.
      
       E.g.)
       $ perf probe -L t_show
       <t_show@/home/mhiramat/ksrc/linux-2.6-tip/kernel/trace/ftrace.c:0>
            0  static int t_show(struct seq_file *m, void *v)
            1  {
            2         struct ftrace_iterator *iter = m->private;
       ...
      
       $ perf probe -L t_show@trace/trace.c
       <t_show@/home/mhiramat/ksrc/linux-2.6-tip/kernel/trace/trace.c:0>
            0  static int t_show(struct seq_file *m, void *v)
            1  {
                      struct tracer *t = v;
       ...
      Original-patch-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20110210090816.1809.43426.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8737ebde
    • M
      perf probe: Support function@filename syntax for --line · e116dfa1
      Masami Hiramatsu 提交于
      Since "perf probe --add" supports function@filename syntax, --line
      option should also support it.
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-kernel@vger.kernel.org
      LKML-Reference: <20110210090810.1809.26913.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e116dfa1
  9. 28 1月, 2011 2 次提交
    • M
      perf probe: Add filters support for available functions · 3c42258c
      Masami Hiramatsu 提交于
      Add filters support for available function list.
      
      Default filter is "!_*" for filtering out local-purpose symbols.
      
      e.g.:
       # perf probe --filter="add*" -F
      add_disk
      add_disk_randomness
      add_input_randomness
      add_interrupt_randomness
      add_memory
      add_page_to_unevictable_list
      add_page_wait_queue
      ...
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Chase Douglas <chase.douglas@canonical.com>
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20110120141545.25915.85930.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c42258c
    • M
      perf probe: Add variable filter support · bd09d7b5
      Masami Hiramatsu 提交于
      Add filters support for available variable list.
      
      Default filter is "!__k???tab_*&!__crc_*" for filtering out
      automatically generated symbols.
      
      The format of filter rule is "[!]GLOBPATTERN", so you can use wild
      cards. If the filter rule starts with '!', matched variables are filter
      out.
      
      e.g.:
       # perf probe -V schedule --externs --filter=cpu*
      Available variables at schedule
              @<schedule+0>
                      cpumask_var_t   cpu_callout_mask
                      cpumask_var_t   cpu_core_map
                      cpumask_var_t   cpu_isolated_map
                      cpumask_var_t   cpu_sibling_map
                      int     cpu_number
                      long unsigned int*      cpu_bit_bitmap
      		...
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Chase Douglas <chase.douglas@canonical.com>
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20110120141539.25915.43401.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      [ committer note: Removed the elf.h include as it was fixed up in e80711ca]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bd09d7b5
  10. 24 1月, 2011 1 次提交
    • M
      perf probe: Add --funcs to show available functions in symtab · e80711ca
      Masami Hiramatsu 提交于
      Add --funcs to show available functions in symtab.
      
      Originally this feature came from Srikar's uprobes patches
      ( http://lkml.org/lkml/2010/8/27/244 )
      
      e.g.
      ...
      __ablkcipher_walk_complete
      __absent_pages_in_range
      __account_scheduler_latency
      __add_pages
      __alloc_pages_nodemask
      __alloc_percpu
      __alloc_reserved_percpu
      __alloc_skb
      __alloc_workqueue_key
      __any_online_cpu
      __ata_ehi_push_desc
      ...
      
      This also supports symbols in module, e.g.
      
      ...
      cleanup_module
      cpuid_maxphyaddr
      emulate_clts
      emulate_instruction
      emulate_int_real
      emulate_invlpg
      emulator_get_dr
      emulator_set_dr
      emulator_task_switch
      emulator_write_emulated
      emulator_write_phys
      fx_init
      ...
      
      Original-patch-from: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20110113124611.22426.10835.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      [ committer note: Add missing elf.h for STB_GLOBAL that broke a RHEL4 build ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e80711ca
  11. 23 1月, 2011 1 次提交
    • A
      perf tools: Fix 64 bit integer format strings · 9486aa38
      Arnaldo Carvalho de Melo 提交于
      Using %L[uxd] has issues in some architectures, like on ppc64.  Fix it
      by making our 64 bit integers typedefs of stdint.h types and using
      PRI[ux]64 like, for instance, git does.
      
      Reported by Denis Kirjanov that provided a patch for one case, I went
      and changed all cases.
      Reported-by: NDenis Kirjanov <dkirjanov@kernel.org>
      Tested-by: NDenis Kirjanov <dkirjanov@kernel.org>
      LKML-Reference: <20110120093246.GA8031@hera.kernel.org>
      Cc: Denis Kirjanov <dkirjanov@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Pingtian Han <phan@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9486aa38
  12. 28 12月, 2010 1 次提交
    • F
      perf probe: Fix short file name probe location reporting · 32ae2ade
      Franck Bui-Huu 提交于
      After adding probes, perf-probe(1) reports the probes locations which include
      filenames for certain cases.
      
      But for short file names (whose length < 32), perf-probe didn't display the
      name correctly. It actually skipped the first character.
      
      Here's an example where 'icmp.c' was screwed:
      
         $ perf probe -n -a "icmp.c;sk=*"
         Add new events:
           probe:icmp_push_reply (on @cmp.c)
           probe:icmp_reply     (on @cmp.c)
           probe:icmp_reply_1   (on @cmp.c)
           probe:icmp_send      (on @cmp.c)
           probe:icmp_send_1    (on @cmp.c)
           probe:icmp_error     (on @cmp.c)
           probe:icmp_error_1   (on @cmp.c)
           probe:icmp_error_2   (on @cmp.c)
           probe:icmp_error_3   (on @cmp.c)
      
      This patch fixes this bug in synthesize_perf_probe_point().
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <m31v588r9k.fsf@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      32ae2ade
  13. 23 12月, 2010 1 次提交
  14. 22 12月, 2010 7 次提交
  15. 16 12月, 2010 2 次提交
  16. 22 10月, 2010 4 次提交
    • M
      perf probe: Add basic module support · 469b9b88
      Masami Hiramatsu 提交于
      Add basic module probe support on perf probe. This introduces "--module
      <MODNAME>" option to perf probe for putting probes and showing lines and
      variables in the given module.
      
      Currently, this supports only probing on running modules.  Supporting off-line
      module probing is the next step.
      
      e.g.)
      [show lines]
       # ./perf probe --module drm -L drm_vblank_info
      <drm_vblank_info:0>
            0  int drm_vblank_info(struct seq_file *m, void *data)
            1  {
                      struct drm_info_node *node = (struct drm_info_node *) m->private
            3         struct drm_device *dev = node->minor->dev;
       ...
      [show vars]
       # ./perf probe --module drm -V drm_vblank_info:3
      Available variables at drm_vblank_info:3
              @<drm_vblank_info+20>
                      (unknown_type)  data
                      struct drm_info_node*   node
                      struct seq_file*        m
      [put a probe]
       # ./perf probe --module drm drm_vblank_info:3 node m
      Add new event:
        probe:drm_vblank_info (on drm_vblank_info:3 with node m)
      
      You can now use it on all perf tools, such as:
      
              perf record -e probe:drm_vblank_info -aR sleep 1
      [list probes]
       # ./perf probe -l
      probe:drm_vblank_info (on drm_vblank_info:3@drivers/gpu/drm/drm_info.c with ...
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20101021101341.3542.71638.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      469b9b88
    • M
      perf probe: Show accessible global variables · fb8c5a56
      Masami Hiramatsu 提交于
      Add --externs for allowing --vars to show accessible global (externally
      defined) variables from a given probe point too.
      
      This will give you a hint which globals can be accessible from the probe point.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20101021101335.3542.31003.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fb8c5a56
    • M
      perf probe: Function style fix · c82ec0a2
      Masami Hiramatsu 提交于
      Just change the order of function arguments for ease of read; moving optional
      bool flag to the last.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20101021101329.3542.51200.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c82ec0a2
    • M
      perf probe: Show accessible local variables · cf6eb489
      Masami Hiramatsu 提交于
      Add -V (--vars) option for listing accessible local variables at given probe
      point. This will help finding which local variables are available for event
      arguments.
      
      e.g.)
       # perf probe -V call_timer_fn:23
       Available variables at call_timer_fn:23
               @<run_timer_softirq+345>
                       function_type*  fn
                       int     preempt_count
                       long unsigned int       data
                       struct list_head        work_list
                       struct list_head*       head
                       struct timer_list*      timer
                       struct tvec_base*       base
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20101021101323.3542.40282.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cf6eb489
  17. 08 9月, 2010 1 次提交
  18. 07 8月, 2010 1 次提交
  19. 30 7月, 2010 1 次提交
    • S
      perf probe: Rename common fields/functions from kprobe to probe. · 0e60836b
      Srikar Dronamraju 提交于
      As a precursor for perf to support uprobes, rename fields/functions
      that had kprobe in their name but can be shared across perf-kprobes
      and perf-uprobes to probe.
      
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Naren A Devaiah <naren.devaiah@in.ibm.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20100729141351.GG21723@linux.vnet.ibm.com>
      Signed-off-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0e60836b
  20. 16 7月, 2010 2 次提交
  21. 06 7月, 2010 2 次提交
  22. 28 4月, 2010 1 次提交
    • A
      perf machine: Adopt some map_groups functions · d28c6223
      Arnaldo Carvalho de Melo 提交于
      Those functions operated on members now grouped in 'struct machine', so
      move those methods to this new class.
      
      The changes made to 'perf probe' shows that using this abstraction
      inserting probes on guests almost got supported for free.
      
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d28c6223