1. 22 5月, 2012 9 次提交
    • J
      perf tools: Carry perf_event_attr bitfield throught different endians · e108c66e
      Jiri Olsa 提交于
      When the perf data file is read cross architectures, the
      perf_event__attr_swap function takes care about endianness of all the
      struct fields except the bitfield flags.
      
      The bitfield flags need to be transformed as well, since the bitfield
      binary storage differs for both endians.
      
      ABI says:
        Bit-fields are allocated from right to left (least to most significant)
        on little-endian implementations and from left to right (most to least
        significant) on big-endian implementations.
      
      The above seems to be byte specific, so we need to reverse each byte of
      the bitfield. 'Internet' also says this might be implementation specific
      and we probably need proper fix and carry perf_event_attr bitfield flags
      in separate data file FEAT_ section. Thought this seems to work for now.
      
      Note, running following to test perf endianity handling:
      test 1)
        - origin system:
          # perf record -a -- sleep 10 (any perf record will do)
          # perf report > report.origin
          # perf archive perf.data
      
        - copy the perf.data, report.origin and perf.data.tar.bz2
          to a target system and run:
          # tar xjvf perf.data.tar.bz2 -C ~/.debug
          # perf report > report.target
          # diff -u report.origin report.target
      
        - the diff should produce no output
          (besides some white space stuff and possibly different
           date/TZ output)
      
      test 2)
        - origin system:
          # perf record -ag -fo /tmp/perf.data -- sleep 1
        - mount origin system root to the target system on /mnt/origin
        - target system:
          # perf script --symfs /mnt/origin -I -i /mnt/origin/tmp/perf.data \
           --kallsyms /mnt/origin/proc/kallsyms
        - complete perf.data header is displayed
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Tested-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337151548-2396-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e108c66e
    • N
      perf target: Add cpu flag to sample_type if target has cpu · e40ee742
      Namhyung Kim 提交于
      Add PERF_SAMPLE_CPU flag into attr->sample_type if an user specified any
      of cpu target (either system-wide or cpu list).
      
      It will show correct values when cpu sort key is given for perf top and
      perf report.
      Signed-off-by: NNamhyung Kim <namhyung.kim@lge.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337564527-9367-1-git-send-email-namhyung.kim@lge.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e40ee742
    • F
      perf script: Rename struct event to struct event_format in perl engine · 8784eb74
      Frederic Weisbecker 提交于
      While migrating to the libtraceevent, the perl scripting engine
      missed this structure rename.
      
      This fixes:
      
           util/scripting-engines/trace-event-perl.c: In function "find_cache_event":
           util/scripting-engines/trace-event-perl.c:244: error: assignment from incompatible pointer type
           util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:248: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:250: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c: In function "perl_process_tracepoint":
           util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:286: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:307: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c: In function "perl_generate_script":
           util/scripting-engines/trace-event-perl.c:498: error: passing argument 1 of "trace_find_next_event" from incompatible pointer type
           util/scripting-engines/../trace-event.h:56: note: expected "struct event_format *" but argument is of type "struct event *"
           util/scripting-engines/trace-event-perl.c:498: error: assignment from incompatible pointer type
           util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:499: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:513: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:532: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:556: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:569: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:570: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:579: error: dereferencing pointer to incomplete type
           util/scripting-engines/trace-event-perl.c:580: error: dereferencing pointer to incomplete type
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1337697049-30251-2-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8784eb74
    • F
      perf script: Explicitly handle known default print arg type · e326e752
      Frederic Weisbecker 提交于
      Handle the print argument types brought by the new libparsevent in perl
      scripting engine.
      
      PRINT_BSTRING and PRINT_DYNAMIC_ARRAY are treated just like strings
      and thus don't require specific processing.
      
      But PRINT_FUNC need specific plugins which are not yet handled, lets
      warn if we meet this case.
      
      This fixes:
      
           util/scripting-engines/trace-event-perl.c: In function define_event_symbol:
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_BSTRING not handled in switch
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_DYNAMIC_ARRAY not handled in switch
           util/scripting-engines/trace-event-perl.c:188: error: enumeration value PRINT_FUNC not handled in switch
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1337697049-30251-1-git-send-email-fweisbec@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e326e752
    • J
      perf tools: Add hardcoded name term for pmu events · 6b5fc39b
      Jiri Olsa 提交于
      Adding a new hardcoded term 'name' allowing to specify a name for the
      pmu event. The term is defined along with standard pmu terms. If no
      'name' term is given, the event name follows following template:
      
          "raw 0x<perf_event_attr::config>"
      
      running:
          perf stat -e cpu/config=1,name=krava1/u ls
      
      will produce following output:
          ...
          Performance counter stats for 'ls':
                       0 krava1
          ...
      
      running:
          perf stat -e cpu/config=1/u ls
      
      will produce following output:
          ...
          Performance counter stats for 'ls':
                       0 raw 0x1
          ...
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337584373-2741-6-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b5fc39b
    • J
      perf tools: Separate 'mem:' event scanner bits · 08d2f762
      Jiri Olsa 提交于
      Separating 'mem:' scanner processing, so we can parse out modifier
      specifically and dont clash with other rules.
      
      This is just precaution for the future, so we dont need to worry about
      the rules clashing where we need to parse out any sub-rule of global
      rules.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337584373-2741-5-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      08d2f762
    • J
      perf tools: Use allocated list for each parsed event · b847cbdc
      Jiri Olsa 提交于
      Switch from using static temporary event list into dynamically allocated
      one. This way we dont need to pass temp list to the parse_events_parse
      which makes the interface more clear.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337584373-2741-4-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b847cbdc
    • J
      perf tools: Add support for displaying event parser debug info · 82ba1f2f
      Jiri Olsa 提交于
      Adding PARSER_DEBUG Makefile variable to enable building event scanner/
      parser with debug enabled. This results in verbose output right out of
      the scanner/parser.
      
      It's useful for debuging the event parser. Keeping this only for event
      parser so far.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337584373-2741-3-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82ba1f2f
    • J
      perf test: Move parse event automated tests to separated object · f50246e2
      Jiri Olsa 提交于
      Moving event parsing specific tests into separated file:
      
        util/parse-events-test.c
      
      Also changing the code a bit to ease running separate tests.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337584373-2741-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f50246e2
  2. 19 5月, 2012 1 次提交
    • D
      perf evsel: Create events initially disabled -- again · 5e1c81d9
      David Ahern 提交于
      764e16a3 changed perf-record to create events disabled by default and
      enable them once perf initializations are done. This setting was dropped
      by 0f82ebc4. Now perf events are once again generated during perf's
      initialization phase (e.g., generating maps).
      
      As an example, perf opens a lot of files at startup. Unpatched:
      
      perf record -e syscalls:sys_enter_open -ga -fo /tmp/perf.data -- sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.087 MB /tmp/perf.data (~3798 samples) ]
      
      Using perf-script to look at the samples shows the perf command generating
      563 of the 566 total events.
      
      Patched:
      
      perf record -e syscalls:sys_enter_open -ga -fo /tmp/perf.data -- sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.028 MB /tmp/perf.data (~1206 samples) ]
      
      Using perf-script to look at the samples does not show perf command.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Link: http://lkml.kernel.org/r/1336968088-11531-1-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5e1c81d9
  3. 18 5月, 2012 2 次提交
    • J
      perf tools: Split term type into value type and term type · 16fa7e82
      Jiri Olsa 提交于
      Introducing type_val and type_term for term instead of a single type
      value. Currently the term type marked out the value type as well.
      
      With this change we can have future string term values being specified
      by user and translated into proper number along the processing.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      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>
      Link: http://lkml.kernel.org/r/1335371102-11358-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      16fa7e82
    • J
      perf hists: Fix callchain ip printf format · a0187060
      Jiri Olsa 提交于
      The callchain address is stored as u64. Current code uses following
      format string to display callchain address:
      
        "%p\n", (void *)(long)chain->ip
      
      This way we lose upper 32 bits if we report 64 bit addresses in 32 bit
      environment. Fixing this to always display whole 64 bits.
      
      Note, running following to test perf endianity handling:
      test 1)
        - origin system:
          # perf record -a -- sleep 10 (any perf record will do)
          # perf report > report.origin
          # perf archive perf.data
      
        - copy the perf.data, report.origin and perf.data.tar.bz2
          to a target system and run:
          # tar xjvf perf.data.tar.bz2 -C ~/.debug
          # perf report > report.target
          # diff -u report.origin report.target
      
        - the diff should produce no output
          (besides some white space stuff and possibly different
           date/TZ output)
      
      test 2)
        - origin system:
          # perf record -ag -fo /tmp/perf.data -- sleep 1
        - mount origin system root to the target system on /mnt/origin
        - target system:
          # perf script --symfs /mnt/origin -I -i /mnt/origin/tmp/perf.data \
           --kallsyms /mnt/origin/proc/kallsyms
        - complete perf.data header is displayed
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1337151548-2396-8-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a0187060
  4. 17 5月, 2012 1 次提交
  5. 16 5月, 2012 2 次提交
  6. 13 5月, 2012 2 次提交
  7. 12 5月, 2012 2 次提交
  8. 11 5月, 2012 1 次提交
  9. 08 5月, 2012 7 次提交
  10. 04 5月, 2012 1 次提交
  11. 03 5月, 2012 11 次提交
  12. 02 5月, 2012 1 次提交