1. 30 12月, 2010 1 次提交
  2. 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
  3. 26 12月, 2010 1 次提交
    • A
      perf script: Fix event ordering settings to work with older kernels · ce0ac9e1
      Arnaldo Carvalho de Melo 提交于
      If we don't use .ordering_requires_timestamps we'll end up trying to order
      events with no timestamps when running on older kernels.
      
      Problem introduced in eac23d1c.
      
      After the last three fixes, perf scripting is back working, tested with
      new perf userspace on old and new (with sample_id_all) kernels.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ian Munsie <imunsie@au1.ibm.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: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Torok Edwin <edwintorok@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ce0ac9e1
  4. 25 12月, 2010 2 次提交
    • A
      perf record: Fix use of sample_id_all userspace with !sample_id_all kernels · a43d3f08
      Arnaldo Carvalho de Melo 提交于
      Check if parse_single_tracepoint_event has already asked for PERF_SAMPLE_TIME.
      
      This is kludgy but short term fix for problems introduced by eac23d1c that
      broke 'perf script' by having different sample_types when using multiple
      tracepoint events when we use a perf binary that tries to use sample_id_all on
      an older kernel.
      
      We need to move counter creation to perf_session, support different
      sample_types, etc.
      
      Ongoing work on the perf test infrastructure needs this so that we can create
      counters to monitor threads generating specific events, etc.
      
      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: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Torok Edwin <edwintorok@gmail.com>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a43d3f08
    • A
      perf script: Finish the rename from trace to script · 765532c8
      Arnaldo Carvalho de Melo 提交于
      The scripts have calls to 'perf trace' that need to be converted to 'perf script', do it.
      
      This problem was introduced in 133dc4c3.
      Reported-by: NTorok Edwin <edwintorok@gmail.com>
      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: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Torok Edwin <edwintorok@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      765532c8
  5. 23 12月, 2010 6 次提交
    • I
      Merge branch 'perf/core' of... · 104db7ff
      Ingo Molnar 提交于
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
      104db7ff
    • F
      perf probe: Fix wrong warning in __show_one_line() if read(1) errors happen · 32b2b6ec
      Franck Bui-Huu 提交于
      This was introduced by commit fde52dbd.
      
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <m3y67hsr0m.fsf@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      32b2b6ec
    • A
      perf test: Look forward for symbol aliases · d3678758
      Arnaldo Carvalho de Melo 提交于
      Not just before, fixing these false positives:
      
      [acme@mica linux]$ perf test -v 1
       1: vmlinux symtab matches kallsyms:
      --- start ---
      Looking at the vmlinux_path (6 entries long)
      Using //lib/modules/2.6.37-rc5-00180-ge06b6bf/build/vmlinux for symbols
      0xffffffff81058dc0: diff name v: sys_vm86old k: sys_ni_syscall
      0xffffffff81058dc0: diff name v: sys_vm86 k: sys_ni_syscall
      0xffffffff81058dc0: diff name v: sys_subpage_prot k: sys_ni_syscall
      0xffffffff810b5f7c: diff name v: probe_kernel_write k: __probe_kernel_write
      0xffffffff810b5fe5: diff name v: probe_kernel_read k: __probe_kernel_read
      0xffffffff811bc380: diff name v: __memset k: memset
      0xffffffff81384a98: diff name v: __sched_text_start k: sleep_on_common
      0xffffffff81386750: diff name v: __sched_text_end k: _raw_spin_trylock
      0xffffffff8138cee8: diff name v: __irqentry_text_start k: do_IRQ
      0xffffffff8138f079: diff name v: __start_notes k: _etext
      0xffffffff8138f079: diff name v: __stop_notes k: _etext
      ---- end ----
      vmlinux symtab matches kallsyms: FAILED!
      
      [acme@mica linux]$
      
      Some are weak functions, others are just markers, etc. They get in the rb tree
      with the same addr, so we need to look around to find the symbol with the same
      name.
      
      We were looking just at the previous entries with the same addr, look forward
      too.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Han Pingtian <phan@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3678758
    • A
      perf symbols: Improve kallsyms symbol end addr calculation · 3b01a413
      Arnaldo Carvalho de Melo 提交于
      For kallsyms we don't have the symbol address end, so we do an extra pass and
      set the symbol end addr as being the start of the next minus one.
      
      But this was being done just after we filtered the symbols of a
      particular type (functions, variables), so the symbol end was sometimes
      after what it really is.
      
      Fixing up symbol end also was falling apart when we have symbol aliases,
      then the end address of all but the last alias was being set to be
      before its start.
      
      Fix it up by checking for symbol aliases and making the kallsyms__parse
      routine use the next symbol, whatever its type, as the limit for the
      previous symbol, passing that end address to the callback.
      
      This was detected by the 'perf test' synthetic paranoid regression
      tests, fix it up so that even that case doesn't mislead us.
      
      Cc: Frederic 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: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3b01a413
    • D
      x86, nmi_watchdog: Remove ARCH_HAS_NMI_WATCHDOG and rely on CONFIG_HARDLOCKUP_DETECTOR · 4a7863cc
      Don Zickus 提交于
      The x86 arch has shifted its use of the nmi_watchdog from a
      local implementation to the global one provide by
      kernel/watchdog.c.  This shift has caused a whole bunch of
      compile problems under different config options.  I attempt to
      simplify things with the patch below.
      
      In order to simplify things, I had to come to terms with the
      meaning of two terms ARCH_HAS_NMI_WATCHDOG and
      CONFIG_HARDLOCKUP_DETECTOR.  Basically they mean the same thing,
      the former on a local level and the latter on a global level.
      
      With the old x86 nmi watchdog gone, there is no need to rely on
      defining the ARCH_HAS_NMI_WATCHDOG variable because it doesn't
      make sense any more.  x86 will now use the global
      implementation.
      
      The changes below do a few things.  First it changes the few
      places that relied on ARCH_HAS_NMI_WATCHDOG to use
      CONFIG_X86_LOCAL_APIC (the former was an alias for the latter
      anyway, so nothing unusual here).  Those pieces of code were
      relying more on local apic functionality the nmi watchdog
      functionality, so the change should make sense.
      
      Second, I removed the x86 implementation of
      touch_nmi_watchdog().  It isn't need now, instead x86 will rely
      on kernel/watchdog.c's implementation.
      
      Third, I removed the #define ARCH_HAS_NMI_WATCHDOG itself from
      x86.  And tweaked the include/linux/nmi.h file to tell users to
      look for an externally defined touch_nmi_watchdog in the case of
      ARCH_HAS_NMI_WATCHDOG _or_ CONFIG_HARDLOCKUP_DETECTOR. This
      changes removes some of the ugliness in that file.
      
      Finally, I added a Kconfig dependency for
      CONFIG_HARDLOCKUP_DETECTOR that said you can't have
      ARCH_HAS_NMI_WATCHDOG _and_ CONFIG_HARDLOCKUP_DETECTOR.  You can
      only have one nmi_watchdog.
      
      Tested with
      ARCH=i386: allnoconfig, defconfig, allyesconfig, (various broken
      configs) ARCH=x86_64: allnoconfig, defconfig, allyesconfig,
      (various broken configs)
      
      Hopefully, after this patch I won't get any more compile broken
      emails. :-)
      
      v3:
        changed a couple of 'linux/nmi.h' -> 'asm/nmi.h' to pick-up correct function
        prototypes when CONFIG_HARDLOCKUP_DETECTOR is not set.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: fweisbec@gmail.com
      LKML-Reference: <1293044403-14117-1-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4a7863cc
    • I
      Merge branch 'tip/perf/core' of... · 9fb67204
      Ingo Molnar 提交于
      Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
      9fb67204
  6. 22 12月, 2010 13 次提交
    • I
      Merge branch 'perf/core' of... · 8c1df400
      Ingo Molnar 提交于
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
      8c1df400
    • I
      Merge commit 'v2.6.37-rc7' into perf/core · 6c529a26
      Ingo Molnar 提交于
      Merge reason: Pick up the latest -rc.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6c529a26
    • L
      Linux 2.6.37-rc7 · 90a8a73c
      Linus Torvalds 提交于
      90a8a73c
    • F
      perf probe: Handle gracefully some stupid and buggy line syntaxes · 21dd9ae5
      Franck Bui-Huu 提交于
      Currently perf probe doesn't handle those incorrect syntaxes:
      
         $ perf probe -L sched.c:++13
         $ perf probe -L sched.c:-+13
         $ perf probe -L sched.c:10000000000000000000000000000+13
      
      This patches rewrites parse_line_range_desc() to handle them.
      
      As a bonus, it reports more useful error messages instead of: "Tailing
      with invalid character...".
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-7-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      21dd9ae5
    • F
      perf probe: Don't always consider EOF as an error when listing source code · fde52dbd
      Franck Bui-Huu 提交于
      When listing a whole file or a function which is located at the end,
      perf-probe -L output wrongly: "Source file is shorter than expected.".
      
      This is because show_one_line() always consider EOF as an error.
      
      This patch fixes this by not considering EOF as an error when dumping
      the trailing lines. Otherwise it's still an error and perf-probe still
      outputs its warning.
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-6-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fde52dbd
    • F
      perf probe: Fix line range description since a single file is allowed · 9d95b580
      Franck Bui-Huu 提交于
      	$ perf-probe -L sched.c
      
      is currently allowed but not documented.
      
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-5-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9d95b580
    • F
      perf probe: Clean up redundant tests in show_line_range() · 44b81e92
      Franck Bui-Huu 提交于
      It also removes some superflous parentheses.
      
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-4-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      44b81e92
    • F
      perf probe: Rewrite show_one_line() to make it simpler · befe3414
      Franck Bui-Huu 提交于
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-3-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      befe3414
    • F
      perf probe: Make -L display the absolute path of the dumped file · 62c15fc4
      Franck Bui-Huu 提交于
      The actual file used by 'perf probe -L sched.c' is reported in the ouput
      of the command.
      
      But it's simply displayed as it has been given to the command (simply
      sched.c) which is too ambiguous to be really usefull since several
      sched.c files can be found into the same project and we also don't know
      which search path has been used.
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      LKML-Reference: <1292854685-8230-2-git-send-email-fbuihuu@gmail.com>
      Signed-off-by: NFranck Bui-Huu <fbuihuu@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      62c15fc4
    • M
      perf probe: Cleanup messages · 0e43e5d2
      Masami Hiramatsu 提交于
      Add new lines for error or debug messages, change dwarf related words to more
      generic words (or just removed).
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      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: <20101217131211.24123.40437.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>
      0e43e5d2
    • D
      perf symbols: Add symfs option for off-box analysis using specified tree · ec5761ea
      David Ahern 提交于
      The symfs argument allows analysis of perf.data file using a locally accessible
      filesystem tree with debug symbols - e.g., tree created during image builds,
      sshfs mount, loop mounted KVM disk images, USB keys, initrds, etc. Anything
      with an OS tree can be analyzed from anywhere without the need to populate a
      local data store with build-ids.
      
      Commiter notes:
      
      o Fixed up symfs="/" variants handling.
      
      o prefixed DSO__ORIG_GUEST_KMODULE case with symfs too, avoiding use of files
        outside the symfs directory.
      
      LKML-Reference: <1291926427-28846-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec5761ea
    • I
      perf record,report,annotate,diff: Process events in order · eac23d1c
      Ian Munsie 提交于
      This patch changes perf report to ask for the ID info on all events be
      default if recording from multiple CPUs.
      
      Perf report, annotate and diff will now process the events in order if
      the kernel is able to provide timestamps on all events. This ensures
      that events such as COMM and MMAP which are necessary to correctly
      interpret samples are processed prior to those samples so that they are
      attributed correctly.
      
      Before:
       # perf record ./cachetest
       # perf report
      
       # Events: 6K cycles
       #
       # Overhead  Command      Shared Object                           Symbol
       # ........  .......  .................  ...............................
       #
           74.11%    :3259  [unknown]          [k] 0x4a6c
            1.50%  cachetest  ld-2.11.2.so       [.] 0x1777c
            1.46%    :3259  [kernel.kallsyms]  [k] .perf_event_mmap_ctx
            1.25%    :3259  [kernel.kallsyms]  [k] restore
            0.74%    :3259  [kernel.kallsyms]  [k] ._raw_spin_lock
            0.71%    :3259  [kernel.kallsyms]  [k] .filemap_fault
            0.66%    :3259  [kernel.kallsyms]  [k] .memset
            0.54%  cachetest  [kernel.kallsyms]  [k] .sha_transform
            0.54%    :3259  [kernel.kallsyms]  [k] .copy_4K_page
            0.54%    :3259  [kernel.kallsyms]  [k] .find_get_page
            0.52%    :3259  [kernel.kallsyms]  [k] .trace_hardirqs_off
            0.50%    :3259  [kernel.kallsyms]  [k] .__do_fault
      <SNIP>
      
      After:
       # perf report
      
       # Events: 6K cycles
       #
       # Overhead  Command      Shared Object                           Symbol
       # ........  .......  .................  ...............................
       #
           44.28%  cachetest  cachetest          [.] sumArrayNaive
           22.53%  cachetest  cachetest          [.] sumArrayOptimal
            6.59%  cachetest  ld-2.11.2.so       [.] 0x1777c
            2.13%  cachetest  [unknown]          [k] 0x340
            1.46%  cachetest  [kernel.kallsyms]  [k] .perf_event_mmap_ctx
            1.25%  cachetest  [kernel.kallsyms]  [k] restore
            0.74%  cachetest  [kernel.kallsyms]  [k] ._raw_spin_lock
            0.71%  cachetest  [kernel.kallsyms]  [k] .filemap_fault
            0.66%  cachetest  [kernel.kallsyms]  [k] .memset
            0.54%  cachetest  [kernel.kallsyms]  [k] .copy_4K_page
            0.54%  cachetest  [kernel.kallsyms]  [k] .find_get_page
            0.54%  cachetest  [kernel.kallsyms]  [k] .sha_transform
            0.52%  cachetest  [kernel.kallsyms]  [k] .trace_hardirqs_off
            0.50%  cachetest  [kernel.kallsyms]  [k] .__do_fault
      <SNIP>
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1291872833-839-1-git-send-email-imunsie@au1.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eac23d1c
    • I
      perf session: Fallback to unordered processing if no sample_id_all · 21ef97f0
      Ian Munsie 提交于
      If we are running the new perf on an old kernel without support for
      sample_id_all, we should fall back to the old unordered processing of
      events. If we didn't than we would *always* process events without
      timestamps out of order, whether or not we hit a reordering race. In
      other words, instead of there being a chance of not attributing samples
      correctly, we would guarantee that samples would not be attributed.
      
      While processing all events without timestamps before events with
      timestamps may seem like an intuitive solution, it falls down as
      PERF_RECORD_EXIT events would also be processed before any samples.
      Even with a workaround for that case, samples before/after an exec would
      not be attributed correctly.
      
      This patch allows commands to indicate whether they need to fall back to
      unordered processing, so that commands that do not care about timestamps
      on every event will not be affected. If we do fallback, this will print
      out a warning if report -D was invoked.
      
      This patch adds the test in perf_session__new so that we only need to
      test once per session. Commands that do not use an event_ops (such as
      record and top) can simply pass NULL in it's place.
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1291951882-sup-6069@au1.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      21ef97f0
  7. 21 12月, 2010 13 次提交
  8. 20 12月, 2010 3 次提交