1. 19 Sep, 2018 16 commits
    • Andi Kleen's avatar
      perf script: Print DSO for callindent · a78cdee6
      Andi Kleen authored
      Now that we don't need to print the IP/ADDR for callindent the DSO is
      also not printed. It's useful for some cases, so add an own DSO printout
      for callindent for the case when IP/ADDR is not enabled.
      
      Before:
      
      % perf script --itrace=cr -F +callindent,-ip,-sym,-symoff,-addr
               swapper     0 [000]  3377.917072:          1   branches: pt_config
               swapper     0 [000]  3377.917072:          1   branches:     pt_config
               swapper     0 [000]  3377.917072:          1   branches:     pt_event_add
               swapper     0 [000]  3377.917072:          1   branches:     perf_pmu_enable
               swapper     0 [000]  3377.917072:          1   branches:     perf_pmu_nop_void
               swapper     0 [000]  3377.917072:          1   branches:     event_sched_in.isra.107
               swapper     0 [000]  3377.917072:          1   branches:     __x86_indirect_thunk_rax
               swapper     0 [000]  3377.917072:          1   branches:     perf_pmu_nop_int
               swapper     0 [000]  3377.917072:          1   branches:     group_sched_in
               swapper     0 [000]  3377.917072:          1   branches:     event_filter_match
               swapper     0 [000]  3377.917072:          1   branches:     event_filter_match
               swapper     0 [000]  3377.917072:          1   branches:     group_sched_in
      
      After:
      
               swapper     0 [000]  3377.917072:          1   branches: ([unknown])   pt_config
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       pt_config
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       pt_event_add
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       perf_pmu_enable
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       perf_pmu_nop_void
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       event_sched_in.isra.107
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       __x86_indirect_thunk_rax
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       perf_pmu_nop_int
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       group_sched_in
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       event_filter_match
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       event_filter_match
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])       group_sched_in
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])           __x86_indirect_thunk_rax
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])           perf_pmu_nop_txn
               swapper     0 [000]  3377.917072:          1   branches: ([kernel.kallsyms])           event_sched_in.isra.107
      
      (in the kernel case of course it's not very useful, but it's important
      with user programs where symbols are not unique)
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Link: http://lkml.kernel.org/r/20180918123214.26728-6-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a78cdee6
    • Andi Kleen's avatar
      perf script: Allow sym and dso without ip, addr · 37fed3de
      Andi Kleen authored
      Currently sym and dso require printing ip and addr because the print
      function is tied to those outputs. With callindent it makes sense to
      print the symbol or dso without numerical IP or ADDR. So change the
      dependency check to only check the underlying attribute.
      
      Also the branch target output relies on the user_set flag to determine
      if the branch target should be implicitely printed. When modifying the
      fields with + or - also set user_set, so that ADDR can be removed. We
      also need to set wildcard_set to make the initial sanity check pass.
      
      This allows to remove a lot of noise in callindent output by dropping
      the numerical addresses, which are not all that useful.
      
      Before
      
      % perf script --itrace=cr -F +callindent
               swapper     0 [000] 156546.354971:          1   branches: pt_config                                       0 [unknown] ([unknown]) => ffffffff81010486 pt_config ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     pt_config                    ffffffff81010499 pt_config ([kernel.kallsyms]) => ffffffff8101063e pt_event_add ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     pt_event_add                 ffffffff81010635 pt_event_add ([kernel.kallsyms]) => ffffffff8115e687 event_sched_in.isra.107 ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     perf_pmu_enable              ffffffff8115e726 event_sched_in.isra.107 ([kernel.kallsyms]) => ffffffff811579b0 perf_pmu_enable ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     perf_pmu_nop_void            ffffffff81151730 perf_pmu_nop_void ([kernel.kallsyms]) => ffffffff8115e72b event_sched_in.isra.107 ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     event_sched_in.isra.107      ffffffff8115e737 event_sched_in.isra.107 ([kernel.kallsyms]) => ffffffff8115e7a5 group_sched_in ([kernel.kallsyms])
               swapper     0 [000] 156546.354971:          1   branches:     __x86_indirect_thunk_rax     ffffffff8115e7f6 group_sched_in ([kernel.kallsyms]) => ffffffff81a03000 __x86_indirect_thunk_rax ([kernel.kallsyms])
      
      After
      
      % perf script --itrace=cr -F +callindent,-ip,-sym,-symoff
             swapper     0 [000] 156546.354971:          1   branches:  pt_config
               swapper     0 [000] 156546.354971:          1   branches:      pt_config
               swapper     0 [000] 156546.354971:          1   branches:      pt_event_add
               swapper     0 [000] 156546.354971:          1   branches:       perf_pmu_enable
               swapper     0 [000] 156546.354971:          1   branches:       perf_pmu_nop_void
               swapper     0 [000] 156546.354971:          1   branches:       event_sched_in.isra.107
               swapper     0 [000] 156546.354971:          1   branches:       __x86_indirect_thunk_rax
               swapper     0 [000] 156546.354971:          1   branches:       perf_pmu_nop_int
               swapper     0 [000] 156546.354971:          1   branches:       group_sched_in
               swapper     0 [000] 156546.354971:          1   branches:       event_filter_match
               swapper     0 [000] 156546.354971:          1   branches:       event_filter_match
               swapper     0 [000] 156546.354971:          1   branches:       group_sched_in
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Link: http://lkml.kernel.org/r/20180918123214.26728-5-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      37fed3de
    • Andi Kleen's avatar
      tools lib subcmd: Support overwriting the pager · 03a1f49f
      Andi Kleen authored
      Add an interface to the auto pager code that allows callers to overwrite
      the pager.
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20180918123214.26728-3-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      03a1f49f
    • Andi Kleen's avatar
      perf tools: Report itrace options in help · c12e039d
      Andi Kleen authored
      I often forget all the options that --itrace accepts. Instead of burying
      them in the man page only report them in the normal command line help
      too to make them easier accessible.
      
      v2: Align
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Link: http://lkml.kernel.org/r/20180914031038.4160-2-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c12e039d
    • Sangwon Hong's avatar
      perf help: Add missing subcommand `version` · 3b9c25c0
      Sangwon Hong authored
      There isn't subcommand `version` when typing `perf help`.
      
      Before :
      
        $ perf help | grep version
         usage: perf [--version] [--help] [OPTIONS] COMMAND [ARGS]
      
      So add perf-version in command-list.txt for listing it when typing `perf
      help`.
      
      After :
      
      $ perf help | grep version
      
       usage: perf [--version] [--help] [OPTIONS] COMMAND [ARGS]
         version         display the version of perf binary
      Signed-off-by: default avatarSangwon Hong <qpakzk@gmail.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/20180919074911.41931-1-qpakzk@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3b9c25c0
    • Arnaldo Carvalho de Melo's avatar
      perf python: Use -Wno-redundant-decls to build with PYTHON=python3 · 24ef0fd0
      Arnaldo Carvalho de Melo authored
      When building in ClearLinux using 'make PYTHON=python3' with gcc 8.2.1
      it fails with:
      
          GEN      /tmp/build/perf/python/perf.so
        In file included from /usr/include/python3.7m/Python.h:126,
                         from /git/linux/tools/perf/util/python.c:2:
        /usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of ‘_PyImport_AddModuleObject’ [-Werror=redundant-decls]
         PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
        /usr/include/python3.7m/import.h:47:24: note: previous declaration of ‘_PyImport_AddModuleObject’ was here
         PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name,
                                ^~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
        error: command 'gcc' failed with exit status 1
      
      And indeed there is a redundant declaration in that Python.h file, one
      with parameter names and the other without, so just add
      -Wno-error=redundant-decls to the python setup instructions.
      
      Now perf builds with gcc in ClearLinux with the following Dockerfile:
      
        # docker.io/acmel/linux-perf-tools-build-clearlinux:latest
        FROM docker.io/clearlinux:latest
        MAINTAINER Arnaldo Carvalho de Melo <acme@kernel.org>
        RUN swupd update && \
            swupd bundle-add sysadmin-basic-dev
        RUN mkdir -m 777 -p /git /tmp/build/perf /tmp/build/objtool /tmp/build/linux && \
            groupadd -r perfbuilder && \
            useradd -m -r -g perfbuilder perfbuilder && \
            chown -R perfbuilder.perfbuilder /tmp/build/ /git/
        USER perfbuilder
        COPY rx_and_build.sh /
        ENV EXTRA_MAKE_ARGS=PYTHON=python3
        ENTRYPOINT ["/rx_and_build.sh"]
      
      Now to figure out why the build fails with clang, that is present in the
      above container as detected by the rx_and_build.sh script:
      
        clang version 6.0.1 (tags/RELEASE_601/final)
        Target: x86_64-unknown-linux-gnu
        Thread model: posix
        InstalledDir: /usr/sbin
        make: Entering directory '/git/linux/tools/perf'
          BUILD:   Doing 'make -j4' parallel build
          HOSTCC   /tmp/build/perf/fixdep.o
          HOSTLD   /tmp/build/perf/fixdep-in.o
          LINK     /tmp/build/perf/fixdep
      
        Auto-detecting system features:
        ...                         dwarf: [ OFF ]
        ...            dwarf_getlocations: [ OFF ]
        ...                         glibc: [ OFF ]
        ...                          gtk2: [ OFF ]
        ...                      libaudit: [ OFF ]
        ...                        libbfd: [ OFF ]
        ...                        libelf: [ OFF ]
        ...                       libnuma: [ OFF ]
        ...        numa_num_possible_cpus: [ OFF ]
        ...                       libperl: [ OFF ]
        ...                     libpython: [ OFF ]
        ...                      libslang: [ OFF ]
        ...                     libcrypto: [ OFF ]
        ...                     libunwind: [ OFF ]
        ...            libdw-dwarf-unwind: [ OFF ]
        ...                          zlib: [ OFF ]
        ...                          lzma: [ OFF ]
        ...                     get_cpuid: [ OFF ]
        ...                           bpf: [ OFF ]
      
        Makefile.config:331: *** No gnu/libc-version.h found, please install glibc-dev[el].  Stop.
        make[1]: *** [Makefile.perf:206: sub-make] Error 2
        make: *** [Makefile:70: all] Error 2
        make: Leaving directory '/git/linux/tools/perf'
      
      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: Thiago Macieira <thiago.macieira@intel.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-c3khb9ac86s00qxzjrueomme@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      24ef0fd0
    • Jérémie Galarneau's avatar
      perf tools: Initialize perf_data_file fd field · c04c859f
      Jérémie Galarneau authored
      Building the perf CTF converter fails with gcc 4.8.4 on Ubuntu 14.04
      with the following error:
      
        error: missing initializer for field ‘fd’ of ‘struct perf_data_file’
        [-Werror=missing-field-initializers]
      
      Per 4b838b0d ("perf tools: Add compression id into 'struct
      kmod_path'") and the ensuing discussion on the mailing list, it appears
      that this affects other distributions and gcc versions.
      Signed-off-by: default avatarJeremie Galarneau <jeremie.galarneau@efficios.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180829201648.19588-1-jeremie.galarneau@efficios.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c04c859f
    • Jiri Olsa's avatar
      perf util: Make copyfile_offset() global · ed93d0a2
      Jiri Olsa authored
      It will be used outside of util object in following patches.
      
      Committer note:
      
      We need to have the header with the definition for loff_t in util.h
      since we now use it in the copyfile_offset() signature.
      
      Also move that prototype closer to the other copyfile_ prefixed
      functions.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180913125450.21342-10-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ed93d0a2
    • Jiri Olsa's avatar
      perf tools: Add 'struct perf_mmap' arg to record__write() · ded2b8fe
      Jiri Olsa authored
      The struct perf_mmap map argument will hold the file pointer to write
      the data to.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180913125450.21342-5-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ded2b8fe
    • Jiri Olsa's avatar
      perf auxtrace: Pass struct perf_mmap into mmap__read* functions · e035f4ca
      Jiri Olsa authored
      The perf_mmap struct will hold a file pointer to write the mmap's
      contents, so we need to propagate it down the stack to record__write
      callers instead of its member the auxtrace_mmap struct.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180913125450.21342-4-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e035f4ca
    • Jiri Olsa's avatar
      perf tools: Remove perf_tool from event_op3 · 7336555a
      Jiri Olsa authored
      Now that we keep a perf_tool pointer inside perf_session, there's no need
      to have a perf_tool argument in the event_op3 callback. Remove it.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180913125450.21342-3-jolsa@kernel.org
      [ Fix the builtin-inject.c build for !HAVE_AUXTRACE_SUPPORT ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7336555a
    • Jiri Olsa's avatar
      perf tools: Remove perf_tool from event_op2 · 89f1688a
      Jiri Olsa authored
      Now that we keep a perf_tool pointer inside perf_session, there's no
      need to have a perf_tool argument in the event_op2 callback. Remove it.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180913125450.21342-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      89f1688a
    • Ding Xiang's avatar
      perf bpf-loader: use PTR_ERR_OR_ZERO inetead of return code · e381d1c2
      Ding Xiang authored
      Use PTR_ERR_OR_ZERO() in bpf__setup_stdout() return code instead of open
      coded equivalent.
      Signed-off-by: default avatarDing Xiang <dingxiang@cmss.chinamobile.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1536284082-23466-2-git-send-email-dingxiang@cmss.chinamobile.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e381d1c2
    • Ding Xiang's avatar
      tools include: Adopt PTR_ERR_OR_ZERO from the kernel err.h header · 01ab2e91
      Ding Xiang authored
      Add PTR_ERR_OR_ZERO, so that tools can use it, just like the kernel.
      Signed-off-by: default avatarDing Xiang <dingxiang@cmss.chinamobile.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1536284082-23466-1-git-send-email-dingxiang@cmss.chinamobile.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      01ab2e91
    • Jiri Olsa's avatar
      perf ordered_events: Prevent crossing max_alloc_size · 53da12e0
      Jiri Olsa authored
      Stephane reported a possible issue in the ordered events code, which
      could lead to allocating more memory than guarded by max_alloc_size.
      
      He also suggested the fix to properly check that the new size is below
      the max_alloc_size limit.
      Reported-by: default avatarStephane Eranian <eranian@google.com>
      Suggested-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180907102455.7030-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      53da12e0
    • Jiri Olsa's avatar
      perf ordered_events: Add 'struct ordered_events_buffer' layer · d5ceb62b
      Jiri Olsa authored
      When ordering events, we use preallocated buffers to store separate
      events.  Those buffers currently don't have their own struct, but since
      they are basically an array of 'struct ordered_event' objects, we use
      the first event to hold buffers data - list head, that holds all buffers
      together:
      
         struct ordered_events {
           ...
           struct ordered_event *buffer;
           ...
         };
      
         struct ordered_event {
           u64               timestamp;
           u64               file_offset;
           union perf_event  *event;
           struct list_head  list;
         };
      
      This is quite convoluted and error prone as demonstrated by free-ing
      issue discovered and fixed by Stephane in here [1].
      
      This patch adds the 'struct ordered_events_buffer' object, that holds
      the buffer data and frees it up properly.
      
      [1] - https://marc.info/?l=linux-kernel&m=153376761329335&w=2Reported-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarStephane Eranian <eranian@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180907102455.7030-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d5ceb62b
  2. 18 Sep, 2018 5 commits
  3. 12 Sep, 2018 7 commits
  4. 11 Sep, 2018 7 commits
    • Adrian Hunter's avatar
      perf tools: Fix maps__find_symbol_by_name() · 03db8b58
      Adrian Hunter authored
      Commit 1c5aae77 ("perf machine: Create maps for x86 PTI entry
      trampolines") revealed a problem with maps__find_symbol_by_name() that
      resulted in probes not being found e.g.
      
      	$ sudo perf probe xsk_mmap
      	xsk_mmap is out of .text, skip it.
      	Probe point 'xsk_mmap' not found.
      	   Error: Failed to add events.
      
      maps__find_symbol_by_name() can optionally return the map of the found
      symbol. It can get the map wrong because, in fact, the symbol is found
      on the map's dso, not allowing for the possibility that the dso has more
      than one map. Fix by always checking the map contains the symbol.
      Reported-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org
      Fixes: 1c5aae77 ("perf machine: Create maps for x86 PTI entry trampolines")
      Link: http://lkml.kernel.org/r/20180907085116.25782-1-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      03db8b58
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of linux/if_link.h · 5db48a8d
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	3e7a50ce ("net: report min and max mtu network device settings")
      	2756f68c ("net: bridge: add support for backup port")
      	a25717d2 ("xdp: support simultaneous driver and hw XDP attachment")
      	4f91da26 ("xdp: add per mode attributes for attached programs")
      	f203b76d ("xfrm: Add virtual xfrm interfaces")
      
      Silencing this libbpf 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: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-xd9ztioa894zemv8ag8kg64u@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5db48a8d
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of linux/vhost.h · 7f28785c
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	c48300c9 ("vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition")
      
      This makes 'perf trace' and other tools in the future using its
      beautifiers in a libbeauty.so library be able to translate these new
      ioctl to strings:
      
        $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh  > /tmp/after
        $ diff -u /tmp/before /tmp/after
        --- /tmp/before	2018-09-11 13:10:57.923038244 -0300
        +++ /tmp/after	2018-09-11 13:11:20.329012685 -0300
        @@ -15,6 +15,7 @@
              [0x22] = "SET_VRING_ERR",
              [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT",
              [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT",
        +     [0x25] = "SET_BACKEND_FEATURES",
              [0x30] = "NET_SET_BACKEND",
              [0x40] = "SCSI_SET_ENDPOINT",
              [0x41] = "SCSI_CLEAR_ENDPOINT",
        @@ -27,4 +28,5 @@
         static const char *vhost_virtio_ioctl_read_cmds[] = {
              [0x00] = "GET_FEATURES",
              [0x12] = "GET_VRING_BASE",
        +	[0x26] = "GET_BACKEND_FEATURES",
        };
        $
      
      We'll also use this to be able to express syscall filters using symbolic
      these symbolic names, something like:
      
      	# perf trace --all-cpus -e ioctl(cmd=*GET_FEATURES)
      
      This silences the following warning during perf's build:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h'
        diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-35x71oei2hdui9u0tarpimbq@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7f28785c
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copies of kvm headers · 0210c156
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	a4499382 ("KVM: s390: Add huge page enablement control")
      	8fcc4b59 ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
      	be26b3a7 ("arm64: KVM: export the capability to set guest SError syndrome")
      	b7b27fac ("arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS")
      	b0960b95 ("KVM: arm: Add 32bit get/set events support")
      	a3da7b4a ("KVM: s390: add etoken support for guests")
      
      This makes 'perf trace' automagically get aware of these new ioctls:
      
        $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
        $ tools/perf/trace/beauty/kvm_ioctl.sh  > /tmp/after
        $ diff -u /tmp/before /tmp/after
        --- /tmp/before	2018-09-11 11:18:29.173207586 -0300
        +++ /tmp/after	2018-09-11 11:18:38.488200446 -0300
        @@ -84,6 +84,8 @@
              [0xbb] = "MEMORY_ENCRYPT_REG_REGION",
              [0xbc] = "MEMORY_ENCRYPT_UNREG_REGION",
              [0xbd] = "HYPERV_EVENTFD",
        +     [0xbe] = "GET_NESTED_STATE",
        +     [0xbf] = "SET_NESTED_STATE",
              [0xe0] = "CREATE_DEVICE",
              [0xe1] = "SET_DEVICE_ATTR",
              [0xe2] = "G
      
      And cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h'
      	diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Dongjiu Geng <gengdongjiu@huawei.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: James Morse <james.morse@arm.com>
      Cc: Janosch Frank <frankja@linux.ibm.com>
      Cc: Jim Mattson <jmattson@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0210c156
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of drm/drm.h · 434ea1bf
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	d67b6a20 ("drm: writeback: Add client capability for exposing writeback connectors")
      
      This is for an argument to a DRM ioctl, which is not being prettyfied in
      the 'perf trace' DRM ioctl beautifier, but will now that syscalls are
      starting to have pointer arguments augmented via BPF.
      
      This time around this just cures the following warning during perf's
      build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h'
      	diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Brian Starkey <brian.starkey@arm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-n7qib1bac6mc6w9oke7r4qdc@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      434ea1bf
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of asm-generic/unistd.h · f9e6e435
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	db7a2d18 ("asm-generic: unistd.h: Wire up sys_rseq")
      
      That wires up the new 'rsec' system call, which will automagically
      support that syscall in the syscall table used by 'perf trace' on
      arm/arm64.
      
      This cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
      	diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://lkml.kernel.org/n/tip-vt7k2itnitp1t9p3dp7qeb08@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f9e6e435
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of linux/perf_event.h · 0ee03d93
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
      	09121255 ("perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use")
      
      This cures the following warning during perf's build:
      
      	Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
      	diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      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>
      Link: https://lkml.kernel.org/n/tip-2vvwh2o19orn56di0ksrtgzr@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0ee03d93
  5. 10 Sep, 2018 4 commits
  6. 09 Sep, 2018 1 commit