1. 15 11月, 2012 28 次提交
  2. 10 11月, 2012 8 次提交
    • A
      tools lib traceevent: Use 'const' in variables pointing to const strings · 27f94d52
      Arnaldo Carvalho de Melo 提交于
      Fixing the build on fedora 14, 32-bit:
      
        tools/lib/traceevent/event-parse.c: In function ‘find_cmdline’:
        tools/lib/traceevent/event-parse.c:183:3: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:186:3: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:195:2: error: return discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘process_func_handler’:
        tools/lib/traceevent/event-parse.c:2658:9: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:2660:9: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘print_mac_arg’:
        tools/lib/traceevent/event-parse.c:3892:14: error: initialization discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c:3906:7: error: assignment discards qualifiers from pointer target type
        tools/lib/traceevent/event-parse.c: In function ‘pevent_print_event’:
        tools/lib/traceevent/event-parse.c:4412:24: error: initialization discards qualifiers from pointer target type
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-0k5g8urwu7vwkgbcbt2x05fe@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      27f94d52
    • A
      tools lib traceevent: Handle INVALID_ARG_TYPE errno in pevent_strerror · 7a905611
      Arnaldo Carvalho de Melo 提交于
      gcc on f14 32-bit rightly complains:
      
         tools/lib/traceevent/event-parse.c:5097:2: error: enumeration value ‘PEVENT_ERRNO__INVALID_ARG_TYPE’ not handled in switch
      
      The entry for it is in the error strings array pevent_error_str[]:
      
              _PE(INVALID_ARG_TYPE,   "invalid argument type")
      
      It was just not being handled on the pevent_strerror switch, fix it.
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-c68zkvxw4289uqbosfkz963g@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a905611
    • A
      tools lib traceevent: No need to check for < 0 on an unsigned enum · e46466b8
      Arnaldo Carvalho de Melo 提交于
      gcc on f14 32-bit complains:
      
        tools/lib/traceevent/event-parse.c: In function ‘pevent_register_print_function’:
        tools/lib/traceevent/event-parse.c:5366:3: error: comparison of unsigned expression < 0 is always false
      
      This is because:
      
                enum pevent_func_arg_type type;
      
      this enum doesn't have any negative value, so gcc makes it an 'unsigned
      int'. Fix it by removing the < 0 test.
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-6vnd6ud6fbpn48zax4a5ru01@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e46466b8
    • A
      tools lib traceevent: Avoid comparisions between signed/unsigned · 8a38cce4
      Arnaldo Carvalho de Melo 提交于
      Fixing this warning-as-error on f14 32-bit:
      
        tools/lib/traceevent/event-parse.c:5564:17: error: comparison between signed and unsigned integer expressions
        tools/lib/traceevent/event-parse.c:5586:17: error: comparison between signed and unsigned integer expressions
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-stmix8hy4nu5ervpynn8yj2z@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a38cce4
    • A
      tools lib traceevent: Add __maybe_unused to unused parameters · ca383a4d
      Arnaldo Carvalho de Melo 提交于
      Fixing the build on 32-bit Fedora 14:
      
        tools/lib/traceevent/event-parse.c: In function ‘print_event_fields’:
        tools/lib/traceevent/event-parse.c:3934:69: error: unused parameter ‘size’
        tools/lib/traceevent/event-parse.c: In function ‘pevent_strerror’:
        tools/lib/traceevent/event-parse.c:5074:36: error: unused parameter ‘pevent’
      
      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>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-soe4gqcz8fd4ecik6exvyqox@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca383a4d
    • N
      perf annotate: Merge same lines in summary view · 41127965
      Namhyung Kim 提交于
      The --print-line option of perf annotate command shows summary for
      each source line.  But it didn't merge same lines so that it can
      appear multiple times.
      
      * before:
      
        Sorted summary for file /home/namhyung/bin/mcol
        ----------------------------------------------
           21.71 /home/namhyung/tmp/mcol.c:26
           20.66 /home/namhyung/tmp/mcol.c:25
            9.53 /home/namhyung/tmp/mcol.c:24
            7.68 /home/namhyung/tmp/mcol.c:25
            7.67 /home/namhyung/tmp/mcol.c:25
            7.66 /home/namhyung/tmp/mcol.c:26
            7.49 /home/namhyung/tmp/mcol.c:26
            6.92 /home/namhyung/tmp/mcol.c:25
            6.81 /home/namhyung/tmp/mcol.c:25
            1.07 /home/namhyung/tmp/mcol.c:26
            0.52 /home/namhyung/tmp/mcol.c:25
            0.51 /home/namhyung/tmp/mcol.c:25
            0.51 /home/namhyung/tmp/mcol.c:24
      
      * after:
      
        Sorted summary for file /home/namhyung/bin/mcol
        ----------------------------------------------
           50.77 /home/namhyung/tmp/mcol.c:25
           37.94 /home/namhyung/tmp/mcol.c:26
           10.04 /home/namhyung/tmp/mcol.c:24
      
      To do that, introduce percent_sum field so that the normal
      line-by-line output doesn't get changed.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1352440729-21848-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41127965
    • N
      perf annotate: Don't try to follow jump target on PLT symbols · 32ae1efd
      Namhyung Kim 提交于
      The perf annotate browser on TUI can identify a jump target for a
      selected instruction.  It assumes that the jump target is within the
      function but it's not the case of PLT symbols which have offset out of
      the function as a target.
      
      Since it caused a segmentation fault, do not try to follow jump target
      on the PLT symbols.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1352482044-3443-5-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      32ae1efd
    • N
      perf annotate: Whitespace fixups · 2ba34aaa
      Namhyung Kim 提交于
      Some lines are indented by whitespace characters rather than tabs.  Fix
      them.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1352482044-3443-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2ba34aaa
  3. 09 11月, 2012 4 次提交
    • Z
      perf test: fix a build error on builtin-test · 12f8f74b
      Zheng Liu 提交于
      Recently I build perf and get a build error on builtin-test.c. The error is as
      following:
      
      $ make
          CC perf.o
          CC builtin-test.o
      cc1: warnings being treated as errors
      builtin-test.c: In function ‘sched__get_first_possible_cpu’:
      builtin-test.c:977: warning: implicit declaration of function ‘CPU_ALLOC’
      builtin-test.c:977: warning: nested extern declaration of ‘CPU_ALLOC’
      builtin-test.c:977: warning: assignment makes pointer from integer without a cast
      builtin-test.c:978: warning: implicit declaration of function ‘CPU_ALLOC_SIZE’
      builtin-test.c:978: warning: nested extern declaration of ‘CPU_ALLOC_SIZE’
      builtin-test.c:979: warning: implicit declaration of function ‘CPU_ZERO_S’
      builtin-test.c:979: warning: nested extern declaration of ‘CPU_ZERO_S’
      builtin-test.c:982: warning: implicit declaration of function ‘CPU_FREE’
      builtin-test.c:982: warning: nested extern declaration of ‘CPU_FREE’
      builtin-test.c:992: warning: implicit declaration of function ‘CPU_ISSET_S’
      builtin-test.c:992: warning: nested extern declaration of ‘CPU_ISSET_S’
      builtin-test.c:998: warning: implicit declaration of function ‘CPU_CLR_S’
      builtin-test.c:998: warning: nested extern declaration of ‘CPU_CLR_S’
      make: *** [builtin-test.o] Error 1
      
      This problem is introduced in 3e7c439a. CPU_ALLOC and related macros are
      missing in sched__get_first_possible_cpu function. In 54489c18, commiter
      mentioned that CPU_ALLOC has been removed. So CPU_ALLOC calls in this
      function are removed to let perf to be built.
      Signed-off-by: NVinson Lee <vlee@twitter.com>
      Signed-off-by: NZheng Liu <wenqing.lz@taobao.com>
      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>
      Cc: Vinson Lee <vlee@twitter.com>
      Cc: Zheng Liu <wenqing.lz@taobao.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1352422726-31114-1-git-send-email-vlee@twitter.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12f8f74b
    • A
      perf machine: Move more methods to machine.[ch] · 69d2591a
      Arnaldo Carvalho de Melo 提交于
      This time out of map.[ch] mostly, just code move plus a buch of 'self'
      removal, using machine or machines instead.
      
      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-j1vtux3vnu6wzmrjutpxnjcz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      69d2591a
    • A
      perf diff: Use hists__link when not pairing just with baseline · bfaef4b4
      Arnaldo Carvalho de Melo 提交于
      Previously there were blind spots because we were not looking at symbols
      that didn't ocurred in the latest run:
      
        # perf record usleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.018 MB perf.data (~801 samples) ]
        # perf record usleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.018 MB perf.data (~801 samples) ]
      
      Before:
      
        # perf diff
        # Event 'cycles'
        #
        # Baseline    Delta      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
                    +10.38%  [kernel.kallsyms]  [k] get_empty_filp
                     +9.51%  [kernel.kallsyms]  [k] update_sd_lb_stats
                     +9.41%  libpopt.so.0.0.0   [.] _init
                     +9.29%  [kernel.kallsyms]  [k] vma_interval_tree_insert
             9.05%   +0.12%  [kernel.kallsyms]  [k] do_sys_open
                     +9.14%  [kernel.kallsyms]  [k] kfree
                     +8.98%  [kernel.kallsyms]  [k] free_pages_and_swap_cache
                     +8.78%  [kernel.kallsyms]  [k] unmap_page_range
             9.36%   -0.90%  [kernel.kallsyms]  [k] zap_pte_range
             7.60%   +0.09%  [kernel.kallsyms]  [k] find_next_bit
                     +4.37%  [kernel.kallsyms]  [k] place_entity
                     +3.38%  [kernel.kallsyms]  [k] __do_page_fault
                     +0.80%  [kernel.kallsyms]  [k] native_apic_mem_write
             0.21%   +0.43%  [kernel.kallsyms]  [k] native_write_msr_safe
        #
      
      So 9.05 + 9.36 + 7.60 + 0.21 != 100%
      
      Now using the recently introduced hists__link we can see the whole
      picture:
      
        # perf diff
        # Event 'cycles'
        #
        # Baseline    Delta      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
             8.44%   -8.44%  [kernel.kallsyms]  [k] _raw_spin_lock
             9.05%   -9.05%  [kernel.kallsyms]  [k] sha_transform
            10.55%  -10.55%  [kernel.kallsyms]  [k] __d_lookup_rcu
                    +10.38%  [kernel.kallsyms]  [k] get_empty_filp
            17.70%  -17.70%  [kernel.kallsyms]  [k] kmem_cache_free
                     +9.51%  [kernel.kallsyms]  [k] update_sd_lb_stats
                     +9.41%  libpopt.so.0.0.0   [.] _init
                     +9.29%  [kernel.kallsyms]  [k] vma_interval_tree_insert
             9.05%   +0.12%  [kernel.kallsyms]  [k] do_sys_open
                     +9.14%  [kernel.kallsyms]  [k] kfree
                     +8.98%  [kernel.kallsyms]  [k] free_pages_and_swap_cache
                     +8.78%  [kernel.kallsyms]  [k] unmap_page_range
             9.36%   -0.90%  [kernel.kallsyms]  [k] zap_pte_range
             7.60%   +0.09%  [kernel.kallsyms]  [k] find_next_bit
                     +4.37%  [kernel.kallsyms]  [k] place_entity
                     +3.38%  [kernel.kallsyms]  [k] __do_page_fault
             4.01%   -4.01%  [kernel.kallsyms]  [k] handle_pte_fault
             9.27%   -9.27%  [kernel.kallsyms]  [k] find_get_page
             0.78%   -0.78%  [kernel.kallsyms]  [k] rcu_irq_enter
             0.57%   -0.57%  [kernel.kallsyms]  [k] finish_task_switch
             4.25%   -4.25%  [kernel.kallsyms]  [k] run_timer_softirq
                     +0.80%  [kernel.kallsyms]  [k] native_apic_mem_write
             0.21%   +0.43%  [kernel.kallsyms]  [k] native_write_msr_safe
             9.16%   -9.16%  ld-2.12.so         [.] close
        #
      
      Now:
      
      8.44 + 9.05 + 10.55 + 17.70 + 9.05 + 9.36 +
      7.60 + 4.01 + 9.27 + 0.78 + 0.57 + 4.25 + 0.21 + 9.16 == 100%
      
      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-jeq55qdgby1745bs8r9sscdh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bfaef4b4
    • A
      perf hists: Introduce hists__link · 494d70a1
      Arnaldo Carvalho de Melo 提交于
      That given two hists will find the hist_entries (buckets) in the second
      hists that are for the same bucket in the first and link them, then it
      will look for all buckets in the second that don't have a counterpart in
      the first and will create a dummy counterpart that will then be linked
      to the entry in the second.
      
      For multiple events this will be done pairing the leader with all the
      other events in the group, so that in the end the leader will have all
      the buckets in all the hists in a group, dummy or not while the other
      hists will be left untouched.
      
      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-l9l9ieozqdhn9lieokd95okw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      494d70a1