1. 17 Oct, 2011 2 commits
  2. 15 Oct, 2011 1 commit
  3. 14 Oct, 2011 5 commits
  4. 13 Oct, 2011 6 commits
  5. 12 Oct, 2011 2 commits
  6. 11 Oct, 2011 3 commits
    • Arnaldo Carvalho de Melo's avatar
      perf hists browser: Recalculate browser pointers after resort/decay · 900e14a8
      Arnaldo Carvalho de Melo authored
      In browsers that access dynamic underlying data structures, like in the
      hists browser and its hist_entry rb_tree, we need to revalidate any
      reference to the underlying data structure, because they can have gone
      away, decayed.
      
      This fixes a problem where after a while the top entries get behind the
      top of the screen, i.e. the top_idx stays at 0, which means it is at the
      first entry in the rb_tree when in fact it wasn't because the
      browser->top didn't got revalidated after the timer ran and the
      underlying data structure got updated.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-mhje66qssdko24q67a2lhlho@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      900e14a8
    • Steven Rostedt's avatar
      tracing: Do not allocate buffer for trace_marker · d696b58c
      Steven Rostedt authored
      When doing intense tracing, the kmalloc inside trace_marker can
      introduce side effects to what is being traced.
      
      As trace_marker() is used by userspace to inject data into the
      kernel ring buffer, it needs to do so with the least amount
      of intrusion to the operations of the kernel or the user space
      application.
      
      As the ring buffer is designed to write directly into the buffer
      without the need to make a temporary buffer, and userspace already
      went through the hassle of knowing how big the write will be,
      we can simply pin the userspace pages and write the data directly
      into the buffer. This improves the impact of tracing via trace_marker
      tremendously!
      
      Thanks to Peter Zijlstra and Thomas Gleixner for pointing out the
      use of get_user_pages_fast() and kmap_atomic().
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d696b58c
    • Steven Rostedt's avatar
      tracing: Warn on output if the function tracer was found corrupted · e0a413f6
      Steven Rostedt authored
      As the function tracer is very intrusive, lots of self checks are
      performed on the tracer and if something is found to be strange
      it will shut itself down keeping it from corrupting the rest of the
      kernel. This shutdown may still allow functions to be traced, as the
      tracing only stops new modifications from happening. Trying to stop
      the function tracer itself can cause more harm as it requires code
      modification.
      
      Although a WARN_ON() is executed, a user may not notice it. To help
      the user see that something isn't right with the tracing of the system
      a big warning is added to the output of the tracer that lets the user
      know that their data may be incomplete.
      Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      e0a413f6
  7. 10 Oct, 2011 12 commits
  8. 07 Oct, 2011 9 commits
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Make --no-asm-raw the default · 64c6f0c7
      Arnaldo Carvalho de Melo authored
      And add the annotation output knobs to all the tools that have
      integrated annotation (top, report).
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-gnlob67mke6sji2kf4nstp7m@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      64c6f0c7
    • Stephane Eranian's avatar
      perf tools: Make perf.data more self-descriptive (v8) · fbe96f29
      Stephane Eranian authored
      The goal of this patch is to include more information about the host
      environment into the perf.data so it is more self-descriptive. Overtime,
      profiles are captured on various machines and it becomes hard to track
      what was recorded, on what machine and when.
      
      This patch provides a way to solve this by extending the perf.data file
      with basic information about the host machine. To add those extensions,
      we leverage the feature bits capabilities of the perf.data format.  The
      change is backward compatible with existing perf.data files.
      
      We define the following useful new extensions:
       - HEADER_HOSTNAME: the hostname
       - HEADER_OSRELEASE: the kernel release number
       - HEADER_ARCH: the hw architecture
       - HEADER_CPUDESC: generic CPU description
       - HEADER_NRCPUS: number of online/avail cpus
       - HEADER_CMDLINE: perf command line
       - HEADER_VERSION: perf version
       - HEADER_TOPOLOGY: cpu topology
       - HEADER_EVENT_DESC: full event description (attrs)
       - HEADER_CPUID: easy-to-parse low level CPU identication
      
      The small granularity for the entries is to make it easier to extend
      without breaking backward compatiblity. Many entries are provided as
      ASCII strings.
      
      Perf report/script have been modified to print the basic information as
      easy-to-parse ASCII strings. Extended information about CPU and NUMA
      topology may be requested with the -I option.
      
      Thanks to David Ahern for reviewing and testing the many versions of
      this patch.
      
       $ perf report --stdio
       # ========
       # captured on : Mon Sep 26 15:22:14 2011
       # hostname : quad
       # os release : 3.1.0-rc4-tip
       # perf version : 3.1.0-rc4
       # arch : x86_64
       # nrcpus online : 4
       # nrcpus avail : 4
       # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
       # cpuid : GenuineIntel,6,15,11
       # total memory : 8105360 kB
       # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
       # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
       # HEADER_CPU_TOPOLOGY info available, use -I to display
       # HEADER_NUMA_TOPOLOGY info available, use -I to display
       # ========
       #
       ...
      
       $ perf report --stdio -I
       # ========
       # captured on : Mon Sep 26 15:22:14 2011
       # hostname : quad
       # os release : 3.1.0-rc4-tip
       # perf version : 3.1.0-rc4
       # arch : x86_64
       # nrcpus online : 4
       # nrcpus avail : 4
       # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
       # cpuid : GenuineIntel,6,15,11
       # total memory : 8105360 kB
       # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
       # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
       # sibling cores   : 0-3
       # sibling threads : 0
       # sibling threads : 1
       # sibling threads : 2
       # sibling threads : 3
       # node0 meminfo  : total = 8320608 kB, free = 7571024 kB
       # node0 cpu list : 0-3
       # ========
       #
       ...
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Tested-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Link: http://lkml.kernel.org/r/20110930134040.GA5575@quadSigned-off-by: default avatarStephane Eranian <eranian@google.com>
      [ committer notes: Use --show-info in the tools as was in the docs, rename
        perf_header_fprintf_info to perf_file_section__fprintf_info, fixup
        conflict with f69b64f7 "perf: Support setting the disassembler style" ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fbe96f29
    • Arnaldo Carvalho de Melo's avatar
      perf hists browser: Update the browser.nr_entries after the timer · be83f5ed
      Arnaldo Carvalho de Melo authored
      Previously the hist_browser dealt with a static tree of entries, now it
      needs to update the nr_entries in the browser after the timer runs.
      
      A better solution will come when moving using another thread for the
      collapse_resort, etc, but for now this is ok.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-9eno2iq55sjr4iyo899buzaw@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      be83f5ed
    • Arnaldo Carvalho de Melo's avatar
      perf hists browser: Fix TAB/UNTAB use with multiple events · 7d16320e
      Arnaldo Carvalho de Melo authored
      When requesting multiple events, say:
      
        # perf top -e instructions -e cycles -e cache-misses
      
      The first screen lets the user chose what to see first, then to switch
      one can either use the left key to get back to the event menu or simply
      use TAB to go the next and shift+TAB to go the prev.
      
      When using TAB/UNTAB the call to perf_evlist__set_selected(event) was
      missing, fix it.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-3xqqh3fwmt914gg43frey14y@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7d16320e
    • Arnaldo Carvalho de Melo's avatar
      perf hists browser: Don't offer symbol actions when symbols not on --sort · 724c9c9f
      Arnaldo Carvalho de Melo authored
      Removing all the entries that only apply to symbols from the menu.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-7bap0cy2fxtorlj5hgsp48m1@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      724c9c9f
    • Arnaldo Carvalho de Melo's avatar
      perf annotate browser: Use -> to navigate on assembly lines · 234a5375
      Arnaldo Carvalho de Melo authored
      And add better explanations when the line isn't actionable, like non
      assembly lines and on other instructions.
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-375n844b5wra7lgq08ou153j@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      234a5375
    • Stephane Eranian's avatar
      perf tools: Fix broken number of samples for perf report -n · e39622ce
      Stephane Eranian authored
      The perf report -n option was broken because it was not reporting the
      correct number of samples depending on the sorting mode. By default,
      samples are sorted by comm,dso,sym. That means that samples for the same
      command (binary) get collapsed.
      
      The hists__collapse_insert_entry() had a bug whereby it was aggregating
      the number of events observed (periods) but not the number of samples.
      Consequently, the number of samples reported could be below reality. The
      percentage remained correct because based on the periods.
      
      This patch fixes the problem by also aggregating the number of samples.
      Here is an example:
      
      $ perf report -n --stdio
          12.38%        842     pong  [kernel.kallsyms]     [k] __lock_acquire
      
      Here pong (a ctxsw stress test), is the only program running
      and thus it is the only one responsible for the lock_acquire samples.
      
      If we change the sorting mode:
      
      $ perf report -n --stdio --sort=sym
          12.38%       1732  [k] __lock_acquire
      
      The actual number of samples is shown.
      
      With the fix:
      
      $ perf report -n --stdio
          12.38%       1732     pong  [kernel.kallsyms]     [k] __lock_acquire
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20111003093815.GA6393@quadSigned-off-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e39622ce
    • Arnaldo Carvalho de Melo's avatar
      perf top: Use the TUI interface by default · 8b1bfdbd
      Arnaldo Carvalho de Melo authored
      To disable it either:
      
      1. Make sure newt-devel is not installed when building it
      
      2. Use 'perf top --stdio' just like with report
      
      3. Edit your ~/.perfconfig or system wide config and have this there:
      
      [tui]
      
      	top = off
      
      But you shouldn't, since the TUI is so much more powerful, has
      integration with annotation and where lots more interesting features
      will be developed, so if something annoys you (the colors?) just let me
      know and I'll do my best to make it pleasant as a default.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-cy2tn4uj1t7c3aqss5l25of5@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8b1bfdbd
    • Arnaldo Carvalho de Melo's avatar
      perf annotate browser: Allow navigation to called functions · 34958544
      Arnaldo Carvalho de Melo authored
      I.e. when in the annotate TUI window, if Enter is pressed over an
      assembly line with a 'callq' it will try to open another TUI window with
      that symbol.
      
      This is just a proof of concept and works only on x86_64, more work is
      needed to support kernel modules, userland, other arches, etc, but
      should already be useful as-is.
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.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>
      Link: http://lkml.kernel.org/n/tip-opyvskw5na3qdmkv8vxi3zbr@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      34958544