Skip to content
  1. Aug 12, 2009
  2. Aug 11, 2009
  3. Aug 10, 2009
  4. Aug 09, 2009
    • Frederic Weisbecker's avatar
      perf tools: callchain: Fix bad rounding of minimum rate · c0a8865e
      Frederic Weisbecker authored
      
      
      Sometimes we get callchain branches that have a rate under the
      limit given by the user.
      
      Say you launched:
      
       perf record -f -g -a ./hackbench 10
       perf report -g fractal,10.0
      
      And you got:
      
      2.33%       hackbench  [kernel]                  [k] _spin_lock_irqsave
                      |
                      |--78.57%-- remove_wait_queue
                      |          poll_freewait
                      |          do_sys_poll
                      |          sys_poll
                      |          sysenter_dispatch
                      |          0xf7ffa430
                      |          0x1ffadea3c
                      |
                      |--7.14%-- __up_read
                      |          up_read
                      |          do_page_fault
                      |          page_fault
                      |          0xf7ffa430
                      |          0xa0df710000000a
                      ...
      
      It is abnormal to get a 7.14% branch whereas we passed a 10%
      filter.
      
      The problem is that we round down the minimum threshold. This
      happens mostly when we have very low number of events. If the
      total amount of your branch is 4 and you have a subranch of 3
      events, filtering to 90% will be computed like follows:
      
        limit = 4 * 0.9;
      
      The result is about 3.6, but the cast to integer will round
      down to 3. It means that our filter is actually of 75%
      
      We must then explicitly round up the minimum threshold.
      
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: acme@redhat.com
      Cc: peterz@infradead.org
      Cc: efault@gmx.de
      LKML-Reference: <20090809024235.GA10146@nowhere>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c0a8865e
    • Mike Galbraith's avatar
      perf_counter tools: Fix libbfd detection for systems with libz dependency · 183f3b08
      Mike Galbraith authored
      
      
      Due to a libz dependency in some distro's binutils package,
      C++ demangle support isn't compiled in despite the necessary
      libraries being available.
      
      Fix this by adding a -lz link test to the dependency detection
      rules.
      
      Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1249733655.6929.5.camel@marge.simson.net>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      183f3b08
    • Carlos R. Mafra's avatar
      perf: "Longum est iter per praecepta, breve et efficax per exempla" · c24b5133
      Carlos R. Mafra authored
      A few examples of how 'perf' can be used, from an e-mail by
      Ingo Molnar http://lkml.org/lkml/2009/8/4/346
      
      .
      
      Signed-off-by: default avatarCarlos R. Mafra <crmafra2@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Valdis.Kletnieks@vt.edu
      LKML-Reference: <20090805185334.GA4535@Pilar.aei.mpg.de>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c24b5133
    • Peter Zijlstra's avatar
      perf_counter: Fix a race on perf_counter_ctx · 3a80b4a3
      Peter Zijlstra authored
      
      
      While extending perfcounters with BTS hw-tracing, Markus
      Metzger managed to trigger this warning:
      
         [  995.557128] WARNING: at kernel/perf_counter.c:1191 __perf_counter_task_sched_out+0x48/0x6b()
      
      triggers because commit
      9f498cc5 (perf_counter: Full
      task tracing) removed clearing of tsk->perf_counter_ctxp out
      from under ctx->lock which introduced a race (against
      perf_lock_task_context).
      
      Move it back and deal with the exit notification by explicitly
      passing along the former task context.
      
      Reported-by: default avatarMarkus T Metzger <markus.t.metzger@intel.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1249667341.17467.5.camel@twins>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3a80b4a3
    • Frederic Weisbecker's avatar
      perf_counter: Fix tracepoint sampling to be part of generic sampling · 3a43ce68
      Frederic Weisbecker authored
      
      
      Based on Peter's comments, make tracepoint sampling generic
      just like all the other sampling bits are. This is a rename
      with no code changes:
      
      - PERF_SAMPLE_TP_RECORD to PERF_SAMPLE_RAW
      - struct perf_tracepoint_record to perf_raw_record
      
      We want the system in place that transport tracepoints raw
      samples events into the perf ring buffer to be generalized and
      usable by any type of counter.
      
      Reported-by; Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1249698400-5441-4-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3a43ce68
    • Frederic Weisbecker's avatar
      perf_counter: Work around gcc warning by initializing tracepoint record unconditionally · 10b8e306
      Frederic Weisbecker authored
      
      
      Despite that the tracepoint record is always present when the
      PERF_SAMPLE_TP_RECORD flag is set, gcc raises a warning,
      thinking it might not be initialized:
      
        kernel/perf_counter.c: In function ‘perf_counter_output’:
        kernel/perf_counter.c:2650: warning: ‘tp’ may be used uninitialized in this function
      
      Then, initialize it to NULL and always check if it's not NULL
      before dereference it.
      
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1249698400-5441-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      10b8e306
    • Frederic Weisbecker's avatar
      perf tools: callchain: Fix sum of percentages to be 100% by displaying amount... · 25446036
      Frederic Weisbecker authored
      
      perf tools: callchain: Fix sum of percentages to be 100% by displaying amount of ignored chains in fractal mode
      
      When we filter the callchains below a given percentage, we
      ignore them and the end result only shows entries that have an
      upper percentage than the filter threshold.
      
      It seems to users then that we have an imbalance in the
      percentage, as if the sum inside a profiled branch doesn't
      reach 100%.
      
      Since in the past there have been real perf report bugs that
      showed the same sypmtom, it would be nice to assure the user
      that the data is perfect and trustable and it all sums up to
      100.00%.
      
      So fix this by displaying the remaining hits that have been
      filtered but without more detail than their amount in each
      branches. Example while filtering below 50%:
      
      7.73%  [k] delay_tsc
                      |
                      |--98.22%-- __const_udelay
                      |          |
                      |          |--86.37%-- ath5k_hw_register_timeout
                      |          |          ath5k_hw_noise_floor_calibration
                      |          |          ath5k_hw_reset
                      |          |          ath5k_reset
                      |          |          ath5k_config
                      |          |          ieee80211_hw_config
                      |          |          |
                      |          |          |--88.53%-- ieee80211_scan_work
                      |          |          |          worker_thread
                      |          |          |          kthread
                      |          |          |          child_rip
                      |          |           --11.47%-- [...]
                      |           --13.63%-- [...]
                       --1.78%-- [...]
      
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1249690585-9145-4-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      25446036