1. 14 2月, 2017 2 次提交
    • N
      perf diff: Add 'delta-abs' compute method · a1668c25
      Namhyung Kim 提交于
      The 'delta-abs' compute method is same as 'delta' but shows entries with
      bigger absolute delta first instead of sorting numerically.  This is
      only useful together with -o option.
      
      Below is default output (-c delta):
      
        $ perf diff -o 1 -c delta | grep -v ^# | head
          42.22%   +4.97%  [kernel.kallsyms]  [k] cfb_imageblit
           0.62%   +1.23%  [kernel.kallsyms]  [k] mutex_lock
                   +1.15%  [kernel.kallsyms]  [k] copy_user_generic_string
           2.40%   +0.95%  [kernel.kallsyms]  [k] bit_putcs
           0.31%   +0.79%  [kernel.kallsyms]  [k] link_path_walk
                   +0.64%  [kernel.kallsyms]  [k] kmem_cache_alloc
           0.00%   +0.57%  [kernel.kallsyms]  [k] __rcu_read_unlock
                   +0.45%  [kernel.kallsyms]  [k] alloc_set_pte
           0.16%   +0.45%  [kernel.kallsyms]  [k] menu_select
                   +0.41%  ld-2.24.so         [.] do_lookup_x
      
      Now with 'delta-abs' it shows entries have bigger delta value either
      positive or negative.
      
        $ perf diff -o 1 -c delta-abs | grep -v ^# | head
          42.22%   +4.97%  [kernel.kallsyms]  [k] cfb_imageblit
          12.72%   -3.01%  [kernel.kallsyms]  [k] intel_idle
           9.72%   -1.31%  [unknown]          [.] 0x0000000000411343
           0.62%   +1.23%  [kernel.kallsyms]  [k] mutex_lock
           2.40%   +0.95%  [kernel.kallsyms]  [k] bit_putcs
           0.31%   +0.79%  [kernel.kallsyms]  [k] link_path_walk
           1.35%   -0.71%  [kernel.kallsyms]  [k] smp_call_function_single
           0.00%   +0.57%  [kernel.kallsyms]  [k] __rcu_read_unlock
           0.16%   +0.45%  [kernel.kallsyms]  [k] menu_select
           0.72%   -0.44%  [kernel.kallsyms]  [k] lookup_fast
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20170210073614.24584-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a1668c25
    • A
      tools include: Introduce linux/compiler-gcc.h · 19261401
      Arnaldo Carvalho de Melo 提交于
      To match the kernel headers structure, setting up things that are
      specific to gcc or to some specific version of gcc.
      
      It gets included by linux/compiler.h when gcc is the compiler being
      used.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-fabcqfq4asodq9t158hcs8t3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      19261401
  2. 12 2月, 2017 1 次提交
  3. 10 2月, 2017 6 次提交
    • A
      perf/core: Allow kernel filters on CPU events · 6ce77bfd
      Alexander Shishkin 提交于
      While supporting file-based address filters for CPU events requires some
      extra context switch handling, kernel address filters are easy, since the
      kernel mapping is preserved across address spaces. It is also useful as
      it permits tracing scheduling paths of the kernel.
      
      This patch allows setting up kernel filters for CPU events.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: vince@deater.net
      Link: http://lkml.kernel.org/r/20170126094057.13805-4-alexander.shishkin@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6ce77bfd
    • A
      perf/core: Do error out on a kernel filter on an exclude_filter event · 9ccbfbb1
      Alexander Shishkin 提交于
      It is currently possible to configure a kernel address filter for a
      event that excludes kernel from its traces (attr.exclude_kernel==1).
      
      While in reality this doesn't make sense, the SET_FILTER ioctl() should
      return a error in such case, currently it does not. Furthermore, it
      will still silently discard the filter and any potentially valid filters
      that came with it.
      
      This patch makes the SET_FILTER ioctl() error out in such cases.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: vince@deater.net
      Link: http://lkml.kernel.org/r/20170126094057.13805-3-alexander.shishkin@linux.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9ccbfbb1
    • I
      Merge tag 'perf-core-for-mingo-4.11-20170209' of... · 21ee2fcb
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.11-20170209' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
       - Add support for parsing Intel uncore vendor event files and add uncore
         vendor events for the Intel server processors (Haswell, Broadwell,
         IvyBridge), Xeon Phi (Knights Landing) and Broadwell DE (Andi Kleen)
      
       - Support --symfs in 'perf probe' (Uwe Kleine-König)
      
       - Add support for generating bpf prologue on the aarch64 architecture (He Kuang)
      
       - Show proper hint when SDT event not yet in place via 'perf probe' (Ravi Bangoria)
      
       - Take into account symfs setting when reading file build ID (Victor Kamensky)
      
      Infrastructure changes:
      
       - Map gcc7's '__attribute__ ((fallthrough))', that warns when code
         associated to case blocks in switches continue into the next case entry,
         to '__falltrough' and use it where warned by gcc, tested on Fedora Rawhide
         (Arnaldo Carvalho de Melo)
      
       - Fix buffer sizes used with snprintf that could lead to truncation,
         another warning introduced in gcc7 (Arnaldo Carvalho de Melo)
      
       - Robustify do_generate_dynamic_list_file in libtraceevent (David Carrillo-Cisneros)
      
       - Use zfree() in more places (Taeung Song)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      21ee2fcb
    • A
      perf intel-pt: Use __fallthrough · 7ea6856d
      Arnaldo Carvalho de Melo 提交于
      To address new warnings emmited by gcc 7, e.g.::
      
          CC       /tmp/build/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.o
          CC       /tmp/build/perf/tests/parse-events.o
        util/intel-pt-decoder/intel-pt-pkt-decoder.c: In function 'intel_pt_pkt_desc':
        util/intel-pt-decoder/intel-pt-pkt-decoder.c:499:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
           if (!(packet->count))
              ^
        util/intel-pt-decoder/intel-pt-pkt-decoder.c:501:2: note: here
          case INTEL_PT_CYC:
          ^~~~
          CC       /tmp/build/perf/util/intel-pt-decoder/intel-pt-decoder.o
        cc1: all warnings being treated as errors
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-mf0hw789pu9x855us5l32c83@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7ea6856d
    • A
      perf tests: Avoid possible truncation with dirent->d_name + snprintf · 2e2bbc03
      Arnaldo Carvalho de Melo 提交于
      Addressing a few cases spotted by a new warning in gcc 7:
      
        tests/parse-events.c: In function 'test_pmu_events':
        tests/parse-events.c:1790:39: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 90 [-Werror=format-truncation=]
           snprintf(name, MAX_NAME, "cpu/event=%s/u", ent->d_name);
                                             ^~
        In file included from /usr/include/stdio.h:939:0,
                         from /git/linux/tools/perf/util/map.h:9,
                         from /git/linux/tools/perf/util/symbol.h:7,
                         from /git/linux/tools/perf/util/evsel.h:10,
                         from tests/parse-events.c:3:
        /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 13 and 268 bytes into a destination of size 100
           return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                __bos (__s), __fmt, __va_arg_pack ());
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        tests/parse-events.c:1798:29: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 100 [-Werror=format-truncation=]
           snprintf(name, MAX_NAME, "%s:u,cpu/event=%s/u", ent->d_name, ent->d_name);
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 945aea22 ("perf tests: Move test objects into 'tests' directory")
      Link: http://lkml.kernel.org/n/tip-ty4q2p8zp1dp3mskvubxskm5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2e2bbc03
    • A
      perf bench numa: Avoid possible truncation when using snprintf() · 3aff8ba0
      Arnaldo Carvalho de Melo 提交于
      Addressing this warning from gcc 7:
      
          CC       /tmp/build/perf/bench/numa.o
        bench/numa.c: In function '__bench_numa':
        bench/numa.c:1582:42: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 8 and 17 [-Werror=format-truncation=]
             snprintf(tname, 32, "process%d:thread%d", p, t);
                                                  ^~
        bench/numa.c:1582:25: note: directive argument in the range [0, 2147483647]
             snprintf(tname, 32, "process%d:thread%d", p, t);
                                 ^~~~~~~~~~~~~~~~~~~~
        In file included from /usr/include/stdio.h:939:0,
                         from bench/../util/util.h:47,
                         from bench/../builtin.h:4,
                         from bench/numa.c:11:
        /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' output between 17 and 35 bytes into a destination of size 32
           return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                __bos (__s), __fmt, __va_arg_pack ());
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Petr Holasek <pholasek@redhat.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-twa37vsfqcie5gwpqwnjuuz9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3aff8ba0
  4. 09 2月, 2017 14 次提交
  5. 08 2月, 2017 15 次提交
  6. 06 2月, 2017 2 次提交