1. 02 8月, 2012 4 次提交
  2. 30 7月, 2012 14 次提交
  3. 26 7月, 2012 9 次提交
  4. 25 7月, 2012 13 次提交
    • N
      tools lib traceevent: Ignore TRACEEVENT-CFLAGS file · 52f18a2f
      Namhyung Kim 提交于
      The TRACEEVENT-CFLAGS file is used to detect any change on compiler
      flags. Just ignore it.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1341559297-25725-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      52f18a2f
    • N
      tools lib traceevent: Detect build environment changes · 52b5c0d4
      Namhyung Kim 提交于
      Cross compiling perf requires setting ARCH and CROSS_COMPILE variables,
      but libtraceevent couldn't detect the changes so it ends up believing no
      recompiling is required. Thus the linker failed like:
      
           LINK perf
       ../lib/traceevent//libtraceevent.a: member ../lib/traceevent//libtraceevent.a(event-parse.o) in archive is not an object
       collect2: ld returned 1 exit status
       make: *** [perf] Error 1
      
      This patch fixes this by adding TRACEEVENT-CFLAGS file like
      PERF-CFLAGS to track those changes.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1341559297-25725-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      52b5c0d4
    • K
      perf tools: Fix build error with bison 2.6 · 043d1a5c
      Kirill A. Shutemov 提交于
      Bison 2.6 started to generate parse_events_parse() declaration in header. In
      this case we have redundant redeclaration:
      
      util/parse-events.c:29:5: error: redundant redeclaration of ‘parse_events_parse’ [-Werror=redundant-decls]
      In file included from util/parse-events.c:14:0:
      util/parse-events-bison.h:99:5: note: previous declaration of ‘parse_events_parse’ was here
      cc1: all warnings being treated as errors
      
      Let's disable -Wredundant-decls for util/parse-events.c since it includes
      header we can't control.
      Signed-off-by: NKirill A. Shutemov <kirill@shutemov.name>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20120723210407.GA25186@shutemov.nameSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      043d1a5c
    • K
      perf tools: use XSI-complaint version of strerror_r() instead of GNU-specific · 4cc49d4d
      Kirill A. Shutemov 提交于
      Perf uses GNU-specific version of strerror_r(). The GNU-specific strerror_r()
      returns a pointer to a string containing the error message.  This may be either
      a pointer to a string that the function stores in buf, or a pointer to some
      (immutable) static string (in which case buf is unused).
      
      In glibc-2.16 GNU version was marked with attribute warn_unused_result.  It
      triggers few warnings in perf:
      
      util/target.c: In function ‘perf_target__strerror’:
      util/target.c:114:13: error: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Werror=unused-result]
      ui/browsers/hists.c: In function ‘hist_browser__dump’:
      ui/browsers/hists.c:981:13: error: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Werror=unused-result]
      
      They are bugs.
      
      Let's fix strerror_r() usage.
      Signed-off-by: NKirill A. Shutemov <kirill@shutemov.name>
      Acked-by: NUlrich Drepper <drepper@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/20120723210654.GA25248@shutemov.name
      [ committer note: s/assert/BUG_ON/g ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4cc49d4d
    • J
      perf tools: Make the breakpoint events sample period default to 1 · 4a841d65
      Jovi Zhang 提交于
      There have one problem about hw_breakpoint perf event, as watched, the
      events reported to userspace is not correctly, sometime one trigger
      bp_event report several events, sometime bp_event cannot go through to
      user.
      
      The root cause is attr->freq is 1 passed to kernel defaultly in bp
      events, this make kernel calculate event period not as expect, make
      sample period to 1 will change attr->freq to 0, to fix this problem.
      
      This patch is similar with commit f92128 about tracepoint events:
          perf: Make the trace events sample period default to 1
      Signed-off-by: NJovi Zhang <bookjovi@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/CACV3sbLF8taiCq_VYW-sgRJyupeMzg58C7ZXfMe3xZUiH_Mx6w@mail.gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4a841d65
    • J
      perf test: Add dso data caching tests · f7add556
      Jiri Olsa 提交于
      Adding automated test for DSO data reading. Testing raw/cached reads
      from different file/cache locations.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1342959280-5361-18-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f7add556
    • J
      perf symbols: Add dso data caching · 4dff624a
      Jiri Olsa 提交于
      Adding dso data caching so we don't need to open/read/close, each time
      we want dso data.
      
      The DSO data caching affects following functions:
        dso__data_read_offset
        dso__data_read_addr
      
      Each DSO read tries to find the data (based on offset) inside the cache.
      If it's not present it fills the cache from file, and returns the data.
      If it is present, data are returned with no file read.
      
      Each data read is cached by reading cache page sized/aligned amount of
      DSO data. The cache page size is hardcoded to 4096.  The cache is using
      RB tree with file offset as a sort key.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1342959280-5361-17-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4dff624a
    • J
      perf symbols: Add interface to read DSO image data · 949d160b
      Jiri Olsa 提交于
      Adding following interface for DSO object to allow
      reading of DSO image data:
      
        dso__data_fd
          - opens DSO and returns file descriptor
            Binary types are used to locate/open DSO in following order:
              DSO_BINARY_TYPE__BUILD_ID_CACHE
              DSO_BINARY_TYPE__SYSTEM_PATH_DSO
            In other word we first try to open DSO build-id path,
            and if that fails we try to open DSO system path.
      
        dso__data_read_offset
          - reads DSO data from specified offset
      
        dso__data_read_addr
          - reads DSO data from specified address/map.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1342959280-5361-11-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      949d160b
    • J
      perf symbols: Factor DSO symtab types to generic binary types · 44f24cb3
      Jiri Olsa 提交于
      Adding interface to access DSOs so it could be used
      from another place.
      
      New DSO binary type is added - making current SYMTAB__*
      types more general:
         DSO_BINARY_TYPE__* = SYMTAB__*
      
      Following function is added to return path based on the specified
      binary type:
         dso__binary_type_file
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1342959280-5361-10-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      44f24cb3
    • F
      perf hists: Print newline between hists callchains · 6654f5d8
      Frederic Weisbecker 提交于
      Tiny cosmetic fix. The lack of a newline between hists callchains was
      looking slightly messy.
      
      Before:
      
           0.24%      swapper  [kernel.kallsyms]  [k] _raw_spin_lock_irq
                      |
                      --- _raw_spin_lock_irq
                          run_timer_softirq
                          __do_softirq
                          call_softirq
                          do_softirq
                          irq_exit
                          smp_apic_timer_interrupt
                          apic_timer_interrupt
                          default_idle
                          amd_e400_idle
                          cpu_idle
                          start_secondary
           0.10%         perf  [kernel.kallsyms]  [k] lock_is_held
                         |
                         --- lock_is_held
                             __might_sleep
                             mutex_lock_nested
                             perf_event_for_each_child
                             perf_ioctl
                             do_vfs_ioctl
                             sys_ioctl
                             system_call_fastpath
                             ioctl
                             cmd_record
                             run_builtin
                             main
                             __libc_start_main
      
      After:
      
           0.24%      swapper  [kernel.kallsyms]  [k] _raw_spin_lock_irq
                      |
                      --- _raw_spin_lock_irq
                          run_timer_softirq
                          __do_softirq
                          call_softirq
                          do_softirq
                          irq_exit
                          smp_apic_timer_interrupt
                          apic_timer_interrupt
                          default_idle
                          amd_e400_idle
                          cpu_idle
                          start_secondary
      
           0.10%         perf  [kernel.kallsyms]  [k] lock_is_held
                         |
                         --- lock_is_held
                             __might_sleep
                             mutex_lock_nested
                             perf_event_for_each_child
                             perf_ioctl
                             do_vfs_ioctl
                             sys_ioctl
                             system_call_fastpath
                             ioctl
                             cmd_record
                             run_builtin
                             main
                             __libc_start_main
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1342631456-7233-3-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6654f5d8
    • F
      perf tools: Fix trace events storms due to weight demux · 0983cc0d
      Frederic Weisbecker 提交于
      Trace events have a period (weight) of 1 by default. This can be
      overriden on events definition by using the __perf_count() macro.
      
      For example, the sched_stat_runtime() is weighted with the runtime of
      the task that fired the event.
      
      By default, perf handles such weighted event by dividing it into
      individual events carrying a weight of 1. For example if
      sched_stat_runtime is fired and the task has run 5000000 nsecs, perf
      divides it into 5000000 events in the buffer.
      
      This behaviour makes weighted events unusable because they quickly
      fullfill the buffers and we lose most events.
      
      The commit 5d81e5cf ("events: Don't
      divide events if it has field period") solves this problem by sending
      only one event when PERF_SAMPLE_PERIOD flag is set. The weight is
      carried in the sample itself such that we don't need to demultiplex it
      anymore.
      
      This patch provides the last missing piece to use this feature by
      setting PERF_SAMPLE_PERIOD from perf tools when we deal with trace
      events.
      
      Before:
      	$ ./perf record -e sched:* -a sleep 1
      	[ perf record: Woken up 3 times to write data ]
      	[ perf record: Captured and wrote 1.619 MB perf.data (~70749 samples) ]
      	Warning:
      	Processed 16909 events and lost 1 chunks!
      
      	Check IO/CPU overload!
      
      	$ ./perf script
      	perf  1894 [003]   824.898327: sched_migrate_task: comm=perf pid=1898 prio=120 orig_cpu=2 dest_cpu=0
      	perf  1894 [003]   824.898335: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898336: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898337: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898338: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898339: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898340: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	perf  1894 [003]   824.898341: sched_stat_sleep: comm=perf pid=1898 delay=113179500 [ns]
      	[...]
      
      After:
      	$ ./perf record -e sched:* -a sleep 1
      	[ perf record: Woken up 1 times to write data ]
      	[ perf record: Captured and wrote 0.074 MB perf.data (~3228 samples) ]
      
      	$ ./perf script
      
      	perf  1461 [000]   554.286957: sched_migrate_task: comm=perf pid=1465 prio=120 orig_cpu=3 dest_cpu=1
      	perf  1461 [000]   554.286964: sched_stat_sleep: comm=perf pid=1465 delay=133047190 [ns]
      	perf  1461 [000]   554.286967: sched_wakeup: comm=perf pid=1465 prio=120 success=1 target_cpu=001
      	swapper     0 [001]   554.286976: sched_stat_wait: comm=perf pid=1465 delay=0 [ns]
      	swapper     0 [001]   554.286983: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=perf
      	[...]
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1342631456-7233-1-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0983cc0d
    • F
      perf hists: Return correct number of characters printed in callchain · 8760db72
      Frederic Weisbecker 提交于
      Include the omitted number of characters printed for the first entry.
      
      Not that it really matters because nobody seem to care about the number
      of printed characters for now. But just in case.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1342631456-7233-2-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8760db72
    • D
      perf tools: Dump exclude_{guest,host}, precise_ip header info too · 78b961ff
      David Ahern 提交于
      Adds the attributes to the event line in the header dump.
      From:
       event : name = cycles, type = 0, config = 0x0, config1 = 0x0,
            config2 = 0x0, excl_usr = 0, excl_kern = 0, ...
      to
        event : name = cycles, type = 0, config = 0x0, config1 = 0x0,
            config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0,
            excl_guest = 0, precise_ip = 0, ...
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1342826756-64663-8-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      78b961ff