1. 11 7月, 2018 1 次提交
    • J
      selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress · 1416270f
      John Stultz 提交于
      In the past we've warned when ADJ_OFFSET was in progress, usually
      caused by ntpd or some other time adjusting daemon running in non
      steady sate, which can cause the skew calculations to be
      incorrect.
      
      Thus, this patch checks to see if the clock was being adjusted
      when we fail so that we don't cause false negatives.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Miroslav Lichvar <mlichvar@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: linux-kselftest@vger.kernel.org
      Suggested-by: NMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      ---
      v2: Widened the checks to look for other clock adjustments that
          could happen, as suggested by Miroslav
      v3: Fixed up commit message
      1416270f
  2. 29 6月, 2018 1 次提交
  3. 27 6月, 2018 2 次提交
  4. 26 6月, 2018 1 次提交
    • I
      tools/headers: Pick up latest kernel ABIs · 32fdbd90
      Ingo Molnar 提交于
      Sync KVM ABI additions and x86 CPU features additions - neither of which
      has any impact on the tooling build.
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      32fdbd90
  5. 25 6月, 2018 19 次提交
    • R
      perf tools: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE] · 92ead7ee
      Ravi Bangoria 提交于
      perf_event__process_feature() accesses feat_ops[HEADER_LAST_FEATURE]
      which is not defined and thus perf is crashing. HEADER_LAST_FEATURE is
      used as an end marker for the perf report but it's unused for perf
      script/annotate. Ignore HEADER_LAST_FEATURE for perf script/annotate,
      just like it is done in 'perf report'.
      
      Before:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        #
      
      After:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        ls 7031 4392.099856:  250000 cpu-clock:uhH:  7f5e0ce7cd60
        ls 7031 4392.100355:  250000 cpu-clock:uhH:  7f5e0c706ef7
        #
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 57b5de46 ("perf report: Support forced leader feature in pipe mode")
      Link: http://lkml.kernel.org/r/20180625124220.6434-4-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      92ead7ee
    • R
      perf script: Fix crash because of missing evsel->priv · a3af66f5
      Ravi Bangoria 提交于
      'perf script' in piped mode is crashing because evsel->priv is not set
      properly. Fix it.
      
      Before:
      
        # perf record -o - -- ls | perf script
        <SNIP 'ls' output>
          Segmentation fault (core dumped)
        #
      
      After:
      
        # perf record -o - -- ls | perf script
        <SNIP 'ls' output>
        ls 2282 1031.731974:  250000 cpu-clock:uhH:  7effe4b3d29e
        ls 2282 1031.732222:  250000 cpu-clock:uhH:  7effe4b3a650
        #
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: a14390fd ("perf script: Allow creating per-event dump files")
      Link: http://lkml.kernel.org/r/20180625124220.6434-3-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a3af66f5
    • R
      perf script: Add missing output fields in a hint · 10e9cec9
      Ravi Bangoria 提交于
      A few fields are missing in a perf script -F hint. Add them.
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20180625124220.6434-2-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      10e9cec9
    • J
      perf bench: Fix numa report output code · 98310707
      Jiri Olsa 提交于
      Currently we can hit following assert when running numa bench:
      
        $ perf bench numa mem -p 3 -t 1 -P 512 -s 100 -zZ0cm --thp 1
        perf: bench/numa.c:1577: __bench_numa: Assertion `!(!(((wait_stat) & 0x7f) == 0))' failed.
      
      The assertion is correct, because we hit the SIGFPE in following line:
      
        Thread 2.2 "thread 0/0" received signal SIGFPE, Arithmetic exception.
        [Switching to Thread 0x7fffd28c6700 (LWP 11750)]
        0x000.. in worker_thread (__tdata=0x7.. ) at bench/numa.c:1257
        1257 td->speed_gbs = bytes_done / (td->runtime_ns / NSEC_PER_SEC) / 1e9;
      
      We don't check if the runtime is actually bigger than 1 second,
      and thus this might end up with zero division within FPU.
      
      Adding the check to prevent this.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180620094036.17278-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      98310707
    • T
      perf stat: Remove duplicate event counting · 6dde6429
      Thomas Richter 提交于
      'perf stat' shows a mismatch in perf stat regarding counter names on
      s390:
      
      Run command:
      
         [root@s35lp76 perf]# ./perf stat -e tx_nc_tend  -v --
                      ~/mytesttx 1 >/tmp/111
         tx_nc_tend: 1 573146 573146
         tx_nc_tend: 1 573146 573146
      
         Performance counter stats for '/root/mytesttx 1':
      
                       3      tx_nc_tend
      
             0.001037252 seconds time elapsed
      
         [root@s35lp76 perf]#
      
      shows transaction counter tx_nc_tend with value 3 but it was triggered
      only once as seen by the output of mytesttx.
      
      When looking up the event name tx_nc_tend the following function
      sequence is called:
      
      parse_events_multi_pmu_add()
      +--> perf_pmu__scan() being called with NULL argument
           +--> pmu_read_sysfs() scans directory ../devices/ for
                                 all PMUs
                +--> perf_pmu__find() tries to find a PMU in the
                                 global pmu list.
                     +--> pmu_lookup() called to read all file
                                       entries when not in global
                                       list.
      
      pmu_lookup() causes the issue. It calls
      +---> pmu_aliases() to read all the entries in the PMU directory.
                          On s390 this is named
                          /sys/devices/cpum_cf/events.
            +--> pmu_aliases_parse() reads all files and creates an
                             alias for each file name.
      
                             So we end up with first entry created by
                             reading the sysfs file
                             [root@s35lp76 perf]# cat /sys/devices/cpum_cf
                                                      /events/TX_NC_TEND
                             event=0x008d
                             [root@s35lp76 perf]#
      
                             Debug output shows this entry
                             tx_nc_tend -> 'cpum_cf'/'event=0x008d
                             '/
                             After all files in this directory have been
                             read and aliases created this function is called:
            +--> pmu_add_cpu_aliases()
                             This function looks up the CPU tables
                             created by the json files.
                             With json files for s390 now available all
                             the aliases are added to
                             the PMU alias list a second time.
                             The second entry is added by
                             reading the json file converted by jevent
                             resulting in file pmu-events/pmu-events.c:
      
                             {
                               .name = "tx_nc_tend",
                               .event = "event=0x8d",
                               .desc = "Unit: cpum_cf Completed TEND \
                                        instructions \
                                        in non-constrained TX mode",
                               .topic = "extended",
                               .long_desc = "A TEND instruction has \
                                             completed  in a \
                                             non-constrained \
                                             transactional-execution mode",
                               .pmu = "cpum_cf",
                              },
      
                              Debug output shows this entry
                              tx_nc_tend -> 'cpum_cf'/'event=0x8d'/
      
      Function pmu_aliases_parse() and pmu_add_cpu_aliases() both use
      __perf_pmu__new_alias() to add an alias to the PMU alias list. There is
      no check if an alias already exist
      
      So we end up with 2 entries for tx_nc_tend in the PMU alias list.
      
      Having set up the PMU alias list for this PMU now
      parse_events_multi_add_pmu() reads the complete alias list and adds each
      alias with parse_events_add_pmu() to the global perfev_list.  This
      causes the alias to be added multiple times to the event list.
      
      Fix this by making __perf_pmu__new_alias() to merge alias definitions if
      an alias is already on the alias list.  Also print a debug message when
      the alias has mismatches in some fields.
      
      Output before:
      
        [root@s35lp76 perf]# ./perf stat -e tx_nc_tend  -v \
                              -- ~/mytesttx 1 >/tmp/111
        tx_nc_tend: 1 551446 551446
      
         Performance counter stats for '/root/mytesttx 1':
      
                         3      tx_nc_tend
      
               0.000961134 seconds time elapsed
      
        [root@s35lp76 perf]#
      
      Output after:
      
        [root@s35lp76 perf]#  ./perf stat -e tx_nc_tend  -v \
                              -- ~/mytesttx 1 >/tmp/111
        tx_nc_tend: 1 551446 551446
      
         Performance counter stats for '/root/mytesttx 1':
      
                         1      tx_nc_tend
      
               0.000961134 seconds time elapsed
      
        [root@s35lp76 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Reviewed-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180615101105.47047-3-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6dde6429
    • T
      perf alias: Rebuild alias expression string to make it comparable · 0c24d6fb
      Thomas Richter 提交于
      PMU alias definitions in sysfs files may have spaces, newlines and
      numbers with leading zeroes. Some alias definitions may also appear in
      JSON files without spaces, etc.
      
      Scan alias definitions and remove leading zeroes, spaces, newlines, etc
      and rebuild string to make alias->str member comparable.
      
      s390 for example  has terms specified as event=0x0091 (read from files
      ../<PMU>/events/<FILE> and terms specified as event=0x91 (read from JSON
      files).
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180615101105.47047-2-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0c24d6fb
    • T
      perf alias: Remove trailing newline when reading sysfs files · ea23ac73
      Thomas Richter 提交于
      Remove a trailing newline when reading sysfs file contents such as
      /sys/devices/cpum_cf/events/TX_NC_TEND.  This shows when verbose option
      -v is used.
      
      Output before:
      
        tx_nc_tend -> 'cpum_cf'/'event=0x008d
        '/
      
      Output after:
      
        tx_nc_tend -> 'cpum_cf'/'event=0x8d'/
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180615101105.47047-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ea23ac73
    • Y
      perf tools: Fix a clang 7.0 compilation error · c6555c14
      Yonghong Song 提交于
      Arnaldo reported the perf build failure with latest llvm/clang compiler
      (7.0).
      
         $ make LIBCLANGLLVM=1 -C tools/perf/
         <SNIP>
          CC       /tmp/tmp.t53Qo38zci/tests/kmod-path.o
         util/c++/clang.cpp: In function ‘std::unique_ptr<llvm::SmallVectorImpl<char> >
             perf::getBPFObjectFromModule(llvm::Module*)’:
         util/c++/clang.cpp:150:43: error: no matching function for call to
             ‘llvm::TargetMachine::addPassesToEmitFile(llvm::legacy::PassManager&,
              llvm::raw_svector_ostream&, llvm::TargetMachine::CodeGenFileType)’
                     TargetMachine::CGFT_ObjectFile)) {
                                                   ^
         In file included from util/c++/clang.cpp:25:0:
         /usr/local/include/llvm/Target/TargetMachine.h:254:16: note: candidate:
             virtual bool llvm::TargetMachine::addPassesToEmitFile(
             llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&,
             llvm::raw_pwrite_stream*, llvm::TargetMachine::CodeGenFileType, bool,
             llvm::MachineModuleInfo*)
           virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
                        ^~~~~~~~~~~~~~~~~~~
        /usr/local/include/llvm/Target/TargetMachine.h:254:16: note:
            candidate expects 6 arguments, 3 provided
        mv: cannot stat '/tmp/tmp.t53Qo38zci/util/c++/.clang.o.tmp': No such file or directory
        make[7]: *** [/home/acme/git/perf/tools/build/Makefile.build:101:
            /tmp/tmp.t53Qo38zci/util/c++/clang.o] Error 1
        make[6]: *** [/home/acme/git/perf/tools/build/Makefile.build:139: c++] Error 2
        make[5]: *** [/home/acme/git/perf/tools/build/Makefile.build:139: util] Error 2
        make[5]: *** Waiting for unfinished jobs....
          CC       /tmp/tmp.t53Qo38zci/tests/thread-map.o
      
      The function addPassesToEmitFile signature changed in llvm 7.0 and such
      a change caused the failure. This patch fixed the issue with using
      proper function signatures under different compiler versions.
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20180616174739.1076733-1-yhs@fb.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6555c14
    • A
      tools include uapi: Synchronize bpf.h with the kernel · f568b472
      Arnaldo Carvalho de Melo 提交于
      To pick the rename in:
      
        bd3a08aa ("bpf: flowlabel in bpf_fib_lookup should be flowinfo")
      
      Silencing this build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      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: https://lkml.kernel.org/n/tip-zd1sgtbybtjrrt7bqdybu0s0@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f568b472
    • A
      tools include uapi: Update if_link.h to pick IFLA_{BRPORT_ISOLATED,VXLAN_TTL_INHERIT} · bb9a33cb
      Arnaldo Carvalho de Melo 提交于
      The IFLA_BRPORT_ISOLATED and IFLA_VXLAN_TTL_INHERIT defines were added in:
      
        7d850abd ("net: bridge: add support for port isolation")
        72f6d71e ("vxlan: add ttl inherit support")
      
      Pick them, silencing this build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
      
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric Leblond <eric@regit.org>
      Cc: Hangbin Liu <liuhangbin@gmail.com>
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Link: https://lkml.kernel.org/n/tip-ezi5u0mmdqm0wfm0y2y8176r@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bb9a33cb
    • A
      tools include powerpc: Update arch/powerpc/include/uapi/asm/unistd.h copy to get 'rseq' syscall · 801f5e1a
      Arnaldo Carvalho de Melo 提交于
      This updates the tools/perf/ copy of the powerpc file used to generate
      the syscall table file used to make 'perf trace' become aware of the new
      'rseq' syscall, no matter in which system it gets built, i.e. older
      systems where the syscalls are not available in the running kernel (via
      tracefs) or in the system headers will still be aware of these
      syscalls/.
      
      From this commit:
      
        bb862b02 ("powerpc: Wire up restartable sequences system call")
      
      Silencing this tools/perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/unistd.h' differs from latest version at 'arch/powerpc/include/uapi/asm/unistd.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-adtgz6u3apd76tghiu9w0k19@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      801f5e1a
    • A
      perf tools: Update x86's syscall_64.tbl, adding 'io_pgetevents' and 'rseq' · b1494ec0
      Arnaldo Carvalho de Melo 提交于
      This updates the tools/perf/ copy of the system call table for x86 which makes
      'perf trace' become aware of the new 'io_pgetevents' and 'rseq' syscalls, no
      matter in which system it gets built, i.e. older systems where the syscalls are
      not available in the running kernel (via tracefs) or in the system headers will
      still be aware of these syscalls/.
      
      These are the csets introducing the source drift:
      
        05c17ced ("x86: Wire up restartable sequence system call")
        7a074e96 ("aio: implement io_pgetevents")
      
      This results in this build time change:
      
        $ diff -u /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.old /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c
        --- /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c.old	2018-06-15 11:48:17.648948094 -0300
        +++ /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c	2018-06-15 11:48:22.133942480 -0300
        @@ -332,5 +332,7 @@
                [330] = "pkey_alloc",
                [331] = "pkey_free",
                [332] = "statx",
        +       [333] = "io_pgetevents",
        +       [334] = "rseq",
         };
        -#define SYSCALLTBL_x86_64_MAX_ID 332
        +#define SYSCALLTBL_x86_64_MAX_ID 334
        $
      
      This silences the following tools/perf/ build warning:
      
        Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-tfvyz51sabuzemrszbrhzxni@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b1494ec0
    • A
      tools headers uapi: Synchronize drm/drm.h · 7b818dc5
      Arnaldo Carvalho de Melo 提交于
      To pick up the new ioctls added in these csets:
      
        7595bda2 ("drm: Add DRM client cap for aspect-ratio")
      
      The DRM caps are not yet being decoded in 'perf trace', so this sync
      doesn't incur in any change in behaviour in any tools, just silencing
      this tools/perf/ build warning:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-atwz0arwanq1npu8pptwkoxt@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7b818dc5
    • A
      perf intel-pt: Fix packet decoding of CYC packets · 621a5a32
      Adrian Hunter 提交于
      Use a 64-bit type so that the cycle count is not limited to 32-bits.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1528371002-8862-1-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      621a5a32
    • J
      perf tests: Add valid callback for parse-events test · 16ddcfbf
      Jiri Olsa 提交于
      Adding optional 'valid' callback for events tests in parse-events
      object, so we don't try to parse PMUs, which are not supported.
      
      Following line is displayed for skipped test:
      
        running test 52 'intel_pt//u'... SKIP
      
      Committer note:
      
      Use named initializers in the struct evlist_test variable to avoid
      breaking the build on centos:5, 6 and others with a similar gcc:
      
        cc1: warnings being treated as errors
        tests/parse-events.c: In function 'test_pmu_events':
        tests/parse-events.c:1817: error: missing initializer
        tests/parse-events.c:1817: error: (near initialization for 'e.type')
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20180611093422.1005-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      16ddcfbf
    • J
      perf tests: Add event parsing error handling to parse events test · 933ccf20
      Jiri Olsa 提交于
      Add missing error handling for parse_events calls in test_event function
      that led to following segfault on s390:
      
        running test 52 'intel_pt//u'
        perf: Segmentation fault
        ...
        /lib64/libc.so.6(vasprintf+0xe6) [0x3fffca3f106]
        /lib64/libc.so.6(asprintf+0x46) [0x3fffca1aa96]
        ./perf(parse_events_add_pmu+0xb8) [0x80132088]
        ./perf(parse_events_parse+0xc62) [0x8019529a]
        ./perf(parse_events+0x98) [0x801341c0]
        ./perf(test__parse_events+0x48) [0x800cd140]
        ./perf(cmd_test+0x26a) [0x800bd44a]
        test child interrupted
      
      Adding the struct parse_events_error argument to parse_events call. Also
      adding parse_events_print_error to get more details on the parsing
      failures, like:
      
        # perf test 6 -v
        running test 52 'intel_pt//u'failed to parse event 'intel_pt//u', err 1, str 'Cannot find PMU `intel_pt'. Missing kernel support?'
        event syntax error: 'intel_pt//u'
                             \___ Cannot find PMU `intel_pt'. Missing kernel support?
      
      Committer note:
      
      Use named initializers in the struct parse_events_error variable to
      avoid breaking the build on centos5, 6 and others with a similar gcc:
      
        cc1: warnings being treated as errors
        tests/parse-events.c: In function 'test_event':
        tests/parse-events.c:1696: error: missing initializer
        tests/parse-events.c:1696: error: (near initialization for 'err.str')
      Reported-by: NKim Phillips <kim.phillips@arm.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NKim Phillips <kim.phillips@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20180611093422.1005-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      933ccf20
    • S
      perf report powerpc: Fix crash if callchain is empty · 143c99f6
      Sandipan Das 提交于
      For some cases, the callchain provided by the kernel may be empty. So,
      the callchain ip filtering code will cause a crash if we do not check
      whether the struct ip_callchain pointer is NULL before accessing any
      members.
      
      This can be observed on a powerpc64le system running Fedora 27 as shown
      below.
      
        # perf record -b -e cycles:u ls
      
      Before:
      
        # perf report --branch-history
      
        perf: Segmentation fault
        -------- backtrace --------
        perf[0x1027615c]
        linux-vdso64.so.1(__kernel_sigtramp_rt64+0x0)[0x7fff856304d8]
        perf(arch_skip_callchain_idx+0x44)[0x10257c58]
        perf[0x1017f2e4]
        perf(thread__resolve_callchain+0x124)[0x1017ff5c]
        perf(sample__resolve_callchain+0xf0)[0x10172788]
        ...
      
      After:
      
        # perf report --branch-history
      
        Samples: 25  of event 'cycles:u', Event count (approx.): 2306870
          Overhead  Source:Line            Symbol                   Shared Object
        +   11.60%  _init+35736            [.] _init                ls
        +    9.84%  strcoll_l.c:137        [.] __strcoll_l          libc-2.26.so
        +    9.16%  memcpy.S:175           [.] __memcpy_power7      libc-2.26.so
        +    9.01%  gconv_charset.h:54     [.] _nl_find_locale      libc-2.26.so
        +    8.87%  dl-addr.c:52           [.] _dl_addr             libc-2.26.so
        +    8.83%  _init+236              [.] _init                ls
        ...
      Reported-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Signed-off-by: NSandipan Das <sandipan@linux.ibm.com>
      Acked-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20180611104049.11048-1-sandipan@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      143c99f6
    • T
      perf test session topology: Fix test on s390 · b930e62e
      Thomas Richter 提交于
      On s390 this test case fails because the socket identifiction numbers
      assigned to the CPU are higher than the CPU identification numbers.
      
      F/ix this by adding the platform architecture into the perf data header
      flag information. This helps identifiing the test platform and handles
      s390 specifics in process_cpu_topology().
      
      Before:
      
        [root@p23lp27 perf]# perf test -vvvvv -F 39
        39: Session topology                                      :
        --- start ---
        templ file: /tmp/perf-test-iUv755
        socket_id number is too big.You may need to upgrade the perf tool.
        ---- end ----
        Session topology: Skip
        [root@p23lp27 perf]#
      
      After:
      
        [root@p23lp27 perf]# perf test -vvvvv -F 39
        39: Session topology                                      :
        --- start ---
        templ file: /tmp/perf-test-8X8VTs
        CPU 0, core 0, socket 6
        CPU 1, core 1, socket 3
        ---- end ----
        Session topology: Ok
        [root@p23lp27 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Fixes: c84974ed ("perf test: Add entry to test cpu topology")
      Link: http://lkml.kernel.org/r/20180611073153.15592-2-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b930e62e
    • T
      perf record: Support s390 random socket_id assignment · 01766229
      Thomas Richter 提交于
      On s390 the socket identifier assigned to a CPU identifier is random and
      (depending on the configuration of the LPAR) may be higher than the CPU
      identifier. This is currently not supported.
      
      Fix this by allowing arbitrary socket identifiers being assigned to
      CPU id.
      
      Output before:
      
        [root@p23lp27 perf]# ./perf report --header -I -v
        ...
        socket_id number is too big.You may need to upgrade the perf tool.
        Error:
        The perf.data file has no samples!
        # ========
        # captured on    : Tue May 29 09:29:57 2018
        # header version : 1
        ...
        # Core ID and Socket ID information is not available
        ...
        [root@p23lp27 perf]#
      
      Output after:
      
        [root@p23lp27 perf]# ./perf report --header -I -v
        ...
        Error:
        The perf.data file has no samples!
        # ========
        # captured on    : Tue May 29 09:29:57 2018
        # header version : 1
        ...
        # CPU 0: Core ID 0, Socket ID 6
        # CPU 1: Core ID 1, Socket ID 3
        # CPU 2: Core ID -1, Socket ID -1
        ...
        [root@p23lp27 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180611073153.15592-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      01766229
  6. 21 6月, 2018 12 次提交
  7. 20 6月, 2018 2 次提交
  8. 18 6月, 2018 2 次提交