1. 12 Jul, 2022 6 commits
  2. 29 Jun, 2022 4 commits
    • Ian Rogers's avatar
      perf jevents: Remove jevents.c · 5a059790
      Ian Rogers authored
      Remove files and build rules.
      
      Remove test for comparing with jevents.py as there is no longer a binary
      to compare with.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qi Liu <liuqi115@huawei.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220629182505.406269-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5a059790
    • Ian Rogers's avatar
      perf jevents: Switch build to use jevents.py · 00facc76
      Ian Rogers authored
      Generate pmu-events.c using jevents.py rather than the binary built from
      jevents.c.
      
      Add a new config variable NO_JEVENTS that is set when there is no
      architecture json or an appropriate python interpreter isn't present.
      
      When NO_JEVENTS is defined the file pmu-events/empty-pmu-events.c is
      copied and used as the pmu-events.c file.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Ian Rogers <rogers.email@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qi Liu <liuqi115@huawei.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20220629182505.406269-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      00facc76
    • Ian Rogers's avatar
      perf jevents: Add python converter script · ffc606ad
      Ian Rogers authored
      jevents.c is large, has a dependency on an old forked version of jsmn,
      and is challenging to work upon. A lot of jevents.c's complexity comes
      from needing to write json and csv parsing from first principles. In
      contrast python has this functionality in standard libraries and is
      already a build pre-requisite for tools like asciidoc (that builds all
      of the perf man pages).
      
      Introduce jevents.py that produces identical output to jevents.c. Add a
      test that runs both converter tools and validates there are no output
      differences. The test can be invoked with a phony build target like:
      
        $ make -C tools/perf jevents-py-test
      
      The python code deliberately tries to replicate the behavior of
      jevents.c so that the output matches and transitioning tools shouldn't
      introduce regressions. In some cases the code isn't as elegant as hoped,
      but fixing this can be done as follow up.
      
      Committer testing:
      
        $ make -C tools/perf jevents-py-test
        make: Entering directory '/var/home/acme/git/perf/tools/perf'
          BUILD:   Doing 'make -j32' parallel build
          HOSTCC  fixdep.o
          HOSTLD  fixdep-in.o
          LINK    fixdep
      
        Auto-detecting system features:
        ...                         dwarf: [ on  ]
        ...            dwarf_getlocations: [ on  ]
        ...                         glibc: [ on  ]
        ...                        libbfd: [ on  ]
        ...                libbfd-buildid: [ on  ]
        ...                        libcap: [ on  ]
        ...                        libelf: [ on  ]
        ...                       libnuma: [ on  ]
        ...        numa_num_possible_cpus: [ on  ]
        ...                       libperl: [ on  ]
        ...                     libpython: [ on  ]
        ...                     libcrypto: [ OFF ]
        ...                     libunwind: [ on  ]
        ...            libdw-dwarf-unwind: [ on  ]
        ...                          zlib: [ on  ]
        ...                          lzma: [ on  ]
        ...                     get_cpuid: [ on  ]
        ...                           bpf: [ on  ]
        ...                        libaio: [ on  ]
        ...                       libzstd: [ on  ]
        ...        disassembler-four-args: [ on  ]
      
          HOSTCC  pmu-events/json.o
          HOSTCC  pmu-events/jsmn.o
          HOSTCC  pmu-events/jevents.o
          HOSTLD  pmu-events/jevents-in.o
          LINK    pmu-events/jevents
        Checking architecture: arm64
        Generating using jevents.c
        Generating using jevents.py
        Diffing
        Checking architecture: nds32
        Generating using jevents.c
        Generating using jevents.py
        Diffing
        Checking architecture: powerpc
        Generating using jevents.c
        Generating using jevents.py
        Diffing
        Checking architecture: s390
        Generating using jevents.c
        Generating using jevents.py
        Diffing
        Checking architecture: x86
        Generating using jevents.c
        Generating using jevents.py
        Diffing
        make: Leaving directory '/var/home/acme/git/perf/tools/perf'
        $
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Tested-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Tested-by: default avatarXing Zhengjun <zhengjun.xing@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qi Liu <liuqi115@huawei.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220629182505.406269-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ffc606ad
    • Ian Rogers's avatar
      perf python: Prefer python3 · 4c41cb46
      Ian Rogers authored
      The PYTHON_AUTO code orders the preference for the PYTHON command to be
      python3, python and then python2. python3 makes a more logical
      preference as python2 is no longer supported:
      
        https://www.python.org/doc/sunset-python-2/
      
      Reorder the priority of the PYTHON command to be python2, python and
      then python3.
      Reported-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarJohn Garry <john.garry@huawei.com>
      Tested-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Tested-by: default avatarXing Zhengjun <zhengjun.xing@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
      Cc: Like Xu <likexu@tencent.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Forrington <nick.forrington@arm.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Qi Liu <liuqi115@huawei.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20220629182505.406269-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4c41cb46
  3. 24 Jun, 2022 7 commits
    • Ravi Bangoria's avatar
      perf script ibs: Support new IBS bits in raw trace dump · 0429796e
      Ravi Bangoria authored
      Interpret Additional set of IBS register bits while doing
      perf report/script raw dump.
      
      IBS op PMU ex:
      
        $ sudo ./perf record -c 130 -a -e ibs_op/l3missonly=1/ --raw-samples
        $ sudo ./perf report -D
        ...
        ibs_op_ctl:     0000004500070008 MaxCnt       128 L3MissOnly 1 En 1
              Val 1 CntCtl 0=cycles CurCnt        69
        ibs_op_data:    0000000000710002 CompToRetCtr     2 TagToRetCtr   113
              BrnRet 0  RipInvalid 0 BrnFuse 0 Microcode 0
        ibs_op_data2:   0000000000000002 CacheHitSt 0=M-state RmtNode 0
              DataSrc 2=A peer cache in a near CCX
        ibs_op_data3:   000000681d1700a1 LdOp 1 StOp 0 DcL1TlbMiss 0
              DcL2TlbMiss 0 DcL1TlbHit2M 0 DcL1TlbHit1G 1 DcL2TlbHit2M 0
              DcMiss 1 DcMisAcc 0 DcWcMemAcc 0 DcUcMemAcc 0 DcLockedOp 0
              DcMissNoMabAlloc 1 DcLinAddrValid 1 DcPhyAddrValid 1
              DcL2TlbHit1G 0 L2Miss 1 SwPf 0 OpMemWidth  8 bytes
              OpDcMissOpenMemReqs  7 DcMissLat   104 TlbRefillLat     0
      
      IBS Fetch PMU ex:
        $ sudo ./perf record -c 130 -a -e ibs_fetch/l3missonly=1/ --raw-samples
        $ sudo ./perf report -D
        ...
        ibs_fetch_ctl:  3c1f00c700080008 MaxCnt     128 Cnt     128 Lat   199
              En 1 Val 1 Comp 1 IcMiss 1 PhyAddrValid        1 L1TlbPgSz 4KB
              L1TlbMiss 0 L2TlbMiss 0 RandEn 0 L2Miss 1 L3MissOnly 1
              FetchOcMiss 1 FetchL3Miss 1
      
      With the DataSrc extensions, the source of data can be decoded among:
       - Local L3 or other L1/L2 in CCX.
       - A peer cache in a near CCX.
       - Data returned from DRAM.
       - A peer cache in a far CCX.
       - DRAM address map with "long latency" bit set.
       - Data returned from MMIO/Config/PCI/APIC.
       - Extension Memory (S-Link, GenZ, etc - identified by the CS target
          and/or address map at DF's choice).
       - Peer Agent Memory.
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.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: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-9-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0429796e
    • Ravi Bangoria's avatar
      perf tool ibs: Sync AMD IBS header file · c1f4f92b
      Ravi Bangoria authored
      IBS support has been enhanced with two new features in upcoming uarch:
      
      1. DataSrc extension
      2. L3 miss filtering.
      
      Additional set of bits has been introduced in IBS registers to exploit
      these features.
      
      New bits are already defining in arch/x86/ header. Sync it with tools
      header file. Also rename existing ibs_op_data field 'data_src' to
      'data_src_lo'.
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.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: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-8-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c1f4f92b
    • Ravi Bangoria's avatar
      perf header: Record non-CPU PMU capabilities · 2139f742
      Ravi Bangoria authored
      PMUs advertise their capabilities via sysfs attribute files but
      the perf tool currently parses only core(CPU) or hybrid core PMU
      capabilities. Add support of recording non-core PMU capabilities
      int perf.data header.
      
      Note that a newly proposed HEADER_PMU_CAPS is replacing existing
      HEADER_HYBRID_CPU_PMU_CAPS. Special care is taken for hybrid core
      PMUs by writing their capabilities first in the perf.data header
      to make sure new perf.data file being read by old perf tool does
      not break.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-6-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2139f742
    • Ravi Bangoria's avatar
      perf header: Store PMU caps in an array of strings · ff34eaa8
      Ravi Bangoria authored
      Currently all capabilities are stored in a single string separated by
      NULL character. Instead, store them in an array which makes searching of
      capability easier.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-5-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ff34eaa8
    • Ravi Bangoria's avatar
      perf header: Pass "cpu" pmu name while printing caps · 2a12bef4
      Ravi Bangoria authored
      Avoid unnecessary conditional code to check if pmu name is NULL
      or not by passing "cpu" pmu name to the printing function.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-4-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2a12bef4
    • Ravi Bangoria's avatar
      perf pmu: Parse pmu caps sysfs only once · 3339ec44
      Ravi Bangoria authored
      In addition to returning nr_caps, cache it locally in struct perf_pmu.
      
      Similarly, cache status of whether caps sysfs has already been parsed
      or not. These will help to avoid parsing sysfs every time the function
      gets called.
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: https://lore.kernel.org/r/20220604044519.594-3-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3339ec44
    • Ravi Bangoria's avatar
      perf record ibs: Warn about sampling period skew · 9ab95b0b
      Ravi Bangoria authored
      Samples without an L3 miss are discarded and counter is reset with
      random value (between 1-15 for fetch PMU and 1-127 for op PMU) when IBS
      L3 miss filtering is enabled. This causes a sampling period skew but
      there is no way to reconstruct aggregated sampling period. So print a
      warning at perf record if user sets l3missonly=1.
      
      Ex:
      
        # perf record -c 10000 -C 0 -e ibs_op/l3missonly=1/
        WARNING: Hw internally resets sampling period when L3 Miss Filtering is enabled
        and tagged operation does not cause L3 Miss. This causes sampling period skew.
      Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@amd.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ananth Narayan <ananth.narayan@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rrichter@amd.com>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Santosh Shukla <santosh.shukla@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: like.xu.linux@gmail.com
      Cc: x86@kernel.org
      Link: http://lore.kernel.org/lkml/20220604044519.594-2-ravi.bangoria@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ab95b0b
  4. 23 Jun, 2022 18 commits
  5. 22 Jun, 2022 5 commits