1. 29 May, 2010 1 commit
  2. 27 May, 2010 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Fix last use_browser problem related to .perfconfig · c4fe52a8
      Arnaldo Carvalho de Melo authored
      When we moved to using ~/.perfconfig to set the value of use_browser,
      it changed from a boolean to an int so that the convention used for
      use_pager was followed.
      
      That convention is:
      
      -1: unspecified, that is what use_{browser,pager} is initialized
       0: Don't use the browser (should be TUI), because was explicitely
          set to 0/off/false on ~/.perfconfig [tui] cmd =, or because
          we're redirecting the stdout to a file or piping it to some
          other command (!isatty()).
       1: Use the TUI
      
      Some code was not properly audited and continued testing it as a
      boolean, this seems to be the last one.
      Reported-by: default avatarFrédéric Weisbecker <fweisbec@gmail.com>
      Tested-by: default avatarFrédéric Weisbecker <fweisbec@gmail.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c4fe52a8
  3. 26 May, 2010 2 commits
    • Arnaldo Carvalho de Melo's avatar
      perf symbols: Add the build id cache to the vmlinux path · 5ad90e4e
      Arnaldo Carvalho de Melo authored
      So that if the kernel DSO has a build id because record inserted it in
      the perf.data build id table in the header, or a BUILD_ID event was
      inserted in the stream, we first look at the build id cache
      ($HOME/.debug/).
      
      If we find it there, try to use it, allowing offline annotation in
      addition to 'perf report'.
      Reported-by: default avatarStephane Eranian <eranian@google.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5ad90e4e
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Reset use_browser if stdout is not a tty · 62e3436b
      Arnaldo Carvalho de Melo authored
      The newt initialization routines weren't being called because the output
      was a file (perf annotate > /tmp/bla) but use_browser was still 1,
      because ~/.perfconfig had it as 'on', so, later on newt routines
      segfaulted.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      62e3436b
  4. 25 May, 2010 4 commits
    • Steven Rostedt's avatar
      ring-buffer: Move zeroing out excess in page to ring buffer code · 2711ca23
      Steven Rostedt authored
      Currently the trace splice code zeros out the excess bytes in the page before
      sending it off to userspace.
      
      This is to make sure userspace is not getting anything it should not be
      when reading the pages, because the excess data was never initialized
      to zero before writing (for perfomance reasons).
      
      But the splice code has no business in doing this work, it should be
      done by the ring buffer. With the latest changes for recording lost
      events, the splice code gets it wrong anyway.
      
      Move the zeroing out of excess bytes into the ring buffer code.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      2711ca23
    • Steven Rostedt's avatar
      ring-buffer: Reset "real_end" when page is filled · b3230c8b
      Steven Rostedt authored
      The code to store the "lost events" requires knowing the real end
      of the page. Since the 'commit' includes the padding at the end of
      a page a "real_end" variable was used to keep track of the end not
      including the padding.
      
      If events were lost, the reader can place the count of events in
      the padded area if there is enough room.
      
      The bug this patch fixes is that when we fill the page we do not
      reset the real_end variable, and if the writer had wrapped a few
      times, the real_end would be incorrect.
      
      This patch simply resets the real_end if the page was filled.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b3230c8b
    • Steven Rostedt's avatar
      tracing: Add __used annotation to event variable · 49c17746
      Steven Rostedt authored
      The TRACE_EVENT() macros automate creation of trace events. To automate
      initialization, the set up variables are loaded in a special section
      that is read on boot up. GCC is not aware that these static variables
      are used and will complain about them if we do not inform GCC that
      they are indeed used.
      
      One of the declarations of the event element was missing a __used
      annotation. This patch adds it.
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      49c17746
    • Peter Zijlstra's avatar
      perf, trace: Fix !x86 build bug · 87f44bbc
      Peter Zijlstra authored
      Patch b7e2ecef (perf, trace: Optimize tracepoints by removing
      IRQ-disable from perf/tracepoint interaction) made the
      unfortunate mistake of assuming the world is x86 only, correct
      this.
      
      The problem was that perf_fetch_caller_regs() did
      local_save_flags() into regs->flags, and I re-used that to
      remove another local_save_flags(), forgetting !x86 doesn't have
      regs->flags.
      
      Do the reverse, remove the local_save_flags() from
      perf_fetch_caller_regs() and let the ftrace site do the
      local_save_flags() instead.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: acme@redhat.com
      Cc: efault@gmx.de
      Cc: fweisbec@gmail.com
      Cc: rostedt@goodmis.org
      LKML-Reference: <1274778175.5882.623.camel@twins>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      87f44bbc
  5. 24 May, 2010 2 commits
    • Arnaldo Carvalho de Melo's avatar
      perf report: Support multiple events on the TUI · d67f088e
      Arnaldo Carvalho de Melo authored
      The hists__tty_browse_tree function was created with the loop to print
      all events, and its equivalent, hists__tui_browse_tree, was created in a
      similar fashion, where it is possible to switch among the multiple
      events, if present, using TAB to go the next event, and shift+TAB
      (UNTAB) to go to the previous.
      
      The report TUI now shows as the window title the name of the event and a
      leak was fixed wrt pstacks.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d67f088e
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Fix up usage of the build id cache · 44bf4606
      Arnaldo Carvalho de Melo authored
      It was assuming that the cache was always available and also wasn't
      checking if the file found in the build id cache was just a kallsyms
      file, that is not supported by objdump for disassembly.
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      44bf4606
  6. 23 May, 2010 2 commits
  7. 22 May, 2010 2 commits
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Add TUI interface · 46e3e055
      Arnaldo Carvalho de Melo authored
      When annotating multiple entries, for instance, when running simply as:
      
      $ perf annotate
      
      the right and left keys, as well as TAB can be used to cycle thru the
      multiple symbols being annotated.
      
      If one doesn't like TUI annotate, disable it by editing ~/.perfconfig
      and adding:
      
      [tui]
      
      	annotate = off
      
      Just like it is possible for report.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      46e3e055
    • Arnaldo Carvalho de Melo's avatar
      perf tui: Remove annotate from popup menu after failure · 6e78c9fd
      Arnaldo Carvalho de Melo authored
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6e78c9fd
  8. 21 May, 2010 17 commits
  9. 20 May, 2010 8 commits
    • Ingo Molnar's avatar
      Merge branch 'perf/core' of... · 915e5558
      Ingo Molnar authored
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
      915e5558
    • Frederic Weisbecker's avatar
      perf: Fix forgotten preempt_enable by nested writers · acd35a46
      Frederic Weisbecker authored
      A writer that gets a reference to the buffer handle disables
      preemption. When we put that reference, we check if we are
      the outer most writer and if not, we simply return and defer
      the head update to the outer most writer. The problem here
      is that preemption is only reenabled by the outer most, that
      produces preemption count imbalance for every nested writer
      that exit.
      
      So just don't forget to always re-enable preemption when we
      put the buffer reference, whoever we are.
      
      Fixes lots of sleeping in atomic warnings, visible with lock
      events recording.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Robert Richter <robert.richter@amd.com>
      acd35a46
    • Arnaldo Carvalho de Melo's avatar
      perf annotate: Use build-ids to find the right DSO · b36f19d5
      Arnaldo Carvalho de Melo authored
      We were still using the pathname found on the MMAP event, that could not
      be the one we used when recording, so use the build-id cache for that,
      only falling back to use the pathname in the MMAP event if no build-ids
      are available.
      
      With this we now also are able to do secure, seamless offline annotation.
      
      Example:
      
      [root@doppio linux-2.6-tip]# perf report -g none -v 2> /dev/null | head -10
           8.12%     Xorg  /usr/lib64/libpixman-1.so.0.14.0       0x0000000000026d02 B [.] pixman_rasterize_edges
           4.68%  firefox  /usr/lib64/xulrunner-1.9.1/libxul.so   0x00000000005dbdba B [.] 0x000000005dbdba
           3.70%  swapper  /lib/modules/2.6.34-rc6/build/vmlinux  0xffffffff81022cea ! [k] read_hpet
           2.96%     init  /lib/modules/2.6.34-rc6/build/vmlinux  0xffffffff81022cea ! [k] read_hpet
           2.73%  swapper  /lib/modules/2.6.34-rc6/build/vmlinux  0xffffffff8100a738 ! [k] mwait_idle_with_hints
      [root@doppio linux-2.6-tip]# perf annotate -v pixman_rasterize_edges 2>&1 | grep Executing
      Executing: objdump --start-address=0x000000371ce26670 --stop-address=0x000000371ce2709f -dS /root/.debug/.build-id/bd/6ac5199137aaeb279f864717d8d061477466c1|grep -v /root/.debug/.build-id/bd/6ac5199137aaeb279f864717d8d061477466c1|expand
      [root@doppio linux-2.6-tip]# perf buildid-list | grep libpixman-1.so.0.14.0
      bd6ac5199137aaeb279f864717d8d061477466c1 /usr/lib64/libpixman-1.so.0.14.0
      [root@doppio linux-2.6-tip]#
      Reported-by: default avatarStephane Eranian <eranian@google.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b36f19d5
    • Arnaldo Carvalho de Melo's avatar
      perf TUI: Make 'space' be an alias to 'PgDn' · 17930b40
      Arnaldo Carvalho de Melo authored
      Just like if one is using the stdio based pager, or more/less, for that
      matter.
      Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      17930b40
    • Ingo Molnar's avatar
      Merge branch 'perf/urgent' of... · dfacc4d6
      Ingo Molnar authored
      Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
      dfacc4d6
    • Frederic Weisbecker's avatar
      perf: Fix unaligned accesses while fetching trace values · 85cb68b2
      Frederic Weisbecker authored
      Accessing trace values of an 8 size may end up in a segfault
      on archs that can't deal with misaligned access, which is the
      case for sparc 64. This is because PERF_SAMPLE_RAW are aligned
      to 4 and not to 8.
      
      Fix this on the macros that get the values of 8 size.
      
      This fixes segfaults on perf tools in sparc 64.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: David Miller <davem@davemloft.net>
      85cb68b2
    • Frederic Weisbecker's avatar
      perf: Comply with new rcu checks API · 49f135ed
      Frederic Weisbecker authored
      The software events hlist doesn't fully comply with the new
      rcu checks api.
      
      We need to consider three different sides that access the hlist:
      
      - the hlist allocation/release side. This side happens when an
        events is created or released, accesses to the hlist are
        serialized under the cpuctx mutex.
      
      - the events insertion/removal in the hlist. This side is always
        serialized against the above one. The hlist is always present
        during such operations. This side happens when a software event
        is scheduled in/out. The serialization that ensures the software
        event is really attached to the context is made under the
        ctx->lock.
      
      - events triggering. This is the read side, it can happen
        concurrently with any update side.
      
      This patch deals with them one by one and anticipates with the
      separate rcu mem space patches in preparation.
      
      This patch fixes various annoying rcu warnings.
      Reported-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      49f135ed
    • Tom Zanussi's avatar
      perf: Use read() instead of lseek() in trace_event_read.c:skip() · cbb5cf7f
      Tom Zanussi authored
      This is a small fix for a problem affecting live-mode, introduced
      recently:
      
      root@tropicana:~# perf trace rwtop
      perf trace started with Perl
      script /root/libexec/perf-core/scripts/perl/rwtop.pl
      
        Fatal: did not read header event
      
      commit d00a47cc added a skip()
      function to skip over e.g. header_page, but this doesn't work for
      live mode.  This patch re-implements skip() to use read() instead of
      lseek() to fix that.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1273032130.6383.28.camel@tropicana>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      cbb5cf7f
  10. 19 May, 2010 1 commit