1. 15 9月, 2012 1 次提交
  2. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  3. 09 9月, 2012 1 次提交
  4. 07 9月, 2012 2 次提交
    • A
      perf test: Add roundtrip test for hardware cache events · 49f20d72
      Arnaldo Carvalho de Melo 提交于
      That nicely catches the problem reported by Joel Uckelman in
      http://permalink.gmane.org/gmane.linux.kernel.perf.user/1016 :
      
        [root@sandy ~]# perf test
         1: vmlinux symtab matches kallsyms: Ok
         2: detect open syscall event: Ok
         3: detect open syscall event on all cpus: Ok
         4: read samples using the mmap interface: Ok
         5: parse events tests: Ok
         6: x86 rdpmc test: Ok
         7: Validate PERF_RECORD_* events & perf_sample fields: Ok
         8: Test perf pmu format parsing: Ok
         9: Test dso data interface: Ok
        10: roundtrip evsel->name check: FAILED!
      
        [root@sandy ~]# perf test -v 10
        10: roundtrip evsel->name check:
        --- start ---
        L1-dcache-misses != L1-dcache-load-misses
        L1-dcache-misses != L1-dcache-store-misses
        L1-dcache-misses != L1-dcache-prefetch-misses
        L1-icache-misses != L1-icache-load-misses
        L1-icache-misses != L1-icache-prefetch-misses
        LLC-misses != LLC-load-misses
        LLC-misses != LLC-store-misses
        LLC-misses != LLC-prefetch-misses
        dTLB-misses != dTLB-load-misses
        dTLB-misses != dTLB-store-misses
        dTLB-misses != dTLB-prefetch-misses
        iTLB-misses != iTLB-load-misses
        branch-misses != branch-load-misses
        node-misses != node-load-misses
        node-misses != node-store-misses
        node-misses != node-prefetch-misses
        ---- end ----
        roundtrip evsel->name check: FAILED!
      
        [root@sandy ~]#
      
      Now lemme apply Jiri's fix and try it again...
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Joel Uckelman <joel@lightboxtechnologies.com>
      Cc: Jiri Olsa <jolsa@redhat.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-bbewtxw0rfipp5qy1j3jtg5d@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      49f20d72
    • A
      perf test: Add round trip test for sw and hw event names · 8ad7013b
      Arnaldo Carvalho de Melo 提交于
      It basically traverses the hardware and software event name arrays
      creating an evlist with all events, then it uses perf_evsel__name to
      check that the name is the expected one.
      
      With it I noticed this problem:
      
      [root@sandy ~]# perf test 10
      10: roundtrip evsel->name check:invalid or unsupported event: 'CPU-migrations'
      Run 'perf list' for a list of valid events
       FAILED!
      
      Changed it to "cpu-migrations" in the software event arrays and it
      worked.
      
      This is to catch problems like the one reported by Joel Uckelman in
      http://permalink.gmane.org/gmane.linux.kernel.perf.user/1016
      
      Hardware cache events will be checked in the following patch.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.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-5jskfkuqvf2fi257zmni0ftz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8ad7013b
  5. 15 8月, 2012 2 次提交
    • A
      perf evlist: Introduce evsel list accessors · 0c21f736
      Arnaldo Carvalho de Melo 提交于
      To replace the longer list_entry constructs for things that are widely
      used:
      
      	perf_evlist__{first,last}(evlist)
      	perf_evsel__next(evsel)
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.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-ng7azq26wg1jd801qqpcozwp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0c21f736
    • J
      perf tools: Enable grouping logic for parsed events · 6a4bb04c
      Jiri Olsa 提交于
      This patch adds a functionality that allows to create event groups
      based on the way they are specified on the command line. Adding
      functionality to the '{}' group syntax introduced in earlier patch.
      
      The current '--group/-g' option behaviour remains intact. If you
      specify it for record/stat/top command, all the specified events
      become members of a single group with the first event as a group
      leader.
      
      With the new '{}' group syntax you can create group like:
        # perf record -e '{cycles,faults}' ls
      
      resulting in single event group containing 'cycles' and 'faults'
      events, with cycles event as group leader.
      
      All groups are created with regards to threads and cpus. Thus
      recording an event group within a 2 threads on server with
      4 CPUs will create 8 separate groups.
      
      Examples (first event in brackets is group leader):
      
        # 1 group (cpu-clock,task-clock)
        perf record --group -e cpu-clock,task-clock ls
        perf record -e '{cpu-clock,task-clock}' ls
      
        # 2 groups (cpu-clock,task-clock) (minor-faults,major-faults)
        perf record -e '{cpu-clock,task-clock},{minor-faults,major-faults}' ls
      
        # 1 group (cpu-clock,task-clock,minor-faults,major-faults)
        perf record --group -e cpu-clock,task-clock -e minor-faults,major-faults ls
        perf record -e '{cpu-clock,task-clock,minor-faults,major-faults}' ls
      
        # 2 groups (cpu-clock,task-clock) (minor-faults,major-faults)
        perf record -e '{cpu-clock,task-clock} -e '{minor-faults,major-faults}' \
         -e instructions ls
      
        # 1 group
        # (cpu-clock,task-clock,minor-faults,major-faults,instructions)
        perf record --group -e cpu-clock,task-clock \
         -e minor-faults,major-faults -e instructions ls perf record -e
      '{cpu-clock,task-clock,minor-faults,major-faults,instructions}' ls
      
      It's possible to use standard event modifier for a group, which spans
      over all events in the group and updates each event modifier settings,
      for example:
      
        # perf record -r '{faults:k,cache-references}:p'
      
      resulting in ':kp' modifier being used for 'faults' and ':p' modifier
      being used for 'cache-references' event.
      Reviewed-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/n/tip-ho42u0wcr8mn1otkalqi13qp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6a4bb04c
  6. 02 8月, 2012 3 次提交
  7. 25 7月, 2012 1 次提交
    • 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
  8. 20 6月, 2012 1 次提交
  9. 22 5月, 2012 1 次提交
  10. 17 5月, 2012 1 次提交
  11. 03 5月, 2012 3 次提交
  12. 17 4月, 2012 1 次提交
  13. 23 3月, 2012 1 次提交
  14. 17 3月, 2012 4 次提交
    • 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 perf pmu object to access pmu format definition · cd82a32e
      Jiri Olsa 提交于
      Adding pmu object which provides interface to pmu's sysfs
      event format definition located at:
        ${sysfs_mount}/bus/event_source/devices/${pmu}/format
      
      Following interface is exported:
        struct perf_pmu* perf_pmu__find(char *name);
        - this function returns pmu object, which is then
          passed as a handle to other interface functions
      
        int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
                             struct list_head *head_terms);
        - this function configures perf_event_attr struct based
          on pmu's format definitions and config terms data,
          containined in head_terms list.
      
      Parser generator is used to retrive the pmu's format definition.
      The generated parser is part of the patch. Added makefile rule
      'pmu-parser' to generate the parser code out of the bison/flex
      sources.
      
      Added builtin test 'Test perf pmu format parsing', which could
      be run like:
      	perf test pmu
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-errz96u1668gj9wlop1zhpht@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cd82a32e
    • 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
  15. 15 2月, 2012 1 次提交
  16. 14 2月, 2012 1 次提交
  17. 25 1月, 2012 1 次提交
  18. 08 1月, 2012 1 次提交
  19. 21 12月, 2011 2 次提交
  20. 03 12月, 2011 1 次提交
  21. 02 12月, 2011 1 次提交
    • A
      perf test: Validate PERF_RECORD_ events and perf_sample fields · 3e7c439a
      Arnaldo Carvalho de Melo 提交于
      This new test will validate these new routines extracted from 'perf
      record':
      
       - perf_evlist__config_attrs
       - perf_evlist__prepare_workload
       - perf_evlist__start_workload
      
      In addition to several other perf_evlist methods.
      
      It consists of starting a simple workload, setting up just one event to
      monitor ("cycles") requesting that several PERF_SAMPLE_ fields be
      present in all events.
      
      It then will check that the expected PERF_RECORD_ events are produced
      and will sanity check all its fields.
      
      Some checks performed:
      
      . PERF_SAMPLE_TIME monotonically increases.
      
      . PERF_SAMPLE_CPU is the one requested with sched_setaffinity
      
      . PERF_SAMPLE_TID and PERF_SAMPLE_PID matches the one we forked
        in perf_evlist__prepare_workload and that is stored in
        evlist->workload.pid
      
      . For the events where these fields are also present in its
        pre-sample_id_all fields (e.g. event->mmap.pid), that they are what
        is expected too.
      
      . That we get a bunch of mmaps:
      
        PATH/libcSUFFIX
        PATH/ldSUFFIX
        [vdso]
        PATH/sleep
      
      Example:
      
        [root@emilia ~]# taskset -c 3,4 perf test -v1 perf_sample
         6: Validate PERF_RECORD_* events & perf_sample fields:
        --- start ---
        7159480799825 3 PERF_RECORD_SAMPLE
        7159480805584 3 PERF_RECORD_SAMPLE
        7159480807814 3 PERF_RECORD_SAMPLE
        7159480810430 3 PERF_RECORD_SAMPLE
        7159480861511 3 PERF_RECORD_MMAP 8086/8086: [0x7fffffffd000(0x2000) @ 0x7fffffffd000]: //anon
        7159481052516 3 PERF_RECORD_COMM: sleep:8086
        7159481070188 3 PERF_RECORD_MMAP 8086/8086: [0x400000(0x6000) @ 0]: /bin/sleep
        7159481077104 3 PERF_RECORD_MMAP 8086/8086: [0x3d06400000(0x221000) @ 0]: /lib64/ld-2.12.so
        7159481092912 3 PERF_RECORD_MMAP 8086/8086: [0x7fff1adff000(0x1000) @ 0x7fff1adff000]: [vdso]
        7159481196779 3 PERF_RECORD_MMAP 8086/8086: [0x3d06800000(0x37f000) @ 0]: /lib64/libc-2.12.so
        7160481558435 3 PERF_RECORD_EXIT(8086:8086):(8086:8086)
        ---- end ----
        Validate PERF_RECORD_* events & perf_sample fields: Ok
        [root@emilia ~]#
      
      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-svag18v2z4idas0dyz3umjpq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3e7c439a
  22. 30 11月, 2011 1 次提交
    • A
      perf test: Allow running just a subset of the available tests · e60770a0
      Arnaldo Carvalho de Melo 提交于
      To obtain a list of available tests:
      
      [root@emilia linux]# perf test list
       1: vmlinux symtab matches kallsyms
       2: detect open syscall event
       3: detect open syscall event on all cpus
       4: read samples using the mmap interface
       5: parse events tests
      [root@emilia linux]#
      
      To list just a subset:
      
      [root@emilia linux]# perf test list syscall
       2: detect open syscall event
       3: detect open syscall event on all cpus
      [root@emilia linux]#
      
      To run a subset:
      
      [root@emilia linux]# perf test detect
       2: detect open syscall event: Ok
       3: detect open syscall event on all cpus: Ok
      [root@emilia linux]#
      
      Specific tests can be chosen by number:
      
      [root@emilia linux]# perf test 1 3 parse
       1: vmlinux symtab matches kallsyms: Ok
       3: detect open syscall event on all cpus: Ok
       5: parse events tests: Ok
      [root@emilia linux]#
      
      Now to write more tests!
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      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-nqec2145qfxdgimux28aw7v8@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e60770a0
  23. 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
  24. 26 10月, 2011 1 次提交
  25. 24 9月, 2011 1 次提交
    • D
      perf tool: Fix endianness handling of u32 data in samples · 936be503
      David Ahern 提交于
      Currently, analyzing PPC data files on x86 the cpu field is always 0 and
      the tid and pid are backwards. For example, analyzing a PPC file on PPC
      the pid/tid fields show:
      
              rsyslogd  1210/1212
      
      and analyzing the same PPC file using an x86 perf binary shows:
      
              rsyslogd  1212/1210
      
      The problem is that the swap_op method for samples is
      perf_event__all64_swap which assumes all elements in the sample_data
      struct are u64s. cpu, tid and pid are u32s and need to be handled
      individually. Given that the swap is done before the sample is parsed,
      the simplest solution is to undo the 64-bit swap of those elements when
      the sample is parsed and do the proper swap.
      
      The RAW data field is generic and perf cannot have programmatic knowledge
      of how to treat that data. Instead a warning is given to the user.
      
      Thanks to Anton Blanchard for providing a data file for a mult-CPU
      PPC system so I could verify the fix for the CPU fields.
      
      v3 -> v4:
      - fixed use of WARN_ONCE
      
      v2 -> v3:
      - used WARN_ONCE for message regarding raw data
      - removed struct wrapper around union
      - fixed whitespace issues
      
      v1 -> v2:
      - added a union for undoing the byte-swap on u64 and redoing swap on
        u32's to address compiler errors (see git commit 65014ab3)
      
      Cc: Anton Blanchard <anton@samba.org>
      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>
      Link: http://lkml.kernel.org/r/1315321946-16993-1-git-send-email-dsahern@gmail.comSigned-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      936be503
  26. 21 7月, 2011 2 次提交
  27. 03 6月, 2011 1 次提交
    • A
      perf evlist: Don't die if sample_{id_all|type} is invalid · 56722381
      Arnaldo Carvalho de Melo 提交于
      Fixes two more cases where the python binding would not load:
      
      . Not finding die(), which it shouldn't anyway, not good to just stop the
        world because some particular perf.data file is invalid, just propagate
        the error to the caller.
      
      . Not finding perf_sample_size: fix it by moving it from event.c to evsel,
        where it belongs, as most cases are moving to operate on an evsel object.o
      
      One of the fixed problems:
      
      [root@emilia ~]# python
      >>> import perf
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: perf_sample_size
      >>>
      [root@emilia ~]#
      
      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-1hkj7b2cvgbfnoizsekjb6c9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      56722381
  28. 02 6月, 2011 1 次提交
    • A
      perf evlist: Don't die if sample_{id_all|type} is invalid · c2a70653
      Arnaldo Carvalho de Melo 提交于
      Fixes two more cases where the python binding would not load:
      
      . Not finding die(), which it shouldn't anyway, not good to just stop the
        world because some particular perf.data file is invalid, just propagate
        the error to the caller.
      
      . Not finding perf_sample_size: fix it by moving it from event.c to evsel,
        where it belongs, as most cases are moving to operate on an evsel object.o
      
      One of the fixed problems:
      
      [root@emilia ~]# python
      >>> import perf
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: perf_sample_size
      >>>
      [root@emilia ~]#
      
      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-1hkj7b2cvgbfnoizsekjb6c9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c2a70653
  29. 22 5月, 2011 1 次提交