1. 20 Jun, 2024 3 commits
    • Ian Rogers's avatar
      perf vendor events: Update alderlake events/metrics · 17d4b192
      Ian Rogers authored
      Update events from v1.24 to v1.27.
      Update p-core TMA metrics from v4.7 to v4.8, and the e-core TMA
      metrics to v3.6.
      
      Bring in the event updates v1.27:
      https://github.com/intel/perfmon/commit/ea4f309a04c50ca77a00da2db130fd7cf06db978
      v1.26:
      https://github.com/intel/perfmon/commit/0052e68d24d9873d5ff22363677794fa3eb05313
      
      The p-core TMA 4.8 information was updated in:
      https://github.com/intel/perfmon/commit/59194d4d90ca50a3fcb2de0d82b9f6fc0c9a5736
      And e-core in:
      https://github.com/intel/perfmon/commit/d9c2faa70bafe03129dc10f9fe414ef03a95acd9
      
      New events are:
      EXE_ACTIVITY.2_3_PORTS_UTIL,
      ICACHE_DATA.STALL_PERIODS,
      L2_TRANS.L2_WB,
      MEM_TRANS_RETIRED.LOAD_LATENCY_GT_1024,
      MEM_UOPS_RETIRED.LOCK_LOADS,
      OFFCORE_REQUESTS.DEMAND_CODE_RD,
      OFFCORE_REQUESTS.DEMAND_RFO,
      OFFCORE_REQUESTS_OUTSTANDING.CYCLES_WITH_DEMAND_CODE_RD,
      OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD,
      RS.EMPTY_RESOURCE,
      SERIALIZATION.C01_MS_SCB,
      SW_PREFETCH_ACCESS.ANY,
      UOPS_ISSUED.ANY,
      UOPS_ISSUED.CYCLES
      Co-authored-by: default avatarWeilin Wang <weilin.wang@intel.com>
      Co-authored-by: default avatarCaleb Biggers <caleb.biggers@intel.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20240620181752.3945845-2-irogers@google.com
      17d4b192
    • Ravi Bangoria's avatar
      perf doc: Add AMD IBS usage document · b739759c
      Ravi Bangoria authored
      Add a perf man page document that describes how to exploit AMD IBS with
      Linux perf. Brief intro about IBS and simple one-liner examples will help
      naive users to get started. This is not meant to be an exhaustive IBS
      guide. User should refer latest AMD64 Architecture Programmer's Manual
      for detailed description of IBS.
      
      Usage:
      
        $ man perf-amd-ibs
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Reviewed-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: ananth.narayan@amd.com
      Cc: sandipan.das@amd.com
      Cc: santosh.shukla@amd.com
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20240620054104.815-1-ravi.bangoria@amd.com
      b739759c
    • Athira Rajeev's avatar
      tools/perf: Handle perftool-testsuite_probe testcases fail when kernel debuginfo is not present · 90d32e92
      Athira Rajeev authored
      Running "perftool-testsuite_probe" fails as below:
      
      	./perf test -v "perftool-testsuite_probe"
      	83: perftool-testsuite_probe  : FAILED
      
      There are three fails:
      
      1. Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)"
         -- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing)
      
      2. Regexp not found: "probe:vfs_mknod"
         Regexp not found: "probe:vfs_create"
         Regexp not found: "probe:vfs_rmdir"
         Regexp not found: "probe:vfs_link"
         Regexp not found: "probe:vfs_write"
         -- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing)
      
      3. Regexp not found: "Failed to find"
         Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
         Regexp not found: "in this function|at this address"
         Line did not match any pattern: "The /boot/vmlinux file has no debug information."
         Line did not match any pattern: "Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package."
      
      These three tests depends on kernel debug info.
      1. Fail 1 expects file name along with probe which needs debuginfo
      2. Fail 2 :
          perf probe -nf --max-probes=512 -a 'vfs_* $params'
          Debuginfo-analysis is not supported.
           Error: Failed to add events.
      
      3. Fail 3 :
         perf probe 'vfs_read somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64'
         Debuginfo-analysis is not supported.
         Error: Failed to add events.
      
      There is already helper function skip_if_no_debuginfo in
      lib/probe_vfs_getname.sh which does perf probe and returns
      "2" if debug info is not present. Use the skip_if_no_debuginfo
      function and skip only the three tests which needs debuginfo
      based on the result.
      
      With the patch:
      
          83: perftool-testsuite_probe:
         --- start ---
         test child forked, pid 3927
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission ::
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: -a
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: adding probe inode_permission :: --add
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf list
         Regexp not found: "\s*probe:inode_permission(?:_\d+)?\s+\(on inode_permission(?:[:\+][0-9A-Fa-f]+)?@.+\)"
         -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: using added probe
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: deleting added probe
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: listing removed probe (should NOT be listed)
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: dry run :: adding probe
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: first probe adding
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (without force)
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: force-adding probes :: second probe adding (with force)
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: using doubled probe
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: removing multiple probes
         Regexp not found: "probe:vfs_mknod"
         Regexp not found: "probe:vfs_create"
         Regexp not found: "probe:vfs_rmdir"
         Regexp not found: "probe:vfs_link"
         Regexp not found: "probe:vfs_write"
         -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped
         Regexp not found: "Failed to find"
         Regexp not found: "somenonexistingrandomstuffwhichisalsoprettylongorevenlongertoexceed64"
         Regexp not found: "in this function|at this address"
         Line did not match any pattern: "The /boot/vmlinux file has no debug information."
         Line did not match any pattern: "Rebuild with CONFIG_DEBUG_INFO=y, or install an appropriate debuginfo package."
         -- [ SKIP ] -- perf_probe :: test_adding_kernel :: 2 2 Skipped due to missing debuginfo :: testcase skipped
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: add
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: function with retval :: record
         -- [ PASS ] -- perf_probe :: test_adding_kernel :: function argument probing :: script
         ## [ PASS ] ## perf_probe :: test_adding_kernel SUMMARY
         ---- end(0) ----
         83: perftool-testsuite_probe                                        : Ok
      
      Only the three specific tests are skipped and remaining
      ran successfully.
      Signed-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
      Reviewed-by: default avatarJames Clark <james.clark@arm.com>
      Cc: akanksha@linux.ibm.com
      Cc: kjain@linux.ibm.com
      Cc: maddy@linux.ibm.com
      Cc: disgoel@linux.vnet.ibm.com
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20240617122121.7484-1-atrajeev@linux.vnet.ibm.com
      90d32e92
  2. 16 Jun, 2024 5 commits
  3. 14 Jun, 2024 5 commits
  4. 10 Jun, 2024 1 commit
    • Ian Rogers's avatar
      perf evsel: Refactor tool events · 6828d692
      Ian Rogers authored
      Tool events unnecessarily open a dummy perf event which is useless
      even with `perf record` which will still open a dummy event. Change
      the behavior of tool events so:
      
       - duration_time - call `rdclock` on open and then report the count as
         a delta since the start in evsel__read_counter. This moves code out
         of builtin-stat making it more general purpose.
      
       - user_time/system_time - open the fd as either `/proc/pid/stat` or
         `/proc/stat` for cases like system wide. evsel__read_counter will
         read the appropriate field out of the procfs file. These values
         were previously supplied by wait4, if the procfs read fails then
         the wait4 values are used, assuming the process/thread terminated.
         By reading user_time and system_time this way, interval mode, per
         PID and per CPU can be supported although there are restrictions
         given what the files provide (e.g. per PID can't be combined with
         per CPU).
      
      Opening any of the tool events for `perf record` is changed to return
      invalid.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarWeilin Wang <weilin.wang@intel.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
      Cc: Ze Gao <zegao2021@gmail.com>
      Cc: Song Liu <song@kernel.org>
      Cc: Leo Yan <leo.yan@linux.dev>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20240503232849.17752-1-irogers@google.com
      6828d692
  5. 07 Jun, 2024 7 commits
  6. 06 Jun, 2024 1 commit
    • Clément Le Goffic's avatar
      perf: parse-events: Fix compilation error while defining DEBUG_PARSER · 9aa61d8e
      Clément Le Goffic authored
      Compiling perf tool with 'DEBUG_PARSER=1' leads to errors:
      
      $> make -C tools/perf PARSER_DEBUG=1 NO_LIBTRACEEVENT=1
      ...
        CC      util/expr-flex.o
        CC      util/expr.o
      util/parse-events.c:33:12: error: redundant redeclaration of ‘parse_events_debug’ [-Werror=redundant-decls]
         33 | extern int parse_events_debug;
            |            ^~~~~~~~~~~~~~~~~~
      In file included from util/parse-events.c:18:
      util/parse-events-bison.h:43:12: note: previous declaration of ‘parse_events_debug’ with type ‘int’
         43 | extern int parse_events_debug;
            |            ^~~~~~~~~~~~~~~~~~
      util/expr.c:27:12: error: redundant redeclaration of ‘expr_debug’ [-Werror=redundant-decls]
         27 | extern int expr_debug;
            |            ^~~~~~~~~~
      In file included from util/expr.c:11:
      util/expr-bison.h:43:12: note: previous declaration of ‘expr_debug’ with type ‘int’
         43 | extern int expr_debug;
            |            ^~~~~~~~~~
      cc-1: all warnings being treated as errors
      
      Remove extern declaration from the parse-envents.c file as there is a
      conflict with the ones generated using bison and yacc tools from the file
      parse-events.[ly].
      Signed-off-by: default avatarClément Le Goffic <clement.legoffic@foss.st.com>
      Reviewed-by: default avatarIan Rogers <irogers@google.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: John Garry <john.g.garry@oracle.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20240605140453.614862-1-clement.legoffic@foss.st.com
      9aa61d8e
  7. 05 Jun, 2024 1 commit
  8. 04 Jun, 2024 2 commits
  9. 30 May, 2024 6 commits
  10. 29 May, 2024 1 commit
  11. 28 May, 2024 4 commits
  12. 26 May, 2024 4 commits