1. 04 4月, 2010 8 次提交
    • H
      perf: Swap inclusion order of util.h and string.h in util/string.c · 8141d005
      Hitoshi Mitake 提交于
      Currently util/string.c includes headers in this order: string.h, util.h
      But this causes a build error because __USE_GNU definition
      is needed for strndup() definition:
      
      	% make -j
      	touch .perf.dev.null
      	    CC util/string.o
      	cc1: warnings being treated as errors
      	util/string.c: In function ‘argv_split’:
      	util/string.c:171: error: implicit declaration of function ‘strndup’
      	util/string.c:171: error: incompatible implicit declaration of built-in function ‘strndup’
      
      So this patch swaps the headers inclusion order.
      util.h defines _GNU_SOURCE, and /usr/include/features.h defines
      __USE_GNU as 1 if _GNU_SOURCE is defined.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      8141d005
    • A
      perf_event: Make perf fd non seekable · 3326c1ce
      Arnd Bergmann 提交于
      Perf_event does not need seeking, so prevent it in order to
      get rid of default_llseek, which uses the BKL.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      [drop the nonseekable_open, not needed for anon inodes]
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      3326c1ce
    • F
      perf: Fetch hot regs from the template caller · 6cc8a7c1
      Frederic Weisbecker 提交于
      Trace events can be defined from a template using
      DECLARE_EVENT_CLASS/DEFINE_EVENT or directly with TRACE_EVENT.
      
      In both cases we have a template tracepoint handler, used to
      record the trace, to which we pass our ftrace event instance.
      
      In the function level, if the class is named "foo" and the event
      is named "blah", we have the following chain of calls:
      
      perf_trace_blah() -> perf_trace_templ_foo()
      
      In the case we have several events sharing the class "blah",
      we'll have multiple users of perf_trace_templ_foo(), and it
      won't be inlined by the compiler. This is usually what happens
      with the DECLARE_EVENT_CLASS/DEFINE_EVENT based definition.
      
      But if perf_trace_blah() is the only caller of perf_trace_templ_foo()
      there are fair chances that it will be inlined.
      
      The problem is that we fetch the regs from perf_trace_templ_foo()
      after we rewinded the frame pointer to the second caller, we want
      to reach the caller of perf_trace_blah() to get the right source
      of the event. And we do this by always assuming that
      perf_trace_templ_foo() is not inlined. But as shown above this
      is not always true. And if it is inlined we miss the first caller,
      losing the most important level of precision.
      
      We get:
      	    61.31%       ls  [kernel.kallsyms]  [k] do_softirq
                               |
                               --- do_softirq
                                   irq_exit
                                   do_IRQ
                                   common_interrupt
                                  |
                                  |--25.00%-- tty_buffer_request_room
      
      Instead of:
      	    61.31%       ls  [kernel.kallsyms]  [k] __do_softirq
                               |
                               --- __do_softirq
                                   do_softirq
                                   irq_exit
                                   do_IRQ
                                   common_interrupt
                                  |
                                  |--25.00%-- tty_buffer_request_room
      
      To fix this, we fetch the regs from perf_trace_blah() rather than
      perf_trace_templ_foo() so that we don't have to deal with inlining
      surprises.
      
      That also bring us the advantage of having the true source of the
      event even if we don't have frame pointers.
      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: Ingo Molnar <mingo@elte.hu>
      6cc8a7c1
    • F
      perf: Drop the frame reliablity check · 6f4dee06
      Frederic Weisbecker 提交于
      It is useless now that we have a pure stack frame
      walker, as given addr are always reliable.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      6f4dee06
    • A
      perf TUI: Add a "Zoom into COMM(PID) thread" and reverse operations · a5e29aca
      Arnaldo Carvalho de Melo 提交于
      Now one can press the right arrow key and in addition to being able to
      filter by DSO, filter out by thread too, or a combination of both
      filters.
      
      With this one can start collecting events for the whole system, then
      focus on a subset of the collected data quickly.
      
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a5e29aca
    • A
      perf newt: Add a "Zoom into foo.so DSO" and reverse operations · 83753190
      Arnaldo Carvalho de Melo 提交于
      Clicking on -> will bring as one of the popup menu options a "Zoom into
      CURRENT DSO", i.e. CURRENT will be replaced by the name of the DSO in
      the current line.
      
      Choosing this option will filter out all samples that didn't took place
      in a symbol in this DSO.
      
      After that the option reverts to "Zoom out of CURRENT DSO", to allow
      going back to the more compreensive view, not filtered by DSO.
      
      Future similar operations will include zooming into a particular thread,
      COMM, CPU, "last minute", "last N usecs", etc.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      83753190
    • I
      Merge branch 'perf/urgent' into perf/core · 22a4e4c4
      Ingo Molnar 提交于
      Conflicts:
      	tools/perf/Makefile
      
      Merge reason: resolve the conflict.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      22a4e4c4
    • I
  2. 03 4月, 2010 32 次提交