1. 27 7月, 2010 7 次提交
    • D
      perf tools: Remove unneeded code for tracking the cwd in perf sessions · 88ca895d
      Dave Martin 提交于
      Tidy-up patch to remove some code and struct perf_session data members
      which are no longer needed due to the previous patch: "perf tools: Don't
      abbreviate file paths relative to the cwd".
      
      LKML-Reference: <new-submission>
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      88ca895d
    • D
      perf report: Don't abbreviate file paths relative to the cwd · 361d1346
      Dave Martin 提交于
      This avoids around some problems where the full path is executables and DSOs it
      needed for finding debug symbols on platforms with separated debug symbol files
      such as Ubuntu.  This is simpler than tracking an extra name for each image.
      
      The only impact should be that paths in verbose output from the perf tools
      become absolute, instead of relative to .
      
      LKML-Reference: <new-submission>
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      361d1346
    • A
      perf ui: New hists tree widget · 0f0cbf7a
      Arnaldo Carvalho de Melo 提交于
      The stock newt checkbox tree widget we were using was not really
      suitable for hist entry + callchain browsing.
      
      The problems with it were manifold:
      
      - We needed to traverse the whole hist_entry rb_tree to add each entry +
        callchains beforehand.
      
      - No control over the colors used for each row
      
      So a new tree widget, based mostly on slang, was written.
      
      It extends the ui_browser class already used for annotate to allow the
      user to fold/unfold branches in the callchains tree, using extra fields
      in the symbol_map class that is embedded in hist_entry and
      callchain_node instances to store the folding state and when changing
      this state calculates the number of rows that are produced when showing
      a particular hist_entry instance.
      
      This greatly speeds up browsing as we don't have to upfront touch all
      the entries and only calculate callchain related operations when some
      callchain branch is actually unfolded.
      
      The memory footprint is also reduced as the data structure is not
      duplicated, just some extra fields for controling callchain state and to
      simplify the process of seeking thru entries (nr_rows, row_offset) were
      added.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f0cbf7a
    • A
      perf ui: Show the scroll bar over the left window frame · 8d8c369f
      Arnaldo Carvalho de Melo 提交于
      So that we gain two columns and look more like classical (at least in
      TUIs) scroll bars bars.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d8c369f
    • A
      perf ui: Consider the refreshed dimensions in ui_browser__show · 63160f73
      Arnaldo Carvalho de Melo 提交于
      When we call ui_browser__show we may have called
      ui_browser__refresh_dimensions to check if the maximum lenght for the
      contained entries changed, such as when zooming in and out DSOs or
      threads in the hist browser.
      
      For that to happen we must delete the old form, that will take care of
      deleting the vertical scrollbar, etc, and then recreate them, with the
      new dimensions.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      63160f73
    • A
      perf hist: Introduce routine to measure lenght of formatted entry · 06daaaba
      Arnaldo Carvalho de Melo 提交于
      Will be used to figure out the window width needed in the new tree
      widget.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      06daaaba
    • A
      perf ui: Restore SPACE as an alias to PGDN in annotate · b61b55ed
      Arnaldo Carvalho de Melo 提交于
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b61b55ed
  2. 23 7月, 2010 2 次提交
  3. 22 7月, 2010 1 次提交
    • T
      x86 cpufreq, perf: Make trace_power_frequency cpufreq driver independent · 4c21adf2
      Thomas Renninger 提交于
      and fix the broken case if a core's frequency depends on others.
      
      trace_power_frequency was only implemented in a rather ungeneric
      way in acpi-cpufreq driver's target() function only.
      
      -> Move the call to trace_power_frequency to
         cpufreq.c:cpufreq_notify_transition() where CPUFREQ_POSTCHANGE
         notifier is triggered.
         This will support power frequency tracing by all cpufreq
         drivers.
      
      trace_power_frequency did not trace frequency changes correctly
      when the userspace governor was used or when CPU cores'
      frequency depend on each other.
      
      -> Moving this into the CPUFREQ_POSTCHANGE notifier and pass the cpu
         which gets switched automatically fixes this.
      
      Robert Schoene provided some important fixes on top of my
      initial quick shot version which are integrated in this patch:
      - Forgot some changes in power_end trace (TP_printk/variable names)
      - Variable dummy in power_end must now be cpu_id
      - Use static 64 bit variable instead of unsigned int for cpu_id
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Cc: davej@codemonkey.org.uk
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Acked-by: NArjan van de Ven <arjan@infradead.org>
      Cc: Robert Schoene <robert.schoene@tu-dresden.de>
      Tested-by: NRobert Schoene <robert.schoene@tu-dresden.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      4c21adf2
  4. 18 7月, 2010 3 次提交
  5. 16 7月, 2010 3 次提交
  6. 15 7月, 2010 1 次提交
  7. 12 7月, 2010 1 次提交
  8. 08 7月, 2010 2 次提交
    • F
      perf: Sync callchains with period based hits · 108553e1
      Frederic Weisbecker 提交于
      Hists have their hits increased by the event period. And this
      period based counting is the foundation of all the stats in
      perf report.
      
      But callchains still use the raw number of hits, without taking
      the period into account. So when we compute the percentage,
      absolute based percentages are totally broken, and relative ones
      too in the first parent level. Because we pass the number of events
      muliplied by their period as the total number of hits to the
      callchain filtering, while callchains expect this number to be
      the number of raw hits.
      
      perf report -g graph was simply not working, showing no graph unless
      the min percent was zero. And even there the percentage of the
      branches was always 0. And may be fractal filtering was broken on
      the first branch level too.
      
      flat also was broken, but it was hidden because of other breakages.
      
      Anyway fix this by counting using periods on callchains.
      Signed-off-by: NFrederic 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>
      108553e1
    • F
      perf: Resurrect flat callchains · 97aa1052
      Frederic Weisbecker 提交于
      Initialize the callchain radix tree root correctly.
      
      When we walk through the parents, we must stop after the root, but
      since it wasn't well initialized, its parent pointer was random.
      
      Also the number of hits was random because uninitialized, hence it
      was part of the callchain while the root doesn't contain anything.
      
      This fixes segfaults and percentages followed by empty callchains
      while running:
      
      	perf report -g flat
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: 2.6.31.x-2.6.34.x <stable@kernel.org>
      97aa1052
  9. 06 7月, 2010 3 次提交
    • M
      perf probe: Support static and global variables · b7dcb857
      Masami Hiramatsu 提交于
      Add static and global variables support to perf probe.
      This allows user to trace non-local variables (and
      structure members) at probe points.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195749.2885.17451.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b7dcb857
    • M
      perf probe: Support tracing an entry of array · b2a3c12b
      Masami Hiramatsu 提交于
      Add array-entry tracing support to perf probe. This enables to trace an entry
      of array which is indexed by constant value, e.g. array[0].
      
      For example:
      
        $ perf probe -a 'bio_split bi->bi_io_vec[0]'
      
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195742.2885.5344.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b2a3c12b
    • M
      perf probe: Support "string" type · 73317b95
      Masami Hiramatsu 提交于
      Support string type casting to event argument. If perf-probe finds an argument
      casted as string, it ensures the target variable is "(unsigned/signed) char
      *(or []). perf-probe also adds dereference if the target is a pointer.
      
      So, both of 'char buf[10];' and 'char *buf;' can be accessed by 'buf:string'
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20100519195734.2885.1666.stgit@localhost6.localdomain6>
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      73317b95
  10. 05 7月, 2010 2 次提交
  11. 02 7月, 2010 2 次提交
  12. 30 6月, 2010 1 次提交
  13. 25 6月, 2010 4 次提交
  14. 22 6月, 2010 4 次提交
  15. 18 6月, 2010 4 次提交
    • T
      perf scripts perl: Makefile fix · bfde7448
      Tom Zanussi 提交于
      Fix a typo introduced by recent Makefile changes, in f9af3a4c.  Without it, Perl
      scripting support won't get compiled in.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <1276836006.7762.15.camel@tropicana>
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bfde7448
    • I
      perf record: prevent kill(0, SIGTERM); · 5ffc8881
      Ian Munsie 提交于
      At exit, perf record will kill the process it was profiling by sending a
      SIGTERM to child_pid (if it had been initialised), but in certain situations
      child_pid may be 0 and perf would mistakenly kill more processes than intended.
      
      child_pid is set to the return of fork() to either 0 or the pid of the child.
      Ordinarily this would not present an issue as the child calls execvp to spawn
      the process to be profiled and would therefore never run it's sig_atexit and
      never attempt to kill pid 0.
      
      However, if a nonexistant binary had been passed in to perf record the call to
      execvp would fail and child_pid would be left set to 0. The child would then
      exit and it's atexit handler, finding that child_pid was initialised to 0,
      would call kill(0, SIGTERM), resulting in every process within it's process
      group being killed.
      
      In the case that perf was being run directly from the shell this typically
      would not be an issue as the shell isolates the process.  However, if perf was
      being called from another program it could kill unexpected processes, which may
      even include X.
      
      This patch changes the logic of the test for whether child_pid was initialised
      to only consider positive pids as valid, thereby never attempting to kill pid
      0.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <1276072680-17378-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>
      5ffc8881
    • A
      perf session: fix error message on failure to open perf.data · 0f2c3de2
      Andy Isaacson 提交于
      If we cannot open our data file, print strerror(errno) for a more
      comprehensible error message; and only suggest 'perf record' on ENOENT.
      
      In particular, this fixes the nonsensical advice when:
      
          % sudo perf record sleep 1
          [ perf record: Woken up 1 times to write data ]
          [ perf record: Captured and wrote 0.009 MB perf.data (~381 samples) ]
          % perf trace
          failed to open file: perf.data  (try 'perf record' first)
          %
      
      Cc: Ingo Molnar <mingo@elte.hu>
      LPU-Reference: <20100612033615.GA24731@hexapodia.org>
      Signed-off-by: NAndy Isaacson <adi@hexapodia.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f2c3de2
    • A
      perf debug: fix hex dump partial final line · 84c104ad
      Andy Isaacson 提交于
      The loop counter math in trace_event was much more complicated than
      necessary, resulting in incorrectly decoding the human-readable
      portion of the partial last line of hexdump in "perf trace -D" output:
      
      .  0020:  00 00 00 00 00 00 00 00 2f 73 62 69 6e 2f 69 6e  ......../sbin/i
      .  0030:  69 74 00 00 00 00 00 00                          /sbin/i
      
      With this fixed (and simpler!) code, we get the correct output:
      
      .  0020:  00 00 00 00 00 00 00 00 2f 73 62 69 6e 2f 69 6e  ......../sbin/in
      .  0030:  69 74 00 00 00 00 00 00                          it......
      
      Cc: Ingo Molnar <mingo@elte.hu>
      LPU-Reference: <20100612024404.GA24469@hexapodia.org>
      Signed-off-by: NAndy Isaacson <adi@hexapodia.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84c104ad