1. 07 Aug, 2020 5 commits
    • Anju T Sudhakar's avatar
      perf tools powerpc: Add support for extended register capability · 33583e69
      Anju T Sudhakar authored
      Add extended regs to sample_reg_mask in the tool side to use with `-I?`
      option. Perf tools side uses extended mask to display the platform
      supported register names (with -I? option) to the user and also send
      this mask to the kernel to capture the extended registers in each
      sample. Hence decide the mask value based on the processor version.
      
      Currently definitions for `mfspr`, `SPRN_PVR` are part of
      `arch/powerpc/util/header.c`. Move this to a header file so that these
      definitions can be re-used in other source files as well.
      Signed-off-by: default avatarAnju T Sudhakar <anju@linux.vnet.ibm.com>
      Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Reviewed-by: default avatarMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Reviewed--by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Tested-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org> <mikey@neuling.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      [Decide extended mask at run time based on platform]
      Signed-off-by: default avatarAthira Jajeev <atrajeev@linux.vnet.ibm.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      33583e69
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: Sync drm/i915_drm.h with the kernel sources · d01541d0
      Arnaldo Carvalho de Melo authored
      To pick the change in:
      
        66137f54 ("drm: i915_drm.h: delete duplicated words in comments")
      
      That don't result in any changes in tooling, just silences this perf
      build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h'
        diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d01541d0
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync asm/cpufeatures.h with the kernel sources · dd4a5c22
      Arnaldo Carvalho de Melo authored
      To pick up the changes from:
      
        85b23fbc ("x86/cpufeatures: Add enumeration for SERIALIZE instruction")
        bd657aa3 ("x86/cpufeatures: Add Architectural LBRs feature bit")
        fbd5969d ("x86/cpufeatures: Mark two free bits in word 3")
      
      These should't cause any changes in tooling, it just gets rebuilt by
      including those headers:
      
        CC       /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o
        CC       /tmp/build/perf/bench/mem-memset-x86-64-asm.o
        LD       /tmp/build/perf/bench/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      And silences 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: Borislav Petkov <bp@suse.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dd4a5c22
    • Arnaldo Carvalho de Melo's avatar
      tools arch x86: Sync the msr-index.h copy with the kernel sources · f815fe51
      Arnaldo Carvalho de Melo authored
      To pick up the changes in:
      
        d6a162a4 x86/msr-index: Add bunch of MSRs for Arch LBR
        ed7bde7a cpufreq: intel_pstate: Allow enable/disable energy efficiency
        99e40204 (tip/x86/cleanups) x86/msr: Move the F15h MSRs where they belong
        1068ed45 x86/msr: Lift AMD family 0x15 power-specific MSRs
        5cde2653 (tag: perf-core-2020-06-01) perf/x86/rapl: Add AMD Fam17h RAPL support
      
      Addressing these tools/perf build warnings:
      
      That makes the beautification scripts to pick some new entries:
      
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before
        $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h
        $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after
        $ diff -u before after
        --- before	2020-08-07 08:45:18.801298854 -0300
        +++ after	2020-08-07 08:45:28.654456422 -0300
        @@ -271,6 +271,8 @@
         	[0xc0010062 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PERF_CTL",
         	[0xc0010063 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PERF_STATUS",
         	[0xc0010064 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PSTATE_DEF_BASE",
        +	[0xc001007a - x86_AMD_V_KVM_MSRs_offset] = "F15H_CU_PWR_ACCUMULATOR",
        +	[0xc001007b - x86_AMD_V_KVM_MSRs_offset] = "F15H_CU_MAX_PWR_ACCUMULATOR",
         	[0xc0010112 - x86_AMD_V_KVM_MSRs_offset] = "K8_TSEG_ADDR",
         	[0xc0010113 - x86_AMD_V_KVM_MSRs_offset] = "K8_TSEG_MASK",
         	[0xc0010114 - x86_AMD_V_KVM_MSRs_offset] = "VM_CR",
        $
      
      And this gets rebuilt:
      
        CC       /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o
        INSTALL  trace_plugins
        LD       /tmp/build/perf/trace/beauty/tracepoints/perf-in.o
        LD       /tmp/build/perf/trace/beauty/perf-in.o
        LD       /tmp/build/perf/perf-in.o
        LINK     /tmp/build/perf/perf
      
      Now one can trace systemwide asking to see backtraces to where those
      MSRs are being read/written with:
      
        # perf trace -e msr:*_msr/max-stack=32/ --filter="msr==F15H_CU_PWR_ACCUMULATOR || msr==F15H_CU_MAX_PWR_ACCUMULATOR"
        ^C#
        #
      
      If we use -v (verbose mode) we can see what it does behind the scenes:
      
        # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==F15H_CU_PWR_ACCUMULATOR || msr==F15H_CU_MAX_PWR_ACCUMULATOR"
        Using CPUID GenuineIntel-6-8E-A
        0xc001007a
        0xc001007b
        New filter for msr:read_msr: (msr==0xc001007a || msr==0xc001007b) && (common_pid != 2448054 && common_pid != 2782)
        0xc001007a
        0xc001007b
        New filter for msr:write_msr: (msr==0xc001007a || msr==0xc001007b) && (common_pid != 2448054 && common_pid != 2782)
        mmap size 528384B
        ^C#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f815fe51
    • Arnaldo Carvalho de Melo's avatar
      tools headers UAPI: update linux/in.h copy · 7a36b9d2
      Arnaldo Carvalho de Melo authored
      To get the changes from:
      
        eba75c58 ("icmp: support rfc 4884")
      
      That don't cause any changes in tooling, as we still don't have a
      [gs]etsockopt 'level' beautifier, will try and have one soon.
      
      This silences 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: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7a36b9d2
  2. 06 Aug, 2020 35 commits