1. 11 8月, 2009 6 次提交
  2. 10 8月, 2009 19 次提交
  3. 09 8月, 2009 15 次提交
    • F
      perf tools: callchain: Fix bad rounding of minimum rate · c0a8865e
      Frederic Weisbecker 提交于
      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: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: acme@redhat.com
      Cc: peterz@infradead.org
      Cc: efault@gmx.de
      LKML-Reference: <20090809024235.GA10146@nowhere>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0a8865e
    • M
      perf_counter tools: Fix libbfd detection for systems with libz dependency · 183f3b08
      Mike Galbraith 提交于
      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: NMike Galbraith <efault@gmx.de>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <1249733655.6929.5.camel@marge.simson.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      183f3b08
    • C
      perf: "Longum est iter per praecepta, breve et efficax per exempla" · c24b5133
      Carlos R. Mafra 提交于
      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: NCarlos 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: NIngo Molnar <mingo@elte.hu>
      c24b5133
    • P
      perf_counter: Fix a race on perf_counter_ctx · 3a80b4a3
      Peter Zijlstra 提交于
      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: NMarkus T Metzger <markus.t.metzger@intel.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1249667341.17467.5.camel@twins>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3a80b4a3
    • F
      perf_counter: Fix tracepoint sampling to be part of generic sampling · 3a43ce68
      Frederic Weisbecker 提交于
      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: NFrederic 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: NIngo Molnar <mingo@elte.hu>
      3a43ce68
    • F
      perf_counter: Work around gcc warning by initializing tracepoint record unconditionally · 10b8e306
      Frederic Weisbecker 提交于
      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: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic 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: NIngo Molnar <mingo@elte.hu>
      10b8e306
    • F
      perf tools: callchain: Fix sum of percentages to be 100% by displaying amount... · 25446036
      Frederic Weisbecker 提交于
      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: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic 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: NIngo Molnar <mingo@elte.hu>
      25446036
    • F
      perf tools: callchain: Fix 'perf report' display to be callchain by default · b1a88349
      Frederic Weisbecker 提交于
      If we recorded with -g option to record the callchain, right now
      we require a -g option to perf report as well - and people reported
      this as unnecessary complication: the user already specified -g
      once, no need to require it a second time.
      
      So if the recording includes call-chains, display the callchain by
      default from perf report.
      
      ( The user can override this default using "-g none" option from
        perf report. )
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic 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-3-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b1a88349
    • F
      perf tools: callchain: Fix spurious 'perf report' warnings: ignore empty callchains · b0efe213
      Frederic Weisbecker 提交于
      When the callchain tree comes to insert an empty backtrace, it
      raises a spurious warning about the fact we are inserting an
      empty. This is spurious because the radix tree assumes it did
      something wrong to reach this state. But it didn't, we just met
      an empty callchain that has to be ignored.
      
      This happens occasionally with certain types of call-chain
      recordings. If it happens it's a big nuisance as perf report
      output starts with thousands of warning lines.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic 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-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b0efe213
    • P
      perf record: Fix the -A UI for empty or non-existent perf.data · 266e0e21
      Pierre Habouzit 提交于
      1. Ignore the -A argument if there is no perf.data file
      2. Treat an empty file like a non existent file.
      
      Else, perf will try to read the perf.data header, and fail with
      an error.
      
      Treating an empty file like a non-existent file makes sense,
      since an interupted (as in SIGKILLed) perf could leave such
      files around, and you don't want to annoy the user with errors
      for files with no data in it.
      Signed-off-by: NPierre Habouzit <pierre.habouzit@intersec.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      266e0e21
    • P
      perf util: Fix do_read() to fail on EOF instead of busy-looping · 7eac7e9e
      Pierre Habouzit 提交于
      While toying with perf, I've noticed that perf record can
      easily enter a busy loop when doing something as silly as:
      
          $ perf record -A ls
      
      Yeah, do_read here really wants to read a known size, not being
      able to should die(), not busy-loop ;)
      
      That was the cause for the bug.
      Signed-off-by: NPierre Habouzit <pierre.habouzit@intersec.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7eac7e9e
    • P
      perf list: Fix the output to not include tracepoints without an id · ae07b63f
      Peter Zijlstra 提交于
      Stop perf list from displaying tracepoints without an id file,
      those are special tracepoints that are not interfaced to
      perfcounters so listing them is erroneous and passing them as
      events will produce no output.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NJason Baron <jbaron@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Chris Mason <chris.mason@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ae07b63f
    • P
      perf_counter/powerpc: Fix oops on cpus without perf_counter hardware support · f36a1a13
      Paul Mackerras 提交于
      If we have the powerpc perf_counter backend compiled in, but
      the cpu we are running on is one where we don't support the
      PMU, we currently oops in hw_perf_group_sched_in if we try to
      use any counters, because ppmu is NULL in that case, and we
      unconditionally dereference ppmu.
      
      This fixes the problem by adding a check if ppmu is NULL at the
      beginning of hw_perf_group_sched_in, and also at the beginning
      of the other functions that get called from the perf_counter
      core, i.e. hw_perf_disable, hw_perf_enable, and
      hw_perf_counter_setup.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: benh@kernel.crashing.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f36a1a13
    • B
      perf stat: Fix tool option consistency: rename -S/--scale to -c/--scale · b26bc5a7
      Brice Goglin 提交于
      We want to use a coherent flag for -S/--stat across all tools,
      so free up -S in perf stat.
      Signed-off-by: NBrice Goglin <Brice.Goglin@inria.fr>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: paulus@samba.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b26bc5a7
    • A
      perf report: Add debug help for the finding of symbol bugs - show the symtab... · 94cb9e38
      Arnaldo Carvalho de Melo 提交于
      perf report: Add debug help for the finding of symbol bugs - show the symtab origin (DSO, build-id, kernel, etc)
      
      Used with perf report --verbose:
      
      [acme@doppio linux-2.6-tip]$ perf report -v | head -16
           5.17%  firefox  /usr/lib64/xulrunner-1.9.1/libxul.so   0x00000000005d8eee f [.] imgContainer::DrawFrameTo(gfxIImageFrame*, gfxIImageFrame*, nsRect&)
           2.56%  firefox  /lib64/libpthread-2.10.1.so            0x0000000000008e02 d [.] __pthread_mutex_lock_internal
           1.94%  firefox  /usr/lib64/xulrunner-1.9.1/libxul.so   0x0000000000d0af8f f [.] SearchTable
           1.75%  firefox  [kernel]                               0xffffffffff60013b k [.] vread_hpet
           1.63%  firefox  /lib64/libpthread-2.10.1.so            0x000000000000a404 d [.] __pthread_mutex_unlock
           1.47%  firefox  /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x00000000000482ea f [.] js_Interpret
           1.42%  firefox  /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x000000000003eda3 f [.] JS_CallTracer
           1.24%  firefox  [kernel]                               0xffffffff8102ca4a k [k] read_hpet
           1.16%  firefox  [kernel]                               0xffffffff810f3dd4 k [k] fget_light
           1.11%  firefox  /usr/lib64/xulrunner-1.9.1/libmozjs.so 0x00000000000567ff f [.] js_TraceObject
           0.98%  firefox  /usr/lib64/firefox-3.5.2/firefox       0x000000000000dd23 b [.] arena_ralloc
      [acme@doppio linux-2.6-tip]$
      
      The new field is just after the symbol address. To help in
      figuring out symbol resolution bugs.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      94cb9e38