1. 27 Sep, 2023 1 commit
  2. 21 Sep, 2023 2 commits
  3. 20 Sep, 2023 1 commit
  4. 18 Sep, 2023 7 commits
    • Ian Rogers's avatar
      perf parse-events: Fix tracepoint name memory leak · ede72dca
      Ian Rogers authored
      Fuzzing found that an invalid tracepoint name would create a memory
      leak with an address sanitizer build:
      ```
      $ perf stat -e '*:o/' true
      event syntax error: '*:o/'
                             \___ parser error
      Run 'perf list' for a list of valid events
      
       Usage: perf stat [<options>] [<command>]
      
          -e, --event <event>   event selector. use 'perf list' to list available events
      
      =================================================================
      ==59380==ERROR: LeakSanitizer: detected memory leaks
      
      Direct leak of 4 byte(s) in 2 object(s) allocated from:
          #0 0x7f38ac07077b in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:439
          #1 0x55f2f41be73b in str util/parse-events.l:49
          #2 0x55f2f41d08e8 in parse_events_lex util/parse-events.l:338
          #3 0x55f2f41dc3b1 in parse_events_parse util/parse-events-bison.c:1464
          #4 0x55f2f410b8b3 in parse_events__scanner util/parse-events.c:1822
          #5 0x55f2f410d1b9 in __parse_events util/parse-events.c:2094
          #6 0x55f2f410e57f in parse_events_option util/parse-events.c:2279
          #7 0x55f2f4427b56 in get_value tools/lib/subcmd/parse-options.c:251
          #8 0x55f2f4428d98 in parse_short_opt tools/lib/subcmd/parse-options.c:351
          #9 0x55f2f4429d80 in parse_options_step tools/lib/subcmd/parse-options.c:539
          #10 0x55f2f442acb9 in parse_options_subcommand tools/lib/subcmd/parse-options.c:654
          #11 0x55f2f3ec99fc in cmd_stat tools/perf/builtin-stat.c:2501
          #12 0x55f2f4093289 in run_builtin tools/perf/perf.c:322
          #13 0x55f2f40937f5 in handle_internal_command tools/perf/perf.c:375
          #14 0x55f2f4093bbd in run_argv tools/perf/perf.c:419
          #15 0x55f2f409412b in main tools/perf/perf.c:535
      
      SUMMARY: AddressSanitizer: 4 byte(s) leaked in 2 allocation(s).
      ```
      Fix by adding the missing destructor.
      
      Fixes: 865582c3 ("perf tools: Adds the tracepoint name parsing support")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: He Kuang <hekuang@huawei.com>
      Link: https://lore.kernel.org/r/20230914164028.363220-1-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      ede72dca
    • Ian Rogers's avatar
      perf test: Detect off-cpu support from build options · b4f48f34
      Ian Rogers authored
      Use perf version to detect whether BPF skeletons were enabled in a
      build rather than a failing perf record.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Patrice Duroux <patrice.duroux@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Tom Rix <trix@redhat.com>
      Cc: llvm@lists.linux.dev
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230914211948.814999-6-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      b4f48f34
    • Ian Rogers's avatar
      perf test: Ensure EXTRA_TESTS is covered in build test · c2ac838e
      Ian Rogers authored
      Add to run variable.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Patrice Duroux <patrice.duroux@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Tom Rix <trix@redhat.com>
      Cc: llvm@lists.linux.dev
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230914211948.814999-5-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      c2ac838e
    • Ian Rogers's avatar
      perf test: Update build test for changed BPF skeleton defaults · c67c631d
      Ian Rogers authored
      Fix a target name and set BUILD_BPF_SKEL to 0 rather than 1.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Patrice Duroux <patrice.duroux@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Tom Rix <trix@redhat.com>
      Cc: llvm@lists.linux.dev
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230914211948.814999-4-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      c67c631d
    • Ian Rogers's avatar
      perf build: Default BUILD_BPF_SKEL, warn/disable for missing deps · 9925495d
      Ian Rogers authored
      LIBBPF is dependent on zlib so move the NO_ZLIB and feature check
      early to avoid statically building when zlib is disabled. This avoids
      a linkage failure with perf and static libbpf when zlib isn't
      specified.
      
      Move BUILD_BPF_SKEL logic to one place and if not defined set
      BUILD_BPF_SKEL to 1. Detect dependencies of building with BPF
      skeletons and warn/disable if the dependencies aren't present.
      
      Change Makefile.perf to contain BPF skeleton logic dependent on the
      Makefile.config result and refresh the comment about BUILD_BPF_SKEL.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Patrice Duroux <patrice.duroux@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Tom Rix <trix@redhat.com>
      Cc: llvm@lists.linux.dev
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230914211948.814999-3-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      9925495d
    • Ian Rogers's avatar
      perf version: Add status of bpf skeletons · 727e4314
      Ian Rogers authored
      Add status for BPF skeletons, to see if a build has them enabled:
      ```
      $ perf version --build-options
      perf version 6.6.rc1.g0381ae36d1a6
                       dwarf: [ OFF ]  # HAVE_DWARF_SUPPORT
          dwarf_getlocations: [ OFF ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
               syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
                      libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
                  debuginfod: [ OFF ]  # HAVE_DEBUGINFOD_SUPPORT
                      libelf: [ OFF ]  # HAVE_LIBELF_SUPPORT
                     libnuma: [ OFF ]  # HAVE_LIBNUMA_SUPPORT
      numa_num_possible_cpus: [ OFF ]  # HAVE_LIBNUMA_SUPPORT
                     libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
                   libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
                    libslang: [ on  ]  # HAVE_SLANG_SUPPORT
                   libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
                   libunwind: [ OFF ]  # HAVE_LIBUNWIND_SUPPORT
          libdw-dwarf-unwind: [ OFF ]  # HAVE_DWARF_SUPPORT
                        zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                        lzma: [ on  ]  # HAVE_LZMA_SUPPORT
                   get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                         bpf: [ OFF ]  # HAVE_LIBBPF_SUPPORT
                         aio: [ on  ]  # HAVE_AIO_SUPPORT
                        zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
                     libpfm4: [ on  ]  # HAVE_LIBPFM
               libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
               bpf_skeletons: [ OFF ]  # HAVE_BPF_SKEL
      ```
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Patrice Duroux <patrice.duroux@gmail.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Tiezhu Yang <yangtiezhu@loongson.cn>
      Cc: Tom Rix <trix@redhat.com>
      Cc: llvm@lists.linux.dev
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230914211948.814999-2-irogers@google.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      727e4314
    • Yang Li's avatar
      perf kwork top: Simplify bool conversion · 3ecf87b2
      Yang Li authored
      ./tools/perf/util/bpf_kwork_top.c:120:53-58: WARNING: conversion to bool not needed here
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230915063832.120274-1-yang.lee@linux.alibaba.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      3ecf87b2
  5. 17 Sep, 2023 1 commit
    • Yang Jihong's avatar
      perf test: Fix test-record-dummy-C0 failure for supported PERF_FORMAT_LOST feature kernel · a132b784
      Yang Jihong authored
      For kernel that supports PERF_FORMAT_LOST, attr->read_format has
      PERF_FORMAT_LOST bit. Update expected value of
      attr->read_format of test-record-dummy-C0 for this scenario.
      
      Before:
      
        # ./perf test 17 -vv
         17: Setup struct perf_event_attr                                    :
        --- start ---
        test child forked, pid 1609441
        <SNIP>
        running './tests/attr/test-record-dummy-C0'
          'PERF_TEST_ATTR=/tmp/tmpm3s60aji ./perf record -o /tmp/tmpm3s60aji/perf.data --no-bpf-event -e dummy -C 0 kill >/dev/null 2>&1' ret '1', expected '1'
        expected read_format=4, got 20
        FAILED './tests/attr/test-record-dummy-C0' - match failure
        test child finished with -1
        ---- end ----
        Setup struct perf_event_attr: FAILED!
      
      After:
      
        # ./perf test 17 -vv
         17: Setup struct perf_event_attr                                    :
        --- start ---
        test child forked, pid 1609441
        <SNIP>
        running './tests/attr/test-record-dummy-C0'
          'PERF_TEST_ATTR=/tmp/tmppa9vxcb7 ./perf record -o /tmp/tmppa9vxcb7/perf.data --no-bpf-event -e dummy -C 0 kill >/dev/null 2>&1' ret '1', expected '1'
        <SNIP>
        test child finished with 0
        ---- end ----
        Setup struct perf_event_attr: Ok
      Reported-and-Tested-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Link: https://lore.kernel.org/r/20230916091641.776031-1-yangjihong1@huawei.comSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      a132b784
  6. 15 Sep, 2023 6 commits
  7. 12 Sep, 2023 22 commits
    • Ian Rogers's avatar
      perf bpf-filter: Add YYDEBUG · 999b81b9
      Ian Rogers authored
      YYDEBUG enables line numbers and other error helpers in the generated
      bpf-filter-bison.c. Conditionally enabled only for debug builds.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230911170559.4037734-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      999b81b9
    • Ian Rogers's avatar
      perf pmu: Add YYDEBUG · f0f4cd10
      Ian Rogers authored
      YYDEBUG enables line numbers and other error helpers in the generated
      pmu-bison.c. Conditionally enabled only for debug builds.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230911170559.4037734-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f0f4cd10
    • Ian Rogers's avatar
      perf expr: Make YYDEBUG dependent on doing a debug build · 1344a707
      Ian Rogers authored
      YYDEBUG enables line numbers and other error helpers in the generated
      expr-bison.c. These shouldn't be generated when debugging
      isn't enabled.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230911170559.4037734-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1344a707
    • Ian Rogers's avatar
      perf parse-events: Make YYDEBUG dependent on doing a debug build · d4ce6019
      Ian Rogers authored
      YYDEBUG enables line numbers and other error helpers in the generated
      parse-events-bison.c. These shouldn't be generated when debugging
      isn't enabled.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230911170559.4037734-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d4ce6019
    • Ian Rogers's avatar
      perf parse-events: Remove unused header files · dc2cfef9
      Ian Rogers authored
      The fnmatch header is now used in the PMU matching logic in pmu.c.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230911170559.4037734-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dc2cfef9
    • Athira Rajeev's avatar
      perf tools: Add includes for detected configs in Makefile.perf · f5d98b8b
      Athira Rajeev authored
      Makefile.perf uses "CONFIG_*" checks in the code. Example the config for
      libtraceevent is used to set PYTHON_EXT_SRCS
      
      	ifeq ($(CONFIG_LIBTRACEEVENT),y)
      	  PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
      	else
      	  PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources)
      	endif
      
      But this is not picking the value for CONFIG_LIBTRACEEVENT that is set
      using the settings in Makefile.config. Include the file
      ".config-detected" so that make will use the system detected
      configuration in the CONFIG checks.
      
      This will fix isues that could arise when other "CONFIG_*" checks are
      added to Makefile.perf in future as well.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarAthira Rajeev <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: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: https://lore.kernel.org/r/20230912063807.74250-1-atrajeev@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f5d98b8b
    • Ruidong Tian's avatar
      perf test: Update cs_etm testcase for Arm ETE · bb350847
      Ruidong Tian authored
      Add ETE as one of the supported device types in perf cs_etm testcase.
      Reviewed-by: default avatarJames Clark <james.clark@arm.com>
      Signed-off-by: default avatarRuidong Tian <tianruidong@linux.alibaba.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230911065541.91293-1-tianruidong@linux.alibaba.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bb350847
    • James Clark's avatar
      perf vendor events arm64: Add V1 metrics using Arm telemetry repo · 5cdb51ba
      James Clark authored
      Metrics for V1 weren't previously included in the Perf Jsons, so add
      them using the telemetry source [1].
      
      After generation any parts identical to the default metrics in sbsa.json
      were manually removed.
      
      [1]: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-v1.jsonSigned-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230831161618.134738-3-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5cdb51ba
    • James Clark's avatar
      perf vendor events arm64: Update V1 events using Arm telemetry repo · a484e645
      James Clark authored
      The new data [1] includes descriptions that may have product specific
      details and new groupings that will be consistent with other products.
      
      The following command was used to generate the jsons:
      
       $ telemetry-solution/tools/perf_json_generator/generate.py \
         linux/tools/perf/ --telemetry-files \
         telemetry-solution/data/pmu/cpu/neoverse/neoverse-v1.json
      
      [1]: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-v1.jsonSigned-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230831161618.134738-2-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a484e645
    • James Clark's avatar
      perf test: Add a test for strcmp_cpuid_str() expression · a1ebf771
      James Clark authored
      Test that the new expression builtin returns a match when the current
      escaped CPU ID is given, and that it doesn't match when "0x0" is given.
      
      The CPU ID in test__expr() has to be changed to perf_pmu__getcpuid()
      which returns the CPU ID string, rather than the raw CPU ID that
      get_cpuid() returns because that can't be used with strcmp_cpuid_str().
      It doesn't affect the is_intel test because both versions contain
      "Intel".
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chen Zhongjin <chenzhongjin@huawei.com>
      Cc: Eduard Zingerman <eddyz87@gmail.com>
      Cc: Haixin Yu <yuhaixin.yhx@linux.alibaba.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      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: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230904095104.1162928-5-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a1ebf771
    • James Clark's avatar
      perf util: Add a function for replacing characters in a string · 8a55c1e2
      James Clark authored
      It finds all occurrences of a single character and replaces them with
      a multi character string. This will be used in a test in a following
      commit.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chen Zhongjin <chenzhongjin@huawei.com>
      Cc: Eduard Zingerman <eddyz87@gmail.com>
      Cc: Haixin Yu <yuhaixin.yhx@linux.alibaba.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      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: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230904095104.1162928-4-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8a55c1e2
    • James Clark's avatar
      perf jevents: Remove unused keyword · f561fc78
      James Clark authored
      'cpuid_not_more_than' was the working title of the new
      'strcmp_cpuid_str' keyword and was accidentally left in. It was never
      used so tidying it up has no effect.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chen Zhongjin <chenzhongjin@huawei.com>
      Cc: Eduard Zingerman <eddyz87@gmail.com>
      Cc: Haixin Yu <yuhaixin.yhx@linux.alibaba.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230904095104.1162928-3-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f561fc78
    • James Clark's avatar
      perf test: Check result of has_event(cycles) test · d19a353c
      James Clark authored
      Currently the function always returns 0, so even when the has_event()
      test fails, the test still passes. Fix it by returning ret instead.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chen Zhongjin <chenzhongjin@huawei.com>
      Cc: Eduard Zingerman <eddyz87@gmail.com>
      Cc: Haixin Yu <yuhaixin.yhx@linux.alibaba.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Liam Howlett <liam.howlett@oracle.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Miguel Ojeda <ojeda@kernel.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yang Jihong <yangjihong1@huawei.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230904095104.1162928-2-james.clark@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d19a353c
    • Ian Rogers's avatar
      perf list pfm: Retry supported test with exclude_kernel · 6bd8c2ea
      Ian Rogers authored
      With paranoia set at 2 evsel__open will fail with EACCES for non-root
      users. To avoid this stopping libpfm4 events from being printed, retry
      with exclude_kernel enabled - copying the regular is_event_supported
      test.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kang Minchul <tegongkang@gmail.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20230906234416.3472339-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6bd8c2ea
    • Ian Rogers's avatar
      perf list: Avoid a hardcoded cpu PMU name · 4f19fc18
      Ian Rogers authored
      Use the first core PMU instead.
      
      On a Raspberry Pi, before:
      
        $ perf list
        ...
          cpu/t1=v1[,t2=v2,t3 ...]/modifier                  [Raw hardware event descriptor]
               [(see 'man perf-list' on how to encode it)]
        ...
      
      After:
      
        $ perf list
        ...
          armv8_cortex_a72/t1=v1[,t2=v2,t3 ...]/modifier     [Raw hardware event descriptor]
               [(see 'man perf-list' on how to encode it)]
        ...
        ```
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kang Minchul <tegongkang@gmail.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20230906234416.3472339-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4f19fc18
    • Namhyung Kim's avatar
      perf test shell lock_contention: Add cgroup aggregation and filter tests · e44b47b9
      Namhyung Kim authored
      Add cgroup aggregation and filter tests.
      
        $ sudo ./perf test -v contention
         84: kernel lock contention analysis test                            :
        --- start ---
        test child forked, pid 222423
        Testing perf lock record and perf lock contention
        Testing perf lock contention --use-bpf
        Testing perf lock record and perf lock contention at the same time
        Testing perf lock contention --threads
        Testing perf lock contention --lock-addr
        Testing perf lock contention --lock-cgroup
        Testing perf lock contention --type-filter (w/ spinlock)
        Testing perf lock contention --lock-filter (w/ tasklist_lock)
        Testing perf lock contention --callstack-filter (w/ unix_stream)
        Testing perf lock contention --callstack-filter with task aggregation
        Testing perf lock contention --cgroup-filter
        Testing perf lock contention CSV output
        test child finished with 0
        ---- end ----
        kernel lock contention analysis test: Ok
      
      Committer testing:
      
        [root@quaco ~]# uname -a
        Linux quaco 6.4.10-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 11 12:20:29 UTC 2023 x86_64 GNU/Linux
        [root@quaco ~]# perf test -v contention
         84: kernel lock contention analysis test                            :
        --- start ---
        test child forked, pid 452625
        Testing perf lock record and perf lock contention
        Testing perf lock contention --use-bpf
        Testing perf lock record and perf lock contention at the same time
        Testing perf lock contention --threads
        Testing perf lock contention --lock-addr
        Testing perf lock contention --lock-cgroup
        Testing perf lock contention --type-filter (w/ spinlock)
        Testing perf lock contention --lock-filter (w/ tasklist_lock)
        Testing perf lock contention --callstack-filter (w/ unix_stream)
        Testing perf lock contention --callstack-filter with task aggregation
        Testing perf lock contention --cgroup-filter
        Testing perf lock contention CSV output
        test child finished with 0
        ---- end ----
        kernel lock contention analysis test: Ok
        [root@quaco ~]#
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230906174903.346486-6-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e44b47b9
    • Namhyung Kim's avatar
      perf lock contention: Add -G/--cgroup-filter option · 4fd06bd2
      Namhyung Kim authored
      The -G/--cgroup-filter is to limit lock contention collection on the
      tasks in the specific cgroups only.
      
        $ sudo ./perf lock con -abt -G /user.slice/.../vte-spawn-52221fb8-b33f-4a52-b5c3-e35d1e6fc0e0.scope \
          ./perf bench sched messaging
        # Running 'sched/messaging' benchmark:
        # 20 sender and receiver processes per group
        # 10 groups == 400 processes run
      
             Total time: 0.174 [sec]
         contended   total wait     max wait     avg wait          pid   comm
      
                 4    114.45 us     60.06 us     28.61 us       214847   sched-messaging
                 2    111.40 us     60.84 us     55.70 us       214848   sched-messaging
                 2    106.09 us     59.42 us     53.04 us       214837   sched-messaging
                 1     81.70 us     81.70 us     81.70 us       214709   sched-messaging
                68     78.44 us      6.83 us      1.15 us       214633   sched-messaging
                69     73.71 us      2.69 us      1.07 us       214632   sched-messaging
                 4     72.62 us     60.83 us     18.15 us       214850   sched-messaging
                 2     71.75 us     67.60 us     35.88 us       214840   sched-messaging
                 2     69.29 us     67.53 us     34.65 us       214804   sched-messaging
                 2     69.00 us     68.23 us     34.50 us       214826   sched-messaging
        ...
      
      Export cgroup__new() function as it's needed from outside.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230906174903.346486-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4fd06bd2
    • Namhyung Kim's avatar
      perf lock contention: Add --lock-cgroup option · 4d1792d0
      Namhyung Kim authored
      The --lock-cgroup option shows lock contention stats break down by
      cgroups.
      
      Add LOCK_AGGR_CGROUP mode and use it instead of use_cgroup field.
      
        $ sudo ./perf lock con -ab --lock-cgroup sleep 1
         contended   total wait     max wait     avg wait   cgroup
      
                 8     15.70 us      6.34 us      1.96 us   /
                 2      1.48 us       747 ns       738 ns   /user.slice/.../app.slice/app-gnome-google\x2dchrome-6442.scope
                 1       848 ns       848 ns       848 ns   /user.slice/.../session.slice/org.gnome.Shell@x11.service
                 1       220 ns       220 ns       220 ns   /user.slice/.../session.slice/pipewire-pulse.service
      
      For now, the cgroup mode only works with BPF (-b).
      
      Committer notes:
      
      Remove -g as it is used in the other tools with a clear meaning of
      collect/show callchains. As agreed with Namhyung off list.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230906174903.346486-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4d1792d0
    • Namhyung Kim's avatar
      perf lock contention: Prepare to handle cgroups · d0c502e4
      Namhyung Kim authored
      Save cgroup info and display cgroup names if requested.  This is a
      preparation for the next patch.
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230906174903.346486-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d0c502e4
    • Namhyung Kim's avatar
      perf tools: Add read_all_cgroups() and __cgroup_find() · 2bc12abc
      Namhyung Kim authored
      The read_all_cgroups() is to build a tree of cgroups in the system and
      users can look up a cgroup using __cgroup_find().
      
      Committer notes:
      
      Had to do this to cover that #else block:
      
        -static inline u64 __read_cgroup_id(const char *path) { return -1ULL; }
        +static inline u64 __read_cgroup_id(const char *path __maybe_unused) { return -1ULL; }
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20230906174903.346486-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2bc12abc
    • Yang Jihong's avatar
      perf kwork top: Add BPF-based statistics on softirq event support · 36019dff
      Yang Jihong authored
      Use BPF to collect statistics on softirq events based on perf BPF skeletons.
      
      Example usage:
      
        # perf kwork top -b
        Starting trace, Hit <Ctrl+C> to stop and report
        ^C
        Total  : 135445.704 ms, 8 cpus
        %Cpu(s):  28.35% id,   0.00% hi,   0.25% si
        %Cpu0   [||||||||||||||||||||            69.85%]
        %Cpu1   [||||||||||||||||||||||          74.10%]
        %Cpu2   [|||||||||||||||||||||           71.18%]
        %Cpu3   [||||||||||||||||||||            69.61%]
        %Cpu4   [||||||||||||||||||||||          74.05%]
        %Cpu5   [||||||||||||||||||||            69.33%]
        %Cpu6   [||||||||||||||||||||            69.71%]
        %Cpu7   [||||||||||||||||||||||          73.77%]
      
              PID     SPID    %CPU           RUNTIME  COMMMAND
          -------------------------------------------------------------
                0        0   30.43       5271.005 ms  [swapper/5]
                0        0   30.17       5226.644 ms  [swapper/3]
                0        0   30.08       5210.257 ms  [swapper/6]
                0        0   29.89       5177.177 ms  [swapper/0]
                0        0   28.51       4938.672 ms  [swapper/2]
                0        0   25.93       4223.464 ms  [swapper/7]
                0        0   25.69       4181.411 ms  [swapper/4]
                0        0   25.63       4173.804 ms  [swapper/1]
            16665    16265    2.16        360.600 ms  sched-messaging
            16537    16265    2.05        356.275 ms  sched-messaging
            16503    16265    2.01        343.063 ms  sched-messaging
            16424    16265    1.97        336.876 ms  sched-messaging
            16580    16265    1.94        323.658 ms  sched-messaging
            16515    16265    1.92        321.616 ms  sched-messaging
            16659    16265    1.91        325.538 ms  sched-messaging
            16634    16265    1.88        327.766 ms  sched-messaging
            16454    16265    1.87        326.843 ms  sched-messaging
            16382    16265    1.87        322.591 ms  sched-messaging
            16642    16265    1.86        320.506 ms  sched-messaging
            16582    16265    1.86        320.164 ms  sched-messaging
            16315    16265    1.86        326.872 ms  sched-messaging
            16637    16265    1.85        323.766 ms  sched-messaging
            16506    16265    1.82        311.688 ms  sched-messaging
            16512    16265    1.81        304.643 ms  sched-messaging
            16560    16265    1.80        314.751 ms  sched-messaging
            16320    16265    1.80        313.405 ms  sched-messaging
            16442    16265    1.80        314.403 ms  sched-messaging
            16626    16265    1.78        295.380 ms  sched-messaging
            16600    16265    1.77        309.444 ms  sched-messaging
            16550    16265    1.76        301.161 ms  sched-messaging
            16525    16265    1.75        296.560 ms  sched-messaging
            16314    16265    1.75        298.338 ms  sched-messaging
            16595    16265    1.74        304.390 ms  sched-messaging
            16555    16265    1.74        287.564 ms  sched-messaging
            16520    16265    1.74        295.734 ms  sched-messaging
            16507    16265    1.73        293.956 ms  sched-messaging
            16593    16265    1.72        296.443 ms  sched-messaging
            16531    16265    1.72        299.950 ms  sched-messaging
            16281    16265    1.72        301.339 ms  sched-messaging
        <SNIP>
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Link: https://lore.kernel.org/r/20230812084917.169338-17-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      36019dff
    • Yang Jihong's avatar
      perf kwork top: Add BPF-based statistics on hardirq event support · d2956b3a
      Yang Jihong authored
      Use BPF to collect statistics on hardirq events based on perf BPF skeletons.
      
      Example usage:
      
        # perf kwork top -k sched,irq -b
        Starting trace, Hit <Ctrl+C> to stop and report
        ^C
        Total  : 136717.945 ms, 8 cpus
        %Cpu(s):  17.10% id,   0.01% hi,   0.00% si
        %Cpu0   [|||||||||||||||||||||||||       84.26%]
        %Cpu1   [|||||||||||||||||||||||||       84.77%]
        %Cpu2   [||||||||||||||||||||||||        83.22%]
        %Cpu3   [||||||||||||||||||||||||        80.37%]
        %Cpu4   [||||||||||||||||||||||||        81.49%]
        %Cpu5   [|||||||||||||||||||||||||       84.68%]
        %Cpu6   [|||||||||||||||||||||||||       84.48%]
        %Cpu7   [||||||||||||||||||||||||        80.21%]
      
              PID     SPID    %CPU           RUNTIME  COMMMAND
          -------------------------------------------------------------
                0        0   19.78       3482.833 ms  [swapper/7]
                0        0   19.62       3454.219 ms  [swapper/3]
                0        0   18.50       3258.339 ms  [swapper/4]
                0        0   16.76       2842.749 ms  [swapper/2]
                0        0   15.71       2627.905 ms  [swapper/0]
                0        0   15.51       2598.206 ms  [swapper/6]
                0        0   15.31       2561.820 ms  [swapper/5]
                0        0   15.22       2548.708 ms  [swapper/1]
            13253    13018    2.95        513.108 ms  sched-messaging
            13092    13018    2.67        454.167 ms  sched-messaging
            13401    13018    2.66        454.790 ms  sched-messaging
            13240    13018    2.64        454.587 ms  sched-messaging
            13251    13018    2.61        442.273 ms  sched-messaging
            13075    13018    2.61        438.932 ms  sched-messaging
            13220    13018    2.60        443.245 ms  sched-messaging
            13235    13018    2.59        443.268 ms  sched-messaging
            13222    13018    2.50        426.344 ms  sched-messaging
            13410    13018    2.49        426.191 ms  sched-messaging
            13228    13018    2.46        425.121 ms  sched-messaging
            13379    13018    2.38        409.950 ms  sched-messaging
            13236    13018    2.37        413.159 ms  sched-messaging
            13095    13018    2.36        396.572 ms  sched-messaging
            13325    13018    2.35        408.089 ms  sched-messaging
            13242    13018    2.32        394.750 ms  sched-messaging
            13386    13018    2.31        396.997 ms  sched-messaging
            13046    13018    2.29        383.833 ms  sched-messaging
            13109    13018    2.28        388.482 ms  sched-messaging
            13388    13018    2.28        393.576 ms  sched-messaging
            13238    13018    2.26        388.487 ms  sched-messaging
        <SNIP>
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarYang Jihong <yangjihong1@huawei.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Link: https://lore.kernel.org/r/20230812084917.169338-16-yangjihong1@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d2956b3a