1. 28 10月, 2022 3 次提交
  2. 27 10月, 2022 3 次提交
    • L
      Merge tag 'perf-tools-fixes-for-v6.1-2022-10-26' of... · b229b6ca
      Linus Torvalds 提交于
      Merge tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool fixes from Arnaldo Carvalho de Melo:
      
       - Fix some aspects of building with an older (than the one in the
         kernel sources) libbpf present in a distro, when building with
         LIBBPF_DYNAMIC=1.
      
       - Fix errno setting races with event_fd and the signal handler in 'perf
         record'.
      
       - Fix Power10 hv-24x7 metric events when some events may have a zero
         count based on system configuration.
      
       - Do not fail Intel-PT misc test w/o libpython, just skip it.
      
       - Fix incorrect arm64 Hisi hip08 L3 metrics (IF_BP_MISP_BR_RET,
         IF_BP_MISP_BR_RET, IF_BP_MISP_BR_BL) due to mistakes in the
         documentation used to generate the JSON files for these metrics.
      
       - Fix auxtrace (Intel PT, ARM Coresight) address filter symbol name
         match for modules, we need to skip the module name.
      
       - Sync copies of files with the kernel sources, including ppc syscall
         tables and assorted headers, some resulting in tools being able to
         decode new network protocols (IPPROTO_L2TP) and statx masks
         (STATX_DIOALIGN).
      
       - Fix PMU name pai_crypto in the vendor events file (JSON) for s390.
      
       - Fix man page build wrt perf-arm-coresight.txt as the build process
         assumes files starting with 'perf-' are man pages, and this file
         isn't one.
      
      * tag 'perf-tools-fixes-for-v6.1-2022-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf vendor events arm64: Fix incorrect Hisi hip08 L3 metrics
        perf auxtrace: Fix address filter symbol name match for modules
        tools headers UAPI: Sync linux/perf_event.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
        tools headers uapi: Sync linux/stat.h with the kernel sources
        tools include UAPI: Sync sound/asound.h copy with the kernel sources
        tools headers uapi: Update linux/in.h copy
        tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench'
        tools headers arm64: Sync arm64's cputype.h with the kernel sources
        perf test: Do not fail Intel-PT misc test w/o libpython
        perf list: Fix PMU name pai_crypto in perf list on s390
        perf record: Fix event fd races
        perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available
        perf bpf: Fix build with libbpf 0.7.0 by adding prototype for bpf_load_program()
        perf vendor events power10: Fix hv-24x7 metric events
        perf docs: Fix man page build wrt perf-arm-coresight.txt
        tools headers UAPI: Sync powerpc syscall tables with the kernel sources
      b229b6ca
    • L
      Merge tag 'spi-fix-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · a2718383
      Linus Torvalds 提交于
      Pull spi fixes from Mark Brown:
       "A collection of mostly unremarkable fixes for SPI that have built up
        since the merge window, all driver specific.
      
        The change to the qup adding support for GPIO chip selects is fixing a
        regression due to the removal of legacy GPIO handling, the driver had
        previously been silently relying on the legacy GPIO support in a
        slightly broken way which worked well enough on some systems. Fixing
        it is simply a case of setting a couple of bits of information in the
        driver description"
      
      * tag 'spi-fix-v6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: aspeed: Fix window offset of CE1
        spi: qup: support using GPIO as chip select line
        spi: intel: Fix the offset to get the 64K erase opcode
        spi: aspeed: Fix typo in mode_bits field for AST2600 platform
        spi: mpc52xx: Replace NO_IRQ by 0
        spi: spi-mem: Fix typo (of -> or)
        spi: spi-gxp: fix typo in SPDX identifier line
        spi: tegra210-quad: Fix combined sequence
      a2718383
    • L
      Merge tag 'arc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 98555239
      Linus Torvalds 提交于
      Pull ARC fixes from Vineet Gupta:
      
       - fix for Page Table mem leak
      
       - defconfig updates
      
       - misc other fixes
      
      * tag 'arc-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: mm: fix leakage of memory allocated for PTE
        arc: update config files
        arc: iounmap() arg is volatile
        arc: dts: Harmonize EHCI/OHCI DT nodes name
        ARC: bitops: Change __fls to return unsigned long
        ARC: Fix comment typo
        ARC: Fix comment typo
      98555239
  3. 26 10月, 2022 21 次提交
    • S
      perf vendor events arm64: Fix incorrect Hisi hip08 L3 metrics · e9229d5b
      Shang XiaoJing 提交于
      Commit 0cc177cf ("perf vendor events arm64: Add Hisi hip08 L3
      metrics") add L3 metrics of hip08, but some metrics (IF_BP_MISP_BR_RET,
      IF_BP_MISP_BR_RET, IF_BP_MISP_BR_BL) have incorrect event number due to
      the mistakes in document, which caused incorrect result. Fix the
      incorrect metrics.
      
      Before:
      
        65,811,214,308	armv8_pmuv3_0/event=0x1014/	# 18.87 push_branch
        							# -40.19 other_branch
        3,564,316,780	BR_MIS_PRED				# 0.51 indirect_branch
        							# 21.81 pop_branch
      
      After:
      
        6,537,146,245	BR_MIS_PRED			# 0.48 indirect_branch
        						# 0.47 pop_branch
        						# 0.00 push_branch
        						# 0.05 other_branch
      
      Fixes: 0cc177cf ("perf vendor events arm64: Add Hisi hip08 L3 metrics")
      Reviewed-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NShang XiaoJing <shangxiaojing@huawei.com>
      Acked-by: NJames Clark <james.clark@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20221021105035.10000-2-shangxiaojing@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e9229d5b
    • A
      perf auxtrace: Fix address filter symbol name match for modules · cba04f31
      Adrian Hunter 提交于
      For modules, names from kallsyms__parse() contain the module name which
      meant that module symbols did not match exactly by name.
      
      Fix by matching the name string up to the separating tab character.
      
      Fixes: 1b36c03e ("perf record: Add support for using symbols in address filters")
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20221026072736.2982-1-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cba04f31
    • A
      tools headers UAPI: Sync linux/perf_event.h with the kernel sources · 831c05a7
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in:
      
        cfef80ba ("perf/uapi: Define PERF_MEM_SNOOPX_PEER in kernel header file")
        ee3e88df ("perf/mem: Introduce PERF_MEM_LVLNUM_{EXTN_MEM|IO}")
        b4e12b2d ("perf: Kill __PERF_SAMPLE_CALLCHAIN_EARLY")
      
      There is a kernel patch pending that renames PERF_MEM_LVLNUM_EXTN_MEM to
      PERF_MEM_LVLNUM_CXL, tooling this time is ahead of the kernel :-)
      
      This thus partially addresses this perf build warning:
      
        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: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Link: https://lore.kernel.org/lkml/Y1k53KMdzypmU0WS@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      831c05a7
    • K
      overflow: Refactor test skips for Clang-specific issues · 72c3ebea
      Kees Cook 提交于
      Convert test exclusion into test skipping. This brings the logic for
      why a test is being skipped into the test itself, instead of having to
      spread ifdefs around the code. This will make cleanup easier as minimum
      tests get raised. Drop __maybe_unused so missed tests will be noticed
      again and clean up whitespace.
      
      For example, clang-11 on i386:
      
      [15:52:32] ================== overflow (18 subtests) ==================
      [15:52:32] [PASSED] u8_u8__u8_overflow_test
      [15:52:32] [PASSED] s8_s8__s8_overflow_test
      [15:52:32] [PASSED] u16_u16__u16_overflow_test
      [15:52:32] [PASSED] s16_s16__s16_overflow_test
      [15:52:32] [PASSED] u32_u32__u32_overflow_test
      [15:52:32] [PASSED] s32_s32__s32_overflow_test
      [15:52:32] [SKIPPED] u64_u64__u64_overflow_test
      [15:52:32] [SKIPPED] s64_s64__s64_overflow_test
      [15:52:32] [SKIPPED] u32_u32__int_overflow_test
      [15:52:32] [PASSED] u32_u32__u8_overflow_test
      [15:52:32] [PASSED] u8_u8__int_overflow_test
      [15:52:32] [PASSED] int_int__u8_overflow_test
      [15:52:32] [PASSED] shift_sane_test
      [15:52:32] [PASSED] shift_overflow_test
      [15:52:32] [PASSED] shift_truncate_test
      [15:52:32] [PASSED] shift_nonsense_test
      [15:52:32] [PASSED] overflow_allocation_test
      [15:52:32] [PASSED] overflow_size_helpers_test
      [15:52:32] ==================== [PASSED] overflow =====================
      [15:52:32] ============================================================
      [15:52:32] Testing complete. Ran 18 tests: passed: 15, skipped: 3
      
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Daniel Latypov <dlatypov@google.com>
      Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
      Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Cc: llvm@lists.linux.dev
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Tested-by: NNick Desaulniers <ndesaulniers@google.com>
      Link: https://lore.kernel.org/r/20221006230017.1833458-1-keescook@chromium.org
      72c3ebea
    • N
      overflow: disable failing tests for older clang versions · 0e5b9f25
      Nick Desaulniers 提交于
      Building the overflow kunit tests with clang-11 fails with:
      
      $ ./tools/testing/kunit/kunit.py run --arch=arm --make_options LLVM=1 \
      overflow
      ...
      ld.lld: error: undefined symbol: __mulodi4
      ...
      
      Clang 11 and earlier generate unwanted libcalls for signed output,
      unsigned input.
      
      Disable these tests for now, but should these become used in the kernel
      we might consider that as justification for dropping clang-11 support.
      Keep the clang-11 build alive a little bit longer.
      
      Avoid -Wunused-function warnings via __maybe_unused. To test W=1:
      
      $ make LLVM=1 -j128 defconfig
      $ ./scripts/config -e KUNIT -e KUNIT_ALL
      $ make LLVM=1 -j128 olddefconfig lib/overflow_kunit.o W=1
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1711
      Link: https://github.com/llvm/llvm-project/commit/3203143f1356a4e4e3ada231156fc6da6e1a9f9dReported-by: NNathan Chancellor <nathan@kernel.org>
      Signed-off-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20221006171751.3444575-1-ndesaulniers@google.com
      0e5b9f25
    • K
      overflow: Fix kern-doc markup for functions · 31970608
      Kees Cook 提交于
      Fix the kern-doc markings for several of the overflow helpers and move
      their location into the core kernel API documentation, where it belongs
      (it's not driver-specific).
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-doc@vger.kernel.org
      Cc: linux-hardening@vger.kernel.org
      Reviewed-by: NAkira Yokosawa <akiyks@gmail.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      31970608
    • A
      tools headers cpufeatures: Sync with the kernel sources · 74455fd7
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        257449c6 ("x86/cpufeatures: Add LbrExtV2 feature bit")
      
      This only causes these perf files to be rebuilt:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
      
      And addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Link: https://lore.kernel.org/lkml/Y1g6vGPqPhOrXoaN@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      74455fd7
    • A
      tools headers uapi: Sync linux/stat.h with the kernel sources · 49c75d30
      Arnaldo Carvalho de Melo 提交于
      To pick the changes from:
      
        825cf206 ("statx: add direct I/O alignment information")
      
      That add a constant that was manually added to tools/perf/trace/beauty/statx.c,
      at some point this should move to the shell based automated way.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/stat.h' differs from latest version at 'include/uapi/linux/stat.h'
        diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h
      
      Cc: Eric Biggers <ebiggers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/Y1gGQL5LonnuzeYd@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      49c75d30
    • A
      tools include UAPI: Sync sound/asound.h copy with the kernel sources · 82c50d89
      Arnaldo Carvalho de Melo 提交于
      Picking the changes from:
      
        69ab6f5b ("ALSA: Remove some left-over license text in include/uapi/sound/")
      
      Which entails no changes in the tooling side as it doesn't introduce new
      SNDRV_PCM_IOCTL_ ioctls.
      
      To silence this perf tools build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h'
        diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82c50d89
    • A
      tools headers uapi: Update linux/in.h copy · 036b8f5b
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
        65b32f80 ("uapi: move IPPROTO_L2TP to in.h")
        5854a09b ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper")
      
      That ends up automatically adding the new IPPROTO_L2TP to the socket
      args beautifiers:
      
        $ tools/perf/trace/beauty/socket.sh > before
        $ cp include/uapi/linux/in.h tools/include/uapi/linux/in.h
        $ tools/perf/trace/beauty/socket.sh > after
        $ diff -u before after
        --- before	2022-10-25 12:17:02.577892416 -0300
        +++ after	2022-10-25 12:17:10.806113033 -0300
        @@ -20,6 +20,7 @@
         	[98] = "ENCAP",
         	[103] = "PIM",
         	[108] = "COMP",
        +	[115] = "L2TP",
         	[132] = "SCTP",
         	[136] = "UDPLITE",
         	[137] = "MPLS",
        $
      
      Now 'perf trace' will decode that 115 into "L2TP" and it will also be
      possible to use it in tracepoint filter expressions.
      
      Addresses this tools/perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h'
        diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Wojciech Drewek <wojciech.drewek@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/lkml/Y1f%2FGe6vjQrGjYiK@kernel.org/Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      036b8f5b
    • A
      tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench' · 4402e360
      Arnaldo Carvalho de Melo 提交于
      We also need to add SYM_TYPED_FUNC_START() to util/include/linux/linkage.h
      and update tools/perf/check_headers.sh to ignore the include cfi_types.h
      line when checking if the kernel original files drifted from the copies
      we carry.
      
      This is to get the changes from:
      
        ccace936 ("x86: Add types to indirectly called assembly functions")
      
      Addressing these tools/perf build warnings:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
        diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Link: https://lore.kernel.org/lkml/Y1f3VRIec9EBgX6F@kernel.org/Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4402e360
    • A
      tools headers arm64: Sync arm64's cputype.h with the kernel sources · ffc1df3d
      Arnaldo Carvalho de Melo 提交于
      To get the changes in:
      
        0e5d5ae8 ("arm64: Add AMPERE1 to the Spectre-BHB affected list")
      
      That addresses this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 'arch/arm64/include/asm/cputype.h'
        diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: D Scott Phillips <scott@os.amperecomputing.com>
      https://lore.kernel.org/lkml/Y1fy5GD7ZYvkeufv@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ffc1df3d
    • N
      perf test: Do not fail Intel-PT misc test w/o libpython · 246122a8
      Namhyung Kim 提交于
      The virtual LBR test uses a python script to check the max size of
      branch stack in the Intel-PT generated LBR.  But it didn't check whether
      python scripting is available (as it's optional).
      
      Let's skip the test if the python support is not available.
      
      Fixes: f77811a0 ("perf test: test_intel_pt.sh: Add 9 tests")
      Reviewed-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NIan Rogers <irogers@google.com>
      Cc: Ammy Yi <ammy.yi@intel.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20221021181055.60183-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      246122a8
    • T
      perf list: Fix PMU name pai_crypto in perf list on s390 · 5a6c184a
      Thomas Richter 提交于
      Commit e0b23af8 ("perf list: Add PMU pai_crypto event
      description for IBM z16") introduced the "Processor Activity
      Instrumentation" for cryptographic counters for z16. The PMU device
      driver exports the counters via sysfs files listed in directory
      /sys/devices/pai_crypto.
      
      To specify an event from that PMU, use 'perf stat -e pai_crypto/XXX/'.
      
      However the JSON file mentioned in above commit exports the counter
      decriptions in file pmu-events/arch/s390/cf_z16/pai.json.  Rename this
      file to pmu-events/arch/s390/cf_z16/pai_crypto.json to make the naming
      consistent.
      
      Now 'perf list' shows the counter names under pai_crypto section:
      
        pai_crypto:
      
          CRYPTO_ALL
               [CRYPTO ALL. Unit: pai_crypto]
          ...
      
      Output before was
      
        pai:
          CRYPTO_ALL
               [CRYPTO ALL. Unit: pai_crypto]
          ...
      
      Fixes: e0b23af8 ("perf list: Add PMU pai_crypto event description for IBM z16")
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Acked-by: NSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: https://lore.kernel.org/r/20221021082557.2695382-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5a6c184a
    • I
      perf record: Fix event fd races · 304f0a2f
      Ian Rogers 提交于
      The write call may set errno which is problematic if occurring in a
      function also setting errno. Save and restore errno around the write
      call.
      
      done_fd may be used after close, clear it as part of the close and check
      its validity in the signal handler.
      
      Suggested-by: <gthelen@google.com>
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Anand K Mistry <amistry@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20221024011024.462518-1-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      304f0a2f
    • A
      perf bpf: Fix build with libbpf 0.7.0 by checking if bpf_program__set_insns() is available · f1bdebbb
      Arnaldo Carvalho de Melo 提交于
      During the transition to libbpf 1.0 some functions that perf used were
      deprecated and finally removed from libbpf, so bpf_program__set_insns()
      was introduced for perf to continue to use its bpf loader.
      
      But when build with LIBBPF_DYNAMIC=1 we now need to check if that
      function is available so that perf can build with older libbpf versions,
      even if the end result is emitting a warning to the user that the use
      of the perf BPF loader requires a newer libbpf, since bpf_program__set_insns()
      touches libbpf objects internal state.
      
      This affects only 'perf trace' when using bpf C code or pre-compiled
      bytecode as an event.
      
      Noticed on RHEL9, that has libbpf 0.7.0, where bpf_program__set_insns()
      isn't available.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1bdebbb
    • A
      perf bpf: Fix build with libbpf 0.7.0 by adding prototype for bpf_load_program() · 409fb6bd
      Arnaldo Carvalho de Melo 提交于
      The bpf_load_program() prototype appeared in tools/lib/bpf/bpf.h as
      deprecated, but nowadays its completely removed, so add it back for
      building with the system libbpf when using 'make LIBBPF_DYNAMIC=1'.
      
      This is a stop gap hack till we do like tools/bpf does with bpftool,
      i.e. bootstrap the libbpf build and install it in the perf build
      directory when not using 'make LIBBPF_DYNAMIC=1'.
      
      That has to be done to all libraries in tools/lib/, so tha we can
      remove -Itools/lib/ from the tools/perf CFLAGS.
      
      Noticed when building with LIBBPF_DYNAMIC=1 and libbpf 0.7.0 on RHEL9.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      409fb6bd
    • K
      perf vendor events power10: Fix hv-24x7 metric events · b92dd117
      Kajol Jain 提交于
      Testcase stat_all_metrics.sh fails in powerpc:
      
        90: perf all metrics test : FAILED!
      
      The testcase "stat_all_metrics.sh" verifies perf stat result for all the
      metric events present in perf list.  It runs perf metric events with
      various commands and expects non-empty metric result.
      
      Incase of powerpc:hv-24x7 events, some of the event count can be 0 based
      on system configuration. And if that event used as denominator in divide
      equation, it can cause divide by 0 error. The current nest_metric.json
      file creating divide by 0 issue for some of the metric events, which
      results in failure of the "stat_all_metrics.sh" test case.
      
      Most of the metrics events have cycles or an event which expect to have
      a larger value as denominator, so adding 1 to the denominator of the
      metric expression as a fix.
      
      Result in powerpc box after this patch changes:
      
        90: perf all metrics test : Ok
      
      Fixes: a3cbcadf ("perf vendor events power10: Adds 24x7 nest metric events for power10 platform")
      Signed-off-by: NKajol Jain <kjain@linux.ibm.com>
      Reviewed-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
      Link: https://lore.kernel.org/r/20221014140220.122251-1-kjain@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b92dd117
    • A
      perf docs: Fix man page build wrt perf-arm-coresight.txt · 231e61bc
      Adrian Hunter 提交于
      perf build assumes documentation files starting with "perf-" are man
      pages but perf-arm-coresight.txt is not a man page:
      
        asciidoc: ERROR: perf-arm-coresight.txt: line 2: malformed manpage title
        asciidoc: ERROR: perf-arm-coresight.txt: line 3: name section expected
        asciidoc: FAILED: perf-arm-coresight.txt: line 3: section title expected
        make[3]: *** [Makefile:266: perf-arm-coresight.xml] Error 1
        make[3]: *** Waiting for unfinished jobs....
        make[2]: *** [Makefile.perf:895: man] Error 2
      
      Fix by renaming it.
      
      Fixes: dc2e0fb0 ("perf test coresight: Add relevant documentation about ARM64 CoreSight testing")
      Reported-by: NChristian Borntraeger <borntraeger@linux.ibm.com>
      Reported-by: NSven Schnelle <svens@linux.ibm.com>
      Reviewed-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Carsten Haitzler <carsten.haitzler@arm.com>
      Cc: coresight@lists.linaro.org
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Link: https://lore.kernel.org/r/a176a3e1-6ddc-bb63-e41c-15cda8c2d5d2@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      231e61bc
    • A
      tools headers UAPI: Sync powerpc syscall tables with the kernel sources · 88864611
      Arnaldo Carvalho de Melo 提交于
      To pick the changes in these csets:
      
        e2375062 ("powerpc/32: fix syscall wrappers with 64-bit arguments of unaligned register-pairs")
      
      That doesn't cause any changes in the perf tools.
      
      As a reminder, this table is used in tools perf to allow features such as:
      
        [root@five ~]# perf trace -e set_mempolicy_home_node
        ^C[root@five ~]#
        [root@five ~]# perf trace -v -e set_mempolicy_home_node
        Using CPUID AuthenticAMD-25-21-0
        event qualifier tracepoint filter: (common_pid != 253729 && common_pid != 3585) && (id == 450)
        mmap size 528384B
        ^C[root@five ~]
        [root@five ~]# perf trace -v -e set*  --max-events 5
        Using CPUID AuthenticAMD-25-21-0
        event qualifier tracepoint filter: (common_pid != 253734 && common_pid != 3585) && (id == 38 || id == 54 || id == 105 || id == 106 || id == 109 || id == 112 || id == 113 || id == 114 || id == 116 || id == 117 || id == 119 || id == 122 || id == 123 || id == 141 || id == 160 || id == 164 || id == 170 || id == 171 || id == 188 || id == 205 || id == 218 || id == 238 || id == 273 || id == 308 || id == 450)
        mmap size 528384B
             0.000 ( 0.008 ms): bash/253735 setpgid(pid: 253735 (bash), pgid: 253735 (bash))      = 0
          6849.011 ( 0.008 ms): bash/16046 setpgid(pid: 253736 (bash), pgid: 253736 (bash))       = 0
          6849.080 ( 0.005 ms): bash/253736 setpgid(pid: 253736 (bash), pgid: 253736 (bash))      = 0
          7437.718 ( 0.009 ms): gnome-shell/253737 set_robust_list(head: 0x7f34b527e920, len: 24) = 0
         13445.986 ( 0.010 ms): bash/16046 setpgid(pid: 253738 (bash), pgid: 253738 (bash))       = 0
        [root@five ~]#
      
      That is the filter expression attached to the raw_syscalls:sys_{enter,exit}
      tracepoints.
      
        $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w set_mempolicy_home_node
        tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:450	common	set_mempolicy_home_node		sys_set_mempolicy_home_node
        tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:450 	nospu	set_mempolicy_home_node		sys_set_mempolicy_home_node
        tools/perf/arch/s390/entry/syscalls/syscall.tbl:450  common	set_mempolicy_home_node	sys_set_mempolicy_home_node	sys_set_mempolicy_home_node
        tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:450	common	set_mempolicy_home_node	sys_set_mempolicy_home_node
        $
      
        $ grep -w set_mempolicy_home_node /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c
      	[450] = "set_mempolicy_home_node",
        $
      
      This addresses these perf build warnings:
      
        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
        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'
        diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/powerpc/entry/syscalls/syscall.tbl' differs from latest version at 'arch/powerpc/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/s390/entry/syscalls/syscall.tbl' differs from latest version at 'arch/s390/kernel/syscalls/syscall.tbl'
        diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
        Warning: Kernel ABI header at 'tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl' differs from latest version at 'arch/mips/kernel/syscalls/syscall_n64.tbl'
        diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Link: https://lore.kernel.org/lkml/Y01HN2DGkWz8tC%2FJ@kernel.org/Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      88864611
    • L
      Merge tag 'platform-drivers-x86-v6.1-2' of... · 4dc12f37
      Linus Torvalds 提交于
      Merge tag 'platform-drivers-x86-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
       "The only thing which stands out is a fix for a backlight regression on
        Chromebooks (under drivers/acpi, with ack from Rafael).
      
        Other then that nothing special to report just various small fixes and
        hardware-id additions"
      
      * tag 'platform-drivers-x86-v6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        ACPI: video: Fix missing native backlight on Chromebooks
        platform/x86/intel: pmc/core: Add Raptor Lake support to pmc core driver
        leds: simatic-ipc-leds-gpio: fix incorrect LED to GPIO mapping
        platform/x86/amd: pmc: Read SMU version during suspend on Cezanne systems
        platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models
        platform/x86: asus-wmi: Add support for ROG X16 tablet mode
      4dc12f37
  4. 25 10月, 2022 13 次提交