1. 03 9月, 2021 4 次提交
    • J
      perf cs-etm: Save TRCDEVARCH register · 51ba8811
      James Clark 提交于
      When ETE is present save the TRCDEVARCH register and set a new magic
      number. It will be used to configure the decoder in a later commit.
      
      Old versions of perf will not be able to open files with this new magic
      number, but old files will still work with newer versions of perf.
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Acked-by: NSuzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https //lore.kernel.org/r/20210806134109.1182235-5-james.clark@arm.com
      [ Addressed some cosmetic suggestions by Suzuki Poulouse ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      51ba8811
    • J
      perf cs-etm: Refactor out ETMv4 header saving · c9ccc96b
      James Clark 提交于
      Extract a function for saving the ETMv4 header because this will be used
      for ETE in a later commit.
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Acked-by: NSuzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https //lore.kernel.org/r/20210806134109.1182235-4-james.clark@arm.com
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c9ccc96b
    • J
      perf cs-etm: Initialise architecture based on TRCIDR1 · f4aef1ea
      James Clark 提交于
      Currently the architecture is hard coded as ARCH_V8, but from ETMv4.4
      onwards this should be ARCH_AA64.
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https //lore.kernel.org/r/20210806134109.1182235-3-james.clark@arm.com
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f4aef1ea
    • J
      perf cs-etm: Refactor initialisation of decoder params. · 991f69e9
      James Clark 提交于
      The initialisation of the decoder params is duplicated between
      creation of the packet printer and packet decoder. Put them both
      into one function so that future changes only need to be made in one
      place.
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Acked-by: NSuzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https //lore.kernel.org/r/20210806134109.1182235-2-james.clark@arm.com
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      991f69e9
  2. 01 9月, 2021 25 次提交
  3. 31 8月, 2021 4 次提交
  4. 30 8月, 2021 7 次提交
    • J
      perf tests: Fix *probe_vfs_getname.sh test failures · a05b4270
      James Clark 提交于
      The commit 4d6101f5 ("perf probe: Clarify error message about
      not finding kernel modules debuginfo") changed the error message "Failed
      to find the path for kernel" to "Failed to find the path for the
      kernel".
      
      Update the regex so that the tests still skip rather than fail when
      kernel debug symbols aren't present.
      Signed-off-by: NJames Clark <james.clark@arm.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Link: http://lore.kernel.org/lkml/20210825164259.833222-1-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a05b4270
    • A
      perf bench inject-buildid: Handle writen() errors · edf7b4a2
      Arnaldo Carvalho de Melo 提交于
      The build on fedora:35 and fedora:rawhide with clang is failing with:
      
        49    41.00 fedora:35                     : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35)
          bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
                  u64 len = 0;
                      ^
          1 error generated.
          make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2
        50    41.11 fedora:rawhide                : FAIL clang version 13.0.0 (Fedora 13.0.0~rc1-1.fc35)
          bench/inject-buildid.c:351:6: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
                  u64 len = 0;
                      ^
          1 error generated.
          make[3]: *** [/git/perf-5.14.0-rc7/tools/build/Makefile.build:139: bench] Error 2
      
      That 'len' variable is not used at all, so just make sure all the
      synthesize_RECORD() routines return ssize_t to propagate the writen()
      return, as it may fail, ditch the 'ret' var and bail out if those
      routines fail.
      
      Fixes: 0bf02a0d ("perf bench: Add build-id injection benchmark")
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/CAM9d7cgEZNSor+B+7Y2C+QYGme_v5aH0Zn0RLfxoQ+Fy83EHrg@mail.gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      edf7b4a2
    • L
      perf unwind: Do not overwrite FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} · cdf32b44
      Li Huafei 提交于
      When setting LIBUNWIND_DIR, we first set
      
       FEATURE_CHECK_LDFLAGS-libunwind-{aarch64,x86} = -L$(LIBUNWIND_DIR)/lib.
      
      <committer note>
      This happens a bit before, the overwritting, in:
      
        libunwind_arch_set_flags = $(eval $(libunwind_arch_set_flags_code))
        define libunwind_arch_set_flags_code
          FEATURE_CHECK_CFLAGS-libunwind-$(1)  = -I$(LIBUNWIND_DIR)/include
          FEATURE_CHECK_LDFLAGS-libunwind-$(1) = -L$(LIBUNWIND_DIR)/lib
        endef
      
        ifdef LIBUNWIND_DIR
          LIBUNWIND_CFLAGS  = -I$(LIBUNWIND_DIR)/include
          LIBUNWIND_LDFLAGS = -L$(LIBUNWIND_DIR)/lib
          LIBUNWIND_ARCHS = x86 x86_64 arm aarch64 debug-frame-arm debug-frame-aarch64
          $(foreach libunwind_arch,$(LIBUNWIND_ARCHS),$(call libunwind_arch_set_flags,$(libunwind_arch)))
        endif
      
      Look at that 'foreach' on all the LIBUNWIND_ARCHS.
      </>
      
      After commit 5c4d7c82 ("perf unwind: Do not put libunwind-{x86,aarch64}
      in FEATURE_TESTS_BASIC"), FEATURE_CHECK_LDFLAGS-libunwind-{x86,aarch64} is
      overwritten. As a result, the remote libunwind libraries cannot be searched
      from $(LIBUNWIND_DIR)/lib directory during feature check tests. Fix it with
      variable appending.
      
      Before this patch:
      
        perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
         BUILD:   Doing 'make -j16' parallel build
        <SNIP>
        ...
        ...                    libopencsd: [ OFF ]
        ...                 libunwind-x86: [ OFF ]
        ...              libunwind-x86_64: [ OFF ]
        ...                 libunwind-arm: [ OFF ]
        ...             libunwind-aarch64: [ OFF ]
        ...         libunwind-debug-frame: [ OFF ]
        ...     libunwind-debug-frame-arm: [ OFF ]
        ... libunwind-debug-frame-aarch64: [ OFF ]
        ...                           cxx: [ OFF ]
        <SNIP>
      
        perf$ cat ../build/feature/test-libunwind-aarch64.make.output
        /usr/bin/ld: cannot find -lunwind-aarch64
        /usr/bin/ld: cannot find -lunwind-aarch64
        collect2: error: ld returned 1 exit status
      
      After this patch:
      
        perf$ make VF=1 LIBUNWIND_DIR=/opt/libunwind_aarch64
         BUILD:   Doing 'make -j16' parallel build
        <SNIP>
        ...                    libopencsd: [ OFF ]
        ...                 libunwind-x86: [ OFF ]
        ...              libunwind-x86_64: [ OFF ]
        ...                 libunwind-arm: [ OFF ]
        ...             libunwind-aarch64: [ on  ]
        ...         libunwind-debug-frame: [ OFF ]
        ...     libunwind-debug-frame-arm: [ OFF ]
        ... libunwind-debug-frame-aarch64: [ OFF ]
        ...                           cxx: [ OFF ]
        <SNIP>
      
        perf$ cat ../build/feature/test-libunwind-aarch64.make.output
      
        perf$ ldd ./perf
              linux-vdso.so.1 (0x00007ffdf07da000)
              libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f30953dc000)
              librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f30951d4000)
              libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3094e36000)
              libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3094c32000)
              libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f3094a18000)
              libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f30947cc000)
              libunwind-x86_64.so.8 => /usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007f30945ad000)
              libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f3094392000)
              liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f309416c000)
              libunwind-aarch64.so.8 => not found
              libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f3093c8a000)
              libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 (0x00007f309386b000)
              libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f309364e000)
              libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f3093443000)
              libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3093052000)
              /lib64/ld-linux-x86-64.so.2 (0x00007f3096097000)
              libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3092e42000)
              libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f3092c3f000)
      
      Fixes: 5c4d7c82 ("perf unwind: Do not put libunwind-{x86,aarch64} in FEATURE_TESTS_BASIC")
      Signed-off-by: NLi Huafei <lihuafei1@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhang Jinhao <zhangjinhao2@huawei.com>
      Link: http://lore.kernel.org/lkml/20210823134340.60955-1-lihuafei1@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cdf32b44
    • A
      perf config: Fix caching and memory leak in perf_home_perfconfig() · 261f4911
      Arnaldo Carvalho de Melo 提交于
      Acaict, perf_home_perfconfig() is supposed to cache the result of
      home_perfconfig, which returns the default location of perfconfig for
      the user, given the HOME environment variable.
      
      However, the current implementation calls home_perfconfig every time
      perf_home_perfconfig() is called (so no caching is actually performed),
      replacing the previous pointer, thus also causing a memory leak.
      
      This patch adds a check of whether either config or failed is set and,
      in that case, directly returns config without calling home_perfconfig at
      each invocation.
      
      Fixes: f5f03e19 ("perf config: Add perf_home_perfconfig function")
      Signed-off-by: NRiccardo Mancini <rickyman7@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Link: http://lore.kernel.org/lkml/20210820130817.740536-1-rickyman7@gmail.com
      [ Removed needless double check for the 'failed' variable ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      261f4911
    • A
      perf tools: Fixup get_current_dir_name() compilation · 128dbd78
      Alexey Dobriyan 提交于
      strdup() prototype doesn't live in stdlib.h .
      
      Add limits.h for PATH_MAX definition as well.
      
      This fixes the build on Android.
      Signed-off-by: NAlexey Dobriyan (SK hynix) <adobriyan@gmail.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Link: http://lore.kernel.org/lkml/YRukaQbrgDWhiwGr@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      128dbd78
    • A
      c635813f
    • L
      Linux 5.14 · 7d2a07b7
      Linus Torvalds 提交于
      7d2a07b7