1. 18 8月, 2009 4 次提交
    • F
      perf tools: Make trace event format parser aware of cast to pointers · 3f9edc23
      Frederic Weisbecker 提交于
      The ftrace event format parser handles the usual casts but not
      the cast to pointers. Such casts have been introduced recently
      with the module trace events and raise the following parsing
      error:
      
      	Fatal: bad op token )
      
      This is because it considers the "*" character as a binary
      operator. Make it then aware of casts to pointers.
      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: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1250543271-8383-4-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3f9edc23
    • F
      perf tools: Record events info also when :record suffix is used. · 9df37ddd
      Frederic Weisbecker 提交于
      You can enable a counter's PERF_SAMPLE_RAW attribute in two
      fashions:
      
      - using the -R option (every counters get PERF_SAMPLE_RAW)
      - using the :record suffix in a trace event counter name
      
      Currently we record the events info in a trace.info file from
      perf record when the former method is used but we omit it with
      the latter.
      
      Check both situations.
      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: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1250543271-8383-3-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9df37ddd
    • F
      perf tools: Warn while running perf trace without sample · 4bf2364a
      Frederic Weisbecker 提交于
      When a user runs perf trace using an input with logged
      counters without PERF_SAMPLE_RAW attribute, warn by giving a
      nice tip.
      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: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1250543271-8383-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4bf2364a
    • F
      perf tools: Fix spelling mistake in callchain error · 6ede59c4
      Frederic Weisbecker 提交于
      While running perf report -g in a perf.data file that hasn't
      been recorded in callchain mode, the error reported has a
      spelling issue:
      
      	./perf report -g
      	selected -c but no callchain data. Did you call perf record without -g?
      
      Fix it.
      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: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1250543271-8383-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6ede59c4
  2. 17 8月, 2009 8 次提交
    • F
      perf tools: Add perf trace · 5f9c39dc
      Frederic Weisbecker 提交于
      This adds perf trace into the set of perf tools.
      
      It is written to fetch the tracepoint samples from perf events
      and display them, according to the events information given by
      the debugfs files through the util/trace* tools.
      
      It is a rough first shot and doesn't yet handle the cpu,
      timestamps fields and some other things.
      
      Example:
      
       perf record -f -e workqueue:workqueue_execution:record -F 1 -a
       perf trace
      
             kblockd/0-236   [000]     0.000000: workqueue_execution: thread=:236 func=cfq_kick_queue+0x0
           kondemand/0-360   [000]     0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
           kondemand/0-360   [000]     0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
      
      Todo:
      
      - A lot of things!
      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: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1250518688-7207-4-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5f9c39dc
    • S
      perf tools: Add trace event information parser · ea4010d1
      Steven Rostedt 提交于
      Add util/trace-event-parse.c which provides the handlers to
      parse the ftrace events info from the stream and handles the
      ftrace perf samples event printing.
      
      This file is a rename of the parse-events.c file from the
      trace-cmd tools, written by Steven Rostedt and Josh Triplett,
      originated from the git tree:
      
        git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This is a perf tools integration.
      
      [ fweisbec@gmail.com: various changes for perf tools
                            integration. ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.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: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1250518688-7207-3-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea4010d1
    • S
      perf tools: Add trace event debugfs stream reader · 538bafb5
      Steven Rostedt 提交于
      Add util/trace-event-read.c which handles trace events
      informations reading.
      
      This file is a rename of the trace-read.c file from the
      trace-cmd tools, written by Steven Rostedt and Josh Triplett,
      originated from the git tree:
      
         git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This is its perf tools integration.
      
      [ fweisbec@gmail.com: various changes for perf tools
                            integration. ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.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: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1250518688-7207-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      538bafb5
    • S
      perf tools: Add trace event debugfs IO handler · 52050943
      Steven Rostedt 提交于
      Add util/trace-event-info.c which handles ftrace file IO from
      debugfs and provides general helpers to fetch/save ftrace
      events informations.
      
      This file is a rename of the trace-cmd.c file from the
      trace-cmd tools, written by Steven Rostedt and Josh Triplett,
      originated from the git tree:
      
        git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This is a perf tools integration.
      
      For now, ftrace events information is saved in a separate file
      than the standard perf.data
      
      [fweisbec@gmail.com: various changes for perf tools integration]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.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: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1250518688-7207-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      52050943
    • F
      perf tools: Librarize trace_event() helper · 8f28827a
      Frederic Weisbecker 提交于
      Librarize trace_event() helper so that perf trace can use it
      too. Also clean up the debug.h includes a bit.
      
      It's not good to have it included in perf.h because it doesn't
      make it flexible against other headers it may need (headers
      that can also depend on perf.h and then create a recursive
      header dependency).
      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: <1250453149-664-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8f28827a
    • F
      perf tools: Librarize sample type and attr finding from headers · 0d3a5c88
      Frederic Weisbecker 提交于
      Librarize the sample type and attr fetching from perf data file
      headers so that we can also use it from perf trace.
      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: <1250448997-30715-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0d3a5c88
    • F
      perf tools: Put the show mode into the event headers files · 0f25bfc8
      Frederic Weisbecker 提交于
      Annotate and report share the same flags to filter events
      considering their context (kernel, user, hypervisor).
      
      Both tools have their own definitions of these flags. Factorize
      them out into the event headers file.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic 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: <1250445414-29237-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0f25bfc8
    • F
      perf tools: Factorize the dprintf definition · 2cec19d9
      Frederic Weisbecker 提交于
      We have two users of dprintf: report and annotate. Another one
      is coming with perf trace. Then factorize it into the debug
      file.
      
      While at it, rename dprintf() to dump_printf() so that it
      doesn't conflicts with its libc homograph.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic 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: <1250443461-28130-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2cec19d9
  3. 16 8月, 2009 3 次提交
    • F
      perf tools: Substract -Wformat-nonliteral from Wformat=2 in extra flags · 0d31b82d
      Frederic Weisbecker 提交于
      The soon coming perf trace needs to use printf with dynamically
      built formats.
      
      But we are using -Wformat=2 which is a shortcut for the
      following set: -Wformat -Wformat-security -Wformat-y2k
      -Wformat-nonliteral
      
      -Wformat-nonliteral warns when it can't check formats because
      they are not builtin constant strings, but we want to feature
      dynamic formats. What we want instead is Wformat=2 minus
      -Wformat-nonliteral, which is what this patch does.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic 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: <1250437927-25490-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0d31b82d
    • I
      perf: Build with stack-protector and with -D_FORTIFY_SOURCE=2 · 35ba15b7
      Ingo Molnar 提交于
      Up our defences a bit.
      Suggested-by: NArjan van de Ven <arjan@infradead.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      35ba15b7
    • I
      perf: Enable more compiler warnings · 83a0944f
      Ingo Molnar 提交于
      Related to a shadowed variable bug fix Valdis Kletnieks noticed
      that perf does not get built with -Wshadow, which could have
      helped us avoid the bug.
      
      So enable -Wshadow and also enable the following warnings on
      perf builds, in addition to the already enabled -Wall -Wextra
      -std=gnu99 warnings:
      
       -Wcast-align
       -Wformat=2
       -Wshadow
       -Winit-self
       -Wpacked
       -Wredundant-decls
       -Wstack-protector
       -Wstrict-aliasing=3
       -Wswitch-default
       -Wswitch-enum
       -Wno-system-headers
       -Wundef
       -Wvolatile-register-var
       -Wwrite-strings
       -Wbad-function-cast
       -Wmissing-declarations
       -Wmissing-prototypes
       -Wnested-externs
       -Wold-style-definition
       -Wstrict-prototypes
       -Wdeclaration-after-statement
      
      And change/fix the perf code to build cleanly under GCC 4.3.2.
      
      The list of warnings enablement is rather arbitrary: it's based
      on my (quick) reading of the GCC manpages and trying them on
      perf.
      
      I categorized the warnings based on individually enabling them
      and looking whether they trigger something in the perf build.
      If i liked those warnings (i.e. if they trigger for something
      that arguably could be improved) i enabled the warning.
      
      If the warnings seemed to come from language laywers spamming
      the build with tons of nuisance warnings i generally kept them
      off. Most of the sign conversion related warnings were in
      this category. (A second patch enabling some of the sign
      warnings might be welcome - sign bugs can be nasty.)
      
      I also kept warnings that seem to make sense from their manpage
      description and which produced no actual warnings on our code
      base. These warnings might still be turned off if they end up
      being a nuisance.
      
      I also left out a few warnings that are not supported in older
      compilers.
      
      [ Note that these changes might break the build on older
        compilers i did not test, or on non-x86 architectures that
        produce different warnings, so more testing would be welcome. ]
      
      Reported-by: Valdis.Kletnieks@vt.edu
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      83a0944f
  4. 15 8月, 2009 3 次提交
  5. 13 8月, 2009 4 次提交
  6. 12 8月, 2009 8 次提交
    • J
      perf record: Add missing -C option support for specifying profile cpu · 0a5ac846
      Jens Axboe 提交于
      perf top supports a -C for setting the profile CPU, but perf
      record does not. This adds the same option for perf record,
      allowing the user to specify a specific target profile CPU.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20090812091801.GC12579@kernel.dk>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a5ac846
    • A
      perf tools: Fix dso__new handle() to handle deleted DSOs · 1340e6bb
      Arnaldo Carvalho de Melo 提交于
      It is better than showing the map addr, this way at least we
      know that we can't get the symtabs because the DSO was deleted
      (system update) while an app still used such DSO.
      
      Yeah, don't do that, but if you do, you'll figure it out
      quicker this way.
      
      [acme@doppio linux-2.6-tip]$ perf report | head -15
       # Samples: 3796
       #
       # Overhead  Command                                                        Shared Object  Symbol
       # ........  .......  ...................................................................  ......
       #
          23.55%   pidgin  /lib64/libglib-2.0.so.0.2000.4.#prelink#.Pd98lu (deleted)            [.] 0x00000000038844
          21.55%   pidgin  /lib64/libpthread-2.10.1.so.#prelink#.AFwK8Q (deleted)               [.] 0x0000000000a42d
          10.85%   pidgin  [kernel]                                                             [.] vread_hpet
           7.85%   pidgin  /lib64/libgobject-2.0.so.0.2000.4.#prelink#.o1vpU7 (deleted)         [.] 0x00000000014de8
           3.35%   pidgin  /lib64/libc-2.10.1.so (deleted)                                      [.] 0x0000000007a875
           3.19%   pidgin  /lib64/libdbus-1.so.3.4.0.#prelink#.6mwgZP (deleted)                 [.] 0x0000000001d254
           3.06%   pidgin  /usr/lib64/libgtk-x11-2.0.so.0.1600.5.#prelink#.511hAl (deleted)     [.] 0x000000002334e7
           2.90%   pidgin  /usr/lib64/libgdk-x11-2.0.so.0.1600.5.#prelink#.5qlMo1 (deleted)     [.] 0x00000000037b2d
           1.84%   pidgin  [kernel]                                                             [k] do_sys_poll
           1.45%   pidgin  /usr/lib64/libX11.so.6.2.0.#prelink#.iR59Rx (deleted)                [.] 0x0000000004c751
      [acme@doppio linux-2.6-tip]$
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Luis Claudio R. Gonçalves <lclaudio@redhat.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20090811200436.GA3478@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1340e6bb
    • A
      perf tools: Fix fallback to cplus_demangle() when bfd_demangle() is not available · 247648e3
      Arnaldo Carvalho de Melo 提交于
      In old binutils we can't access bfd_demangle(), use
      cplus_demangle() just like oprofile.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Luis Claudio R. Gonçalves <lclaudio@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20090811192211.GG18061@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      247648e3
    • A
      perf report: Show the tid too in -D · 94a24752
      Arnaldo Carvalho de Melo 提交于
      This made it easier to find the firefox threading related
      bug.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <20090811192138.GE18061@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      94a24752
    • A
      perf record: Fix .tid and .pid fill-in when synthesizing events · 2a8083f0
      Arnaldo Carvalho de Melo 提交于
      Noticed when trying to record events for a firefox thread. We
      were synthesizing both .tid and .pid with the pid passed via
      --pid.
      
      Fix it by reading /proc/PID/status and getting the tgid
      to use in .pid, .tid gets the specified "pid".
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20090811192200.GF18061@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2a8083f0
    • F
      perf tools: Factorize the map helpers · 66e274f3
      Frederic Weisbecker 提交于
      Factorize the dso mapping helpers into a single purpose common file
      "util/map.c"
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Brice Goglin <Brice.Goglin@inria.fr>
      66e274f3
    • F
      perf tools: Factorize the event structure definitions in a single file · 1fe2c106
      Frederic Weisbecker 提交于
      Factorize the multiple definition of the events structures into a
      single util/event.h file.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Brice Goglin <Brice.Goglin@inria.fr>
      1fe2c106
    • F
      perf tools: Factorize high level dso helpers · cd84c2ac
      Frederic Weisbecker 提交于
      Factorize multiple definitions of high level dso helpers into the
      symbol source file.
      
      The side effect is a general export of the verbose and eprintf
      debugging helpers into a new file dedicated to debugging purposes.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Brice Goglin <Brice.Goglin@inria.fr>
      cd84c2ac
  7. 10 8月, 2009 1 次提交
  8. 09 8月, 2009 9 次提交
    • 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
    • B
      perf report: Fix and improve the displaying of per-thread event counters · 8d513270
      Brice Goglin 提交于
      Improve and fix the handling of per-thread counter stats
      recorded via perf record -s. Previously we only displayed
      it in debug printouts (-D) and even that output was hard
      to disambiguate.
      
      I moved everything to utils/values.[ch] so that we may reuse
      it in perf stat.
      
      We get something like this now:
      
       #  PID   TID  cache-misses  cache-references
         4658  4659        495581           3238779
         4658  4662        498246           3236823
         4658  4663        499531           3243162
      
      Then it'll be easy to add --pretty=raw to display a single line per thread/event.
      
      By the way, -S was also used for --symbol... So I used -T/--thread here.
      
      perf report: Add -T/--threads to display per-thread counter values
      
       We get something like this now:
       #  PID   TID  cache-misses  cache-references
         4658  4659        495581           3238779
         4658  4662        498246           3236823
         4658  4663        499531           3243162
      
      Per-thread arrays of counter values are managed in utils/values.[ch]
      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>
      8d513270
    • 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
    • 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