1. 11 Jul, 2023 4 commits
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync files changed by new cachestat syscall with the kernel sources · 9350a917
      Arnaldo Carvalho de Melo authored
      To pick the changes in these csets:
      
        cf264e13 ("cachestat: implement cachestat syscall")
      
      That add support for this new syscall in tools such as 'perf trace'.
      
      For instance, this is now possible:
      
        # perf trace -e cachestat
        ^C[root@five ~]#
        # perf trace -v -e cachestat
        Using CPUID AuthenticAMD-25-21-0
        event qualifier tracepoint filter: (common_pid != 3163687 && common_pid != 3147) && (id == 451)
        mmap size 528384B
        ^C[root@five ~]
      
        # perf trace -v -e *stat* --max-events=10
        Using CPUID AuthenticAMD-25-21-0
        event qualifier tracepoint filter: (common_pid != 3163713 && common_pid != 3147) && (id == 4 || id == 5 || id == 6 || id == 136 || id == 137 || id == 138 || id == 262 || id == 332 || id == 451)
        mmap size 528384B
             0.000 ( 0.009 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60)                     = 0
             0.012 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250)   = 0
             0.036 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0
             0.372 ( 0.006 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10)                     = 0
             0.379 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250)   = 0
             0.390 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256a0, flag: 4096) = 0
             0.609 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b60)                     = 0
             0.615 ( 0.003 ms): Cache2 I/O/4544 newfstatat(dfd: CWD, filename: 0x45635288, statbuf: 0x7f874569d250)   = 0
             0.625 ( 0.002 ms): Cache2 I/O/4544 newfstatat(dfd: 138, filename: 0x541b7093, statbuf: 0x7f87457256f0, flag: 4096) = 0
             0.826 ( 0.005 ms): Cache2 I/O/4544 statfs(pathname: 0x45635288, buf: 0x7f8745725b10)                     = 0
        #
      
      That is the filter expression attached to the raw_syscalls:sys_{enter,exit}
      tracepoints.
      
        $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w sys_cachestat
        tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:451	n64	cachestat			sys_cachestat
        tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:451	common	cachestat			sys_cachestat
        tools/perf/arch/s390/entry/syscalls/syscall.tbl:451  common	cachestat		sys_cachestat			sys_cachestat
        tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:451	common	cachestat		sys_cachestat
        $
      
        $ grep -w cachestat /tmp/build/perf-tools/arch/x86/include/generated/asm/syscalls_64.c
        	[451] = "cachestat",
        $
      
      This addresses these perf build warnings:
      
      Warning: Kernel ABI header differences:
        diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
        diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h
        diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
        diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
        diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.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: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nhat Pham <nphamcs@gmail.com>
      Link: https://lore.kernel.org/lkml/ZK1pVBJpbjujJNJW@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9350a917
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync drm/i915_drm.h with the kernel sources · 142256d2
      Arnaldo Carvalho de Melo authored
        81b1b599 ("drm/i915: Allow user to set cache at BO creation")
        98d2722a ("drm/i915/huc: differentiate the 2 steps of the MTL HuC auth flow")
        bc4be0a3 ("drm/i915/pmu: Prepare for multi-tile non-engine counters")
        d1da138f ("drm/i915/uapi/pxp: Add a GET_PARAM for PXP")
      
      That adds some ioctls but use the __I915_PMU_OTHER() macro, not
      supported yet in the tools/perf/trace/beauty/drm_ioctl.sh conversion
      script.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header differences:
          diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
      Cc: Andi Shyti <andi.shyti@linux.intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Fei Yang <fei.yang@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
      Link: https://lore.kernel.org/lkml/ZK1R%2FIyWcUKYQbQV@kernel.org/Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      142256d2
    • Georg Müller's avatar
      perf probe: Read DWARF files from the correct CU · c66e1c68
      Georg Müller authored
      After switching from dwarf_decl_file() to die_get_decl_file(), it is not
      possible to add probes for certain functions:
      
        $ perf probe -x /usr/lib/systemd/systemd-logind match_unit_removed
        A function DIE doesn't have decl_line. Maybe broken DWARF?
        A function DIE doesn't have decl_line. Maybe broken DWARF?
        Probe point 'match_unit_removed' not found.
           Error: Failed to add events.
      
      The problem is that die_get_decl_file() uses the wrong CU to search for
      the file. elfutils commit e1db5cdc9f has some good explanation for this:
      
          dwarf_decl_file uses dwarf_attr_integrate to get the DW_AT_decl_file
          attribute. This means the attribute might come from a different DIE
          in a different CU. If so, we need to use the CU associated with the
          attribute, not the original DIE, to resolve the file name.
      
      This patch uses the same source of information as elfutils: use attribute
      DW_AT_decl_file and use this CU to search for the file.
      
      Fixes: dc9a5d2c ("perf probe: Fix to get declared file name from clang DWARF5")
      Signed-off-by: default avatarGeorg Müller <georgmueller@gmx.net>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      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: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: regressions@lists.linux.dev
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230628084551.1860532-6-georgmueller@gmx.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c66e1c68
    • Georg Müller's avatar
      perf probe: Add test for regression introduced by switch to die_get_decl_file() · 56cbeacf
      Georg Müller authored
      This patch adds a test to validate that 'perf probe' works for binaries
      where DWARF info is split into multiple CUs
      Signed-off-by: default avatarGeorg Müller <georgmueller@gmx.net>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      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: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: regressions@lists.linux.dev
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230628084551.1860532-5-georgmueller@gmx.netSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      56cbeacf
  2. 10 Jul, 2023 2 commits
  3. 09 Jul, 2023 10 commits
  4. 08 Jul, 2023 24 commits