1. 26 5月, 2012 1 次提交
    • A
      perf tools: Reconstruct event with modifiers from perf_event_attr · c410431c
      Arnaldo Carvalho de Melo 提交于
      The modifiers:
      
        k		kernel space
        u		user space
        h		hypervisor
        G		guest
        H		host
        p, pp, ppp    precision level (PEBS)
      
      that can be suffixed to an event were lost when tools used event_name()
      to reconstruct them from the perf_event_attr entries in a perf.data
      file.
      
      Fix it by following the defaults used for these modifiers in the current
      codebase, so:
      
       $ perf record -e instructions:u usleep 1 2> /dev/null
       $ perf evlist
       instructions:u
       $ perf record -e cycles:k usleep 1 2> /dev/null
       $ perf evlist
       cycles:k
       $ perf record -e cycles:kh usleep 1 2> /dev/null
       $ perf evlist
       cycles:kh
       $ perf record -e cache-misses:G usleep 1 2> /dev/null
       $ perf evlist
       cache-misses:G
       $ perf record -e cycles:ppk usleep 1 2> /dev/null
       $ perf evlist
       cycles:kpp
       $
      
      Also works with 'top', 'report', etc.
      
      More work needed to cover tracepoints and software events while not
      dragging lots of baggage to the python binding, this is a minimal fix
      for v3.5.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-4hl5glle0hxlklw4usva1mkt@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c410431c
  2. 22 5月, 2012 4 次提交
  3. 18 5月, 2012 1 次提交
  4. 23 3月, 2012 2 次提交
  5. 17 3月, 2012 3 次提交
    • J
      perf tools: Add support to specify pmu style event · 5f537a26
      Jiri Olsa 提交于
      Added new event rule to the event definition grammar:
      
      event_def: event_pmu |
                 ...
      event_pmu: PE_NAME '/' event_config '/'
      
      Using this rule, event could be now specified like:
        cpu/config=1,config1=2,config2=3/u
      
      where pmu name 'cpu' is looked up via following path:
        ${sysfs_mount}/bus/event_source/devices/${pmu}
      
      and config options are bound to the pmu's format definiton:
        ${sysfs_mount}/bus/event_source/devices/${pmu}/format
      
      The hardcoded config options still stays and have precedence
      over any format field defined with same name.
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-50d8nr94f8k4wkezutrxvthe@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5f537a26
    • J
      perf tools: Add config options support for event parsing · 8f707d84
      Jiri Olsa 提交于
      Adding a new rule to the event grammar to be able to specify
      values of additional attributes of symbolic event.
      
      The new syntax for event symbolic definition is:
      
      event_legacy_symbol:  PE_NAME_SYM '/' event_config '/' |
                            PE_NAME_SYM sep_slash_dc
      
      event_config:         event_config ',' event_term | event_term
      
      event_term:           PE_NAME '=' PE_NAME |
                            PE_NAME '=' PE_VALUE
                            PE_NAME
      
      sep_slash_dc: '/' | ':' |
      
      At the moment the config options are hardcoded to be used for legacy
      symbol events to define several perf_event_attr fields. It is:
      
        'config'   to define perf_event_attr::config
        'config1'  to define perf_event_attr::config1
        'config2'  to define perf_event_attr::config2
        'period'   to define perf_event_attr::sample_period
      
      Legacy events could be now specified as:
        cycles/period=100000/
      
      If term is specified without the value assignment, then 1 is
      assigned by default.
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-mgkavww9790jbt2jdkooyv4q@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f707d84
    • J
      perf tools: Add parser generator for events parsing · 89812fc8
      Jiri Olsa 提交于
      Changing event parsing to use flex/bison parse generator.
      The event syntax stays as it was.
      
      grammar description:
      
      events: events ',' event | event
      
      event:  event_def PE_MODIFIER_EVENT | event_def
      
      event_def: event_legacy_symbol sep_dc     |
                 event_legacy_cache sep_dc      |
                 event_legacy_breakpoint sep_dc |
                 event_legacy_tracepoint sep_dc |
                 event_legacy_numeric sep_dc    |
                 event_legacy_raw sep_dc
      
      event_legacy_symbol:      PE_NAME_SYM
      
      event_legacy_cache:       PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT |
                                PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT  |
                                PE_NAME_CACHE_TYPE
      
      event_legacy_raw:         PE_SEP_RAW PE_VALUE
      
      event_legacy_numeric:     PE_VALUE ':' PE_VALUE
      
      event_legacy_breakpoint:  PE_SEP_BP ':' PE_VALUE ':' PE_MODIFIER_BP
      
      event_breakpoint_type:    PE_MODIFIER_BPTYPE | empty
      
      PE_NAME_SYM:              cpu-cycles|cycles                              |
                                stalled-cycles-frontend|idle-cycles-frontend   |
                                stalled-cycles-backend|idle-cycles-backend     |
                                instructions                                   |
                                cache-references                               |
                                cache-misses                                   |
                                branch-instructions|branches                   |
                                branch-misses                                  |
                                bus-cycles                                     |
                                cpu-clock                                      |
                                task-clock                                     |
                                page-faults|faults                             |
                                minor-faults                                   |
                                major-faults                                   |
                                context-switches|cs                            |
                                cpu-migrations|migrations                      |
                                alignment-faults                               |
                                emulation-faults
      
      PE_NAME_CACHE_TYPE:       L1-dcache|l1-d|l1d|L1-data             |
                                L1-icache|l1-i|l1i|L1-instruction      |
                                LLC|L2                                 |
                                dTLB|d-tlb|Data-TLB                    |
                                iTLB|i-tlb|Instruction-TLB             |
                                branch|branches|bpu|btb|bpc            |
                                node
      
      PE_NAME_CACHE_OP_RESULT:  load|loads|read                        |
                                store|stores|write                     |
                                prefetch|prefetches                    |
                                speculative-read|speculative-load      |
                                refs|Reference|ops|access              |
                                misses|miss
      
      PE_MODIFIER_EVENT:        [ukhp]{0,5}
      
      PE_MODIFIER_BP:           [rwx]
      
      PE_SEP_BP:                'mem'
      
      PE_SEP_RAW:               'r'
      
      sep_dc:                   ':' |
      
      Added flex/bison files for event grammar parsing. The generated
      parser is part of the patch. Added makefile rule 'event-parser'
      to generate the parser code out of the bison/flex sources.
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-u4pfig5waq3ll2bfcdex8fgi@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      89812fc8
  6. 14 3月, 2012 1 次提交
  7. 07 1月, 2012 2 次提交
  8. 21 12月, 2011 1 次提交
  9. 28 11月, 2011 1 次提交
    • A
      perf tools: Simplify debugfs mountpoint handling code · ebf294bf
      Arnaldo Carvalho de Melo 提交于
      We don't need to have two PATH_MAX char sized arrays holding it, just
      one in util/debugfs.c will do.
      
      Also rename debugfs_path to tracing_events_path, as it is not the path
      to debugfs, that is debugfs_mountpoint. Both are now accessible.
      
      This will allow accessing this code in the perf python binding without
      having to drag in perf.c and util/parse-events.c.
      
      The defaults for these variables are the canonical "/sys/kernel/debug"
      and "/sys/kernel/debug/tracing/events/", removing the need for simple
      tools to call debugfs_mount(NULL).
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-ug9jvtjrsqbluuhqqxpvg30f@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ebf294bf
  10. 18 8月, 2011 2 次提交
    • S
      perf tools: Fix error handling of unknown events · 777d1d71
      Stephane Eranian 提交于
      There was a problem with the parse_events() code not printing the
      correct event name when an event was unknown and starting with an 'r'.
      The source of the problem was the way raw notation was parsed.
      
      Without the patch:
      	$ perf stat -e retired_foo
      	invalid event modifier: 'tired_foo'
      
      With the patch:
      	$ perf stat -e retired_foo
      	invalid or unsupported event: 'retired_foo'
      
      This also covers the case where the name of the event was not printed at
      all when perf was linked with libpfm4.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20110723021043.GA20178@quadSigned-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      777d1d71
    • S
      perf list: Fix exit value · 77e57297
      Stephane Eranian 提交于
      This patch fixes an issue with the exit value of perf list:
      
      $ perf list; echo $?
      129
      
      perf list returns an error exit code even though there is no error.
      
      There was a stray exit(129) in print_events(). This patch removes this
      exit().
      
      $ perf list; echo $?
      0
      
      $ perf list hw sw
        cpu-cycles OR cycles                               [Hardware event]
        stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]
        stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
        instructions                                       [Hardware event]
        cache-references                                   [Hardware event]
        cache-misses                                       [Hardware event]
        branch-instructions OR branches                    [Hardware event]
        branch-misses                                      [Hardware event]
        bus-cycles                                         [Hardware event]
      
        cpu-clock                                          [Software event]
        task-clock                                         [Software event]
        page-faults OR faults                              [Software event]
        minor-faults                                       [Software event]
        major-faults                                       [Software event]
        context-switches OR cs                             [Software event]
        cpu-migrations OR migrations                       [Software event]
        alignment-faults                                   [Software event]
        emulation-faults                                   [Software event]
      $ echo $?
      0
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20110523123917.GA31060@quadSigned-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77e57297
  11. 21 7月, 2011 2 次提交
  12. 18 5月, 2011 1 次提交
    • S
      perf: Fix multi-event parsing bug · 94692349
      Stephane Eranian 提交于
      This patch fixes an issue with event parsing.
      The following commit appears to have broken the
      ability to specify a comma separated list of events:
      
         commit ceb53fbf
         Author: Ingo Molnar <mingo@elte.hu>
         Date:   Wed Apr 27 04:06:33 2011 +0200
      
             perf stat: Fail more clearly when an invalid modifier is specified
      
      This patch fixes this while preserving the desired effect:
      
      $ perf stat -e instructions:u,instructions:k ls /dev/null /dev/null
      
       Performance counter stats for 'ls /dev/null':
      
                  365956 instructions:u           #    0.00  insns per cycle
                  731806 instructions:k           #    0.00  insns per cycle
      
              0.001108862  seconds time elapsed
      
      $ perf stat -e task-clock-msecs true
      invalid event modifier: '-msecs'
      Run 'perf list' for a list of valid events and modifiers
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: acme@redhat.com
      Cc: peterz@infradead.org
      Cc: fweisbec@gmail.com
      Link: http://lkml.kernel.org/r/20110517133619.GA6999@quadSigned-off-by: NIngo Molnar <mingo@elte.hu>
      94692349
  13. 30 4月, 2011 1 次提交
  14. 29 4月, 2011 2 次提交
  15. 27 4月, 2011 5 次提交
  16. 15 3月, 2011 1 次提交
    • D
      perf script: Add support for H/W and S/W events · 1424dc96
      David Ahern 提交于
      Custom fields set for each type by prepending field argument with type.
      For file with multiple event types (e.g., trace and S/W) display of an
      event type suppressed by setting output fields to "".
      
      e.g.,
      perf record -ga -e sched:sched_switch -e cpu-clock -c 10000000 -R -- sleep 1
      perf script
      
      openssl 11496 [000]  9711.807107: cpu-clock-msecs:
              ffffffff810c22dc arch_local_irq_restore ([kernel.kallsyms])
              ffffffff810c518c __alloc_pages_nodemask ([kernel.kallsyms])
              ffffffff810297b2 pte_alloc_one ([kernel.kallsyms])
              ffffffff810d8b98 __pte_alloc ([kernel.kallsyms])
              ffffffff810daf07 handle_mm_fault ([kernel.kallsyms])
              ffffffff8138763a do_page_fault ([kernel.kallsyms])
              ffffffff81384a65 page_fault ([kernel.kallsyms])
                  7f6130507d70 asn1_check_tlen (/lib64/libcrypto.so.1.0.0c)
                             0  ()
      
               openssl 11496 [000]  9711.808042: sched_switch: prev_comm=openssl ...
           kworker/0:0     4 [000]  9711.808067: sched_switch: prev_comm=kworker/...
               swapper     0 [001]  9711.808090: sched_switch: prev_comm=kworker/...
                  sshd 11451 [001]  9711.808185: sched_switch: prev_comm=sshd pre...
      swapper     0 [001]  9711.816155: cpu-clock-msecs:
              ffffffff81023609 native_safe_halt ([kernel.kallsyms])
              ffffffff8100132a cpu_idle ([kernel.kallsyms])
              ffffffff8137cf9b start_secondary ([kernel.kallsyms])
      
      openssl 11496 [000]  9711.817104: cpu-clock-msecs:
                  7f61304ad723 AES_cbc_encrypt (/lib64/libcrypto.so.1.0.0c)
                  7fff3402f950  ()
              12f0debc9a785634  ()
      
      swapper     0 [001]  9711.826155: cpu-clock-msecs:
              ffffffff81023609 native_safe_halt ([kernel.kallsyms])
              ffffffff8100132a cpu_idle ([kernel.kallsyms])
              ffffffff8137cf9b start_secondary ([kernel.kallsyms])
      
      To suppress trace events within the file and use default output for S/W events:
      perf script -f trace:
      
      or to suppress S/W events and do default display for trace events:
      perf script -f sw:
      
      Custom field selections:
      perf script -f sw:comm,tid,time -f trace:time,trace
      
               openssl 11496  9711.797162:
               swapper     0  9711.807071:
               openssl 11496  9711.807107:
       9711.808042: prev_comm=openssl prev_pid=11496 prev_prio=120 prev_state=R ...
       9711.808067: prev_comm=kworker/0:0 prev_pid=4 prev_prio=120 prev_state=S ...
       9711.808090: prev_comm=kworker/0:0 prev_pid=0 prev_prio=120 prev_state=R ...
       9711.808185: prev_comm=sshd prev_pid=11451 prev_prio=120 prev_state=S ==>...
               swapper     0  9711.816155:
               openssl 11496  9711.817104:
               swapper     0  9711.826155:
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1299734608-5223-7-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1424dc96
  17. 18 2月, 2011 1 次提交
    • A
      perf list: Allow filtering list of events · 668b8788
      Arnaldo Carvalho de Melo 提交于
      The man page has the details, here are some examples:
      
      [root@emilia ~]# perf list *fault*  *:*wait*
      
      List of pre-defined events (to be used in -e):
        page-faults OR faults                      [Software event]
        minor-faults                               [Software event]
        major-faults                               [Software event]
        alignment-faults                           [Software event]
        emulation-faults                           [Software event]
      
        radeon:radeon_fence_wait_begin             [Tracepoint event]
        radeon:radeon_fence_wait_end               [Tracepoint event]
        writeback:wbc_writeback_wait               [Tracepoint event]
        writeback:wbc_balance_dirty_wait           [Tracepoint event]
        writeback:writeback_congestion_wait        [Tracepoint event]
        writeback:writeback_wait_iff_congested     [Tracepoint event]
        sched:sched_wait_task                      [Tracepoint event]
        sched:sched_process_wait                   [Tracepoint event]
        sched:sched_stat_wait                      [Tracepoint event]
        sched:sched_stat_iowait                    [Tracepoint event]
        syscalls:sys_enter_epoll_wait              [Tracepoint event]
        syscalls:sys_exit_epoll_wait               [Tracepoint event]
        syscalls:sys_enter_epoll_pwait             [Tracepoint event]
        syscalls:sys_exit_epoll_pwait              [Tracepoint event]
        syscalls:sys_enter_rt_sigtimedwait         [Tracepoint event]
        syscalls:sys_exit_rt_sigtimedwait          [Tracepoint event]
        syscalls:sys_enter_waitid                  [Tracepoint event]
        syscalls:sys_exit_waitid                   [Tracepoint event]
        syscalls:sys_enter_wait4                   [Tracepoint event]
        syscalls:sys_exit_wait4                    [Tracepoint event]
        syscalls:sys_enter_waitpid                 [Tracepoint event]
        syscalls:sys_exit_waitpid                  [Tracepoint event]
      [root@emilia ~]#
      Suggested-by: NIngo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      668b8788
  18. 17 2月, 2011 1 次提交
    • S
      perf: make perf stat print user provided full event names · f0c55bcf
      Stephane Eranian 提交于
      This patch changes the way perf stat prints event names at the end of a
      run. Until now, it was trying to reconstruct the event name from its
      encoding. The problem is that it would only print generic events without
      their modifiers (u, k, pp).
      
      This patch saves the event name as passed by the user in the evsel
      struct and uses it to print the final event name.
      
      This would also work in case perf is linked with a library (such as
      libpfm4) which provides full PMU event tables.
      
      $ perf stat -e cycles:u,cycles:k date
      Wed Feb 16 14:58:52 CET 2011
      
       Performance counter stats for 'date':
      
                  568600 cycles:u
                 2779715 cycles:k
      
              0.001908182  seconds time elapsed
      
      Cc: Arun Sharma <arun@sharma-home.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@gmail.com>
      LPU-Reference: <4d5bdc64.98a1df0a.7aa3.06c2@mx.google.com>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      [ committer note: Fixed a merge problem with 023695d9 "Add cgroup support" ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f0c55bcf
  19. 24 1月, 2011 1 次提交
    • A
      perf tools: Pass the struct opt to the wildcard parsing routine · 17ea1b70
      Arnaldo Carvalho de Melo 提交于
      It is needed because it will call parse_event for each tracepoint
      name that matches, and we pass the perf_evlist via opt->value.
      
      Problem introduced in 4503fdd where my assumption about opt being
      always non NULL made me not look at callers of parse_events outside
      builtin-*.c.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      17ea1b70
  20. 23 1月, 2011 2 次提交
    • A
      perf evsel: Introduce perf_evlist · 361c99a6
      Arnaldo Carvalho de Melo 提交于
      Killing two more perf wide global variables: nr_counters and evsel_list
      as a list_head.
      
      There are more operations that will need more fields in perf_evlist,
      like the pollfd for polling all the fds in a list of evsel instances.
      
      Use option->value to pass the evsel_list to parse_{events,filters}.
      
      LKML-Reference: <new-submission>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      361c99a6
    • A
      perf tools: Fix 64 bit integer format strings · 9486aa38
      Arnaldo Carvalho de Melo 提交于
      Using %L[uxd] has issues in some architectures, like on ppc64.  Fix it
      by making our 64 bit integers typedefs of stdint.h types and using
      PRI[ux]64 like, for instance, git does.
      
      Reported by Denis Kirjanov that provided a patch for one case, I went
      and changed all cases.
      Reported-by: NDenis Kirjanov <dkirjanov@kernel.org>
      Tested-by: NDenis Kirjanov <dkirjanov@kernel.org>
      LKML-Reference: <20110120093246.GA8031@hera.kernel.org>
      Cc: Denis Kirjanov <dkirjanov@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Pingtian Han <phan@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9486aa38
  21. 18 1月, 2011 2 次提交
    • A
      perf tools: Fix tracepoint id to string perf.data header table · ad7f4e3f
      Arnaldo Carvalho de Melo 提交于
      It was broken by f006d25a that passed just the event name, not the complete
      sys:event that it expected to open the /sys/.../sys/sys:event/id file to get
      the id.
      
      Fix it by moving it to after parse_events in cmd_record, as at that point
      we can just traverse the evsel_list and use evsel->attr.config +
      event_name(evsel) instead of re-opening the /id file.
      Reported-by: NFranck Bui-Huu <vagabon.xyz@gmail.com>
      Cc: Franck Bui-Huu <vagabon.xyz@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Han Pingtian <phan@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <20110117202801.GG2085@ghostprotocols.net>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ad7f4e3f
    • A
      perf tools: Fix handling of wildcards in tracepoint event selectors · dd9a9ad5
      Arnaldo Carvalho de Melo 提交于
      It wasn't accounting the ':' when consuming bytes in the the event
      selector string, so parse_events() would fail in this test:
      
                      if (!(*str == 0 || *str == ',' || isspace(*str)))
                              return -1;
      
      as *str would be pointing to '*', the last character in the '-e' arg in:
      
      $ perf record -q -a -D -e sched:sched_* | perf script -i - -s perf-script.py
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dd9a9ad5
  22. 07 1月, 2011 2 次提交
    • L
      perf tools: Pass whole attr to event selectors · 23a2f3ab
      Lin Ming 提交于
      Since commit 69aad6f1(perf tools: Introduce event selectors), only
      perf_event_attr::type and ::config are passed to event selector, which
      makes perf tool not work correctly.
      
      For example, PEBS does not work because perf_event_attr::precise_ip is
      not passed to the syscall.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1294369869.20563.19.camel@minggr.sh.intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      23a2f3ab
    • H
      perf tools: Fix buffer overflow error when specifying all tracepoints · f006d25a
      Han Pingtian 提交于
      I found when specifying all tracepoints with -e to one of subcommand,
      such as 'stat', the program will trigger a buffer overflow error, like
      this:
      
      *** buffer overflow detected ***: ./perf terminated
      ======= Backtrace: =========
      /lib64/libc.so.6(__fortify_fail+0x37)[0x382cefb2c7]
      ....
      
      The tracepoints are separated by comma, something like this:
      
      $ perf stat -a -e `perf list |grep Tracepoint|awk -F'[' '{gsub(/[[:space:]]+/,"",$1);array[FNR]=$1}END{outputs=array[1];for (i=2;i<=FNR;i++){ outputs=outputs "," array[i];};print outputs}'`
      
      The root reason of this problem is that store_event_type() is called for all
      events, and will overflow the 'filename' at:
      
          strncat(filename, orgname, strlen(orgname));
      
      This patch fixes it by calling store_event_type() only when the event name has
      been found.
      
      LKML-Reference: <20110106093922.GB6713@hpt.nay.redhat.com>
      Signed-off-by: NHan Pingtian <phan@redhat.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f006d25a
  23. 04 1月, 2011 1 次提交