Ian Rogers
c0d68601cb
perf test: Add cputype testing to perf stat
...
Check a bogus PMU fails and that a known PMU succeeds. Limit to PMUs
known cpu, cpu_atom and armv8_pmuv3_0 ones.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230513063447.464691-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:18:43 -03:00
Arnaldo Carvalho de Melo
190c6854e9
perf build: Don't use -ftree-loop-distribute-patterns and -gno-variable-location-views in the python feature test when building with clang-13
...
Using -ftree-loop-distribute-patterns and -gno-variable-location-views
in the python feature test when building with clang-16 results in:
16 80.04 clearlinux:latest : FAIL clang version 16.0.1
clang-16: error: unknown argument: '-gno-variable-location-views'
clang-16: error: unknown argument: '-gno-variable-location-views'
clang-16: error: optimization flag '-ftree-loop-distribute-patterns' is not supported [-Werror,-Wignored-optimization-argument]
clang-16: error: optimization flag '-ftree-loop-distribute-patterns' is not supported [-Werror,-Wignored-optimization-argument]
error: command '/usr/sbin/clang' failed with exit code 1
Noticed when building on a docker.io/library/clearlinux:latest container.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
9a1bc9ea01
perf parse-events: Reduce scope of is_event_supported
...
Move to print-events.c and make static.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-45-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
718eabe1f3
perf stat: Don't disable TopdownL1 metric on hybrid
...
Now that hybrid bugs are fixed sufficient to run TopdownL1 metrics,
don't implicitly disable them for hybrid.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-44-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
8a4859c50f
perf metrics: Be PMU specific in event match
...
Ids/events from a metric are turned into an event string and parsed;
setup_metric_events matches the id back to the parsed evsel. With
hybrid the same event may exist on both PMUs with the same name and be
being used by metrics at the same time. A metric on cpu_core therefore
shouldn't match against evsels on cpu_atom, or the metric will compute
the wrong value. Make the matching sensitive to the PMU being parsed.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-43-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
d6b7dd1107
perf jevents: Don't rewrite metrics across PMUs
...
Don't rewrite metrics across PMUs as the result events likely won't be
found. Identify metrics with a pair of PMU name and metric name.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-42-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
1b8012b26f
perf vendor events intel: Correct alderlake metrics
...
Fix the metrics tma_memory_bound on alderlake cpu_core and
tma_microcode_sequencer on alderlake cpu_atom, where metrics had be
rewritten across PMUs. Fix MEM_BOUND_STALLS_AT_RET_CORRECTION which is
an aux metric but lacks a hash prefix. Add PMU prefixes for
cpu_core/cpu_atom events to avoid wildcard opening the events.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-41-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
dae47d3940
perf stat: Command line PMU metric filtering
...
Wire up the --cputype value to limit which metrics are parsed.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-40-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
bd3846d0fe
perf metrics: Be PMU specific for referenced metrics.
...
Hybrid systems may define the same metric for different PMUs, this can
cause confusion of events. To avoid this make the referenced metric
searches PMU specific, matching that in the table.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-39-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
5136e43c61
perf parse-events: Don't reorder atom cpu events
...
On hybrid systems the topdown events don't share a fixed counter on
the atom core, so they don't require the sorting the perf metric
supporting PMUs do.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-38-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
52c7b4d3f9
perf parse-events: Don't auto merge hybrid wildcard events
...
Bring back the behavior of not auto-merging hybrid events by
delegating to a test in pmu.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-37-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
2aadca4b35
perf parse-events: Avoid error when assigning a legacy cache term
...
Avoid the parser error:
'''
$ perf stat -e 'cycles/name=l1d/' true
event syntax error: 'cycles/name=l1d/'
\___ parser error
'''
by combining the name and legacy cache cases in the parser.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-36-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
e831f3ccf9
perf parse-events: Avoid error when assigning a term
...
Avoid the parser error:
'''
$ perf stat -e 'cycles/name=name/' true
event syntax error: 'cycles/name=name/'
\___ parser error
'''
by turning the term back to a string if it is on the right. Add PMU
and generic parsing tests.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-35-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
5ea8f2ccff
perf parse-events: Support hardware events as terms
...
An event like "cpu/instructions/" typically parses due to there being
a sysfs event called instructions. On hybrid recursive parsing means
that the hardware event is encoded in the attribute, with the PMU
being placed in the high bits of the config:
'''
$ perf stat -vv -e 'cpu_core/cycles/' true
...
------------------------------------------------------------
perf_event_attr:
size 136
config 0x400000000
sample_type IDENTIFIER
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
inherit 1
enable_on_exec 1
exclude_guest 1
------------------------------------------------------------
'''
Make this behavior the default by adding a new term type and token for
hardware events. The token gathers both the numeric config and the
parsed name, so that if the token appears like "cycles/name=cycles/"
then the token can be handled like a name. The numeric value isn't
sufficient to distinguish say "cpu-cycles" from "cycles".
Extend the parse-events test so that all current non-PMU hardware
parsing tests, also test with the PMU cpu - more than half the change.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-34-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
aefde50a44
perf test: Fix parse-events tests for >1 core PMU
...
Remove assumptions of just 1 core PMU.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-33-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
003be8c4f7
perf stat: Make cputype filter generic
...
Rather than limit the --cputype argument for "perf list" and "perf
stat" to hybrid PMUs of just cpu_atom and cpu_core, allow any PMU.
Note, that if cpu_atom isn't mounted but a filter of cpu_atom is
requested, then this will now fail. As such a filter would never
succeed, no events can come from that unmounted PMU, then this
behavior could never have been useful and failing is clearer.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-31-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
411ad22ecf
perf parse-events: Add pmu filter
...
To support the cputype argument added to "perf stat" for hybrid it is
necessary to filter events during wildcard matching. Add a scanner
argument for the filter and checking it when wildcard matching.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-30-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
24d80818ce
perf parse-events: Minor type safety cleanup
...
Use the typed parse_state rather than void* _parse_state when
available.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-29-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:14 -03:00
Ian Rogers
996e54bbee
perf parse-events: Remove now unused hybrid logic
...
The event parser no longer needs to recurse in case of a legacy cache
event in a PMU, the necessary wild card logic has moved to
perf_pmu__supports_legacy_cache and
perf_pmu__supports_wildcard_numeric.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-28-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
8bc75f699c
perf parse-events: Support wildcards on raw events
...
Legacy raw events like r1a open as PERF_TYPE_RAW on non-hybrid systems
and on each hybrid PMU on hybrid systems. Rather than iterate hybrid
PMUs add a perf_pmu__supports_wildcard_numeric function that says when
a numeric event should be opened upon it. If the parsed event
specifies the type of the PMU then don't wildcard match PMUs, use the
specified PMU type.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-27-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
d7f21df0c9
perf print-events: Print legacy cache events for each PMU
...
Mirroring parse_events_add_cache, list the legacy name alongside its
alias with the PMU. Remove the now unnecessary hybrid logic.
Note, the alias output removes the event type descriptor, so:
L1-dcache-loads [Hardware cache event]
becomes:
L1-dcache-loads OR cpu/L1-dcache-loads/
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-26-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
2bdf4d7ea9
perf parse-events: Wildcard legacy cache events
...
It is inconsistent that "perf stat -e instructions-retired" wildcard
opens on all PMUs while legacy cache events like "perf stat -e
L1-dcache-load-miss" do not. A behavior introduced by hybrid is that a
legacy cache event like L1-dcache-load-miss should wildcard open on
all hybrid PMUs. Previously hybrid would call to is_event_supported
for each PMU, a failure of which results in the event not being
added. This isn't done in this case as the parser should just create
perf_event_attr and the later open should fail, or the counter give
"<not counted>". If this wants to be avoided then the PMU can be named
with the event.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-25-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
6fd1e51915
perf parse-events: Support PMUs for legacy cache events
...
Allow a legacy cache event to be both, for example,
"L1-dcache-load-miss" and "cpu/L1-dcache-load-miss/" by introducing a
new legacy cache term type.
The term type is processed in config_term_pmu, setting both the type in
perf_event_attr and the config.
The code to determine the config is factored out of
parse_events_add_cache and shared. If the PMU doesn't support legacy
events, currently just core/hybrid PMUs do, then the term is treated
like a PE_NAME term - as before.
If only terms are being parsed, such as for perf_pmu__new_alias, then
the PE_LEGACY_CACHE token is always parsed as PE_NAME.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-24-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
68911aef3d
perf test x86 hybrid: Add hybrid extended type checks
...
Assert hybrid extended types are as expected.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-23-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
8d8632887d
perf test x86 hybrid: Update test expectations
...
Don't assume evlist order. Switch to a loop rather than depend on
evlist order for raw events test.
Update hybrid event expectations. Previous values were based on
parsing legacy hardware events from sysfs, update to the correct PMU
specific legacy values.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-22-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
ae4aa00a1a
perf test: Move x86 hybrid tests to arch/x86
...
The tests use x86 hybrid specific PMUs.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-21-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
70c90e4a6b
perf parse-events: Avoid scanning PMUs before parsing
...
The event parser needs to handle two special cases:
1) legacy events like L1-dcache-load-miss. These event names don't
appear in JSON or sysfs, and lookup tables are used for the config
value.
2) raw events where 'r0xead' is the same as 'read' unless the PMU has
an event called 'read' in which case the event has priority.
The previous parser to handle these cases would scan all PMUs for
components of event names. These components would then be used to
classify in the lexer whether the token should be part of a legacy
event, a raw event or an event. The grammar would handle legacy event
tokens or recombining the tokens back into a regular event name. The
code wasn't PMU specific and had issues around events like AMD's
branch-brs that would fail to parse as it expects brs to be a suffix
on a legacy event style name:
$ perf stat -e branch-brs true
event syntax error: 'branch-brs'
\___ parser error
This change removes processing all PMUs by using the lexer in the form
of a regular expression matcher. The lexer will return the token for
the longest matched sequence of characters, and in the event of a tie
the first. The legacy events are a fixed number of regular
expressions, and by matching these before a name token its possible to
generate an accurate legacy event token with everything else matching
as a name. Because of the lexer change the handling of hyphens in the
grammar can be removed as hyphens just become a part of the name.
To handle raw events and terms the parser is changed to defer trying
to evaluate whether something is a raw event until the PMU is known in
the grammar. Once the PMU is known, the events of the PMU can be
scanned for the 'read' style problem. A new term type is added for
these raw terms, used to enable deferring the evaluation.
While this change is large, it has stats of:
170 insertions(+), 436 deletions(-)
the bulk of the change is deleting the old approach. It isn't possible
to break apart the code added due to the dependencies on how the parts
of the parsing work.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-19-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
442eeb7704
perf print-events: Avoid unnecessary strlist
...
The strlist in print_hwcache_events holds the event names as they are
generated, and then it is iterated and printed. This is unnecessary
and each event can just be printed as it is processed.
Rename the variable i to res, to be more intention revealing and
consistent with other code.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-18-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
cae256ae75
perf parse-events: Set pmu_name whenever a pmu is given
...
Change add_event to always set pmu_name when possible as not all code
checks both pmu->name and evsel->pmu_name, for example,
uniquify_counter in stat-display.c.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-17-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
c9aeb2e9cc
perf parse-events: Set attr.type to PMU type early
...
Set attr.type to PMU type early so that later terms can override the
value. Setting the value in perf_pmu__config means that earlier steps,
like config_term_pmu, can override the value.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-16-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
a8af6e48c6
perf test: Roundtrip name, don't assume 1 event per name
...
Opening hardware names and a legacy cache event on a hybrid PMU opens
it on each PMU. Parsing and checking indexes fails, as the parsed
index is double the expected. Avoid checking the index by just
comparing the names immediately after the parse.
This change removes hard coded hybrid logic and removes assumptions
about the expansion of an event. On hybrid the PMUs may or may not
support an event and so using a distance isn't a consistent solution.
Reviewed-by: Kan Liang <kan.liang@linux.intel.com >
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-15-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
4a7c4eafb7
perf test: Test more with config_cache
...
test__checkevent_config_cache checks the parsing of
"L1-dcache-misses/name=cachepmu/". Don't just check that the name is
set correctly, also validate the rest of the perf_event_attr for
L1-dcache-misses.
Reviewed-by: Kan Liang <kan.liang@linux.intel.com >
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-14-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
9854934b05
perf test: Mask configs with extended types then test
...
Add helper to test the config of an evsel. Dependent on the type of
the evsel, mask the config so that high-bits containing the extended
PMU type are ignored.
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-13-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:13 -03:00
Ian Rogers
8f8c106886
perf test: Use valid for PMU tests
...
Rather than skip all tests in test__events_pmu if PMU cpu isn't
present, use the per-test valid test. This allows the running of
software PMU tests on hybrid and arm systems.
Reviewed-by: Kan Liang <kan.liang@linux.intel.com >
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-12-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:12:10 -03:00
Ian Rogers
5a52817e38
perf test: Test more sysfs events
...
Parse events for all PMUs, and not just cpu, in test "Parsing of all
PMU events from sysfs".
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-11-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:07:50 -03:00
Ian Rogers
cde61c6052
perf vendor events intel: Add tigerlake metric constraints
...
Previously these constraints were disabled as they contained topdown
events. Since:
https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/
the topdown events are correctly grouped even if no group exists.
This change was created by PR:
https://github.com/intel/perfmon/pull/71
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-10-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:07:45 -03:00
Ian Rogers
cbd393afa3
perf vendor events intel: Add sapphirerapids metric constraints
...
Previously these constraints were disabled as they contained topdown
events. Since:
https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/
the topdown events are correctly grouped even if no group exists.
This change was created by PR:
https://github.com/intel/perfmon/pull/71
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-9-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:07:39 -03:00
Ian Rogers
f215040aa2
perf vendor events intel: Add icelakex metric constraints
...
Previously these constraints were disabled as they contained topdown
events. Since:
https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/
the topdown events are correctly grouped even if no group exists.
This change was created by PR:
https://github.com/intel/perfmon/pull/71
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-8-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:07:33 -03:00
Ian Rogers
aea8abd7d4
perf vendor events intel: Add icelake metric constraints
...
Previously these constraints were disabled as they contained topdown
events. Since:
https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/
the topdown events are correctly grouped even if no group exists.
This change was created by PR:
https://github.com/intel/perfmon/pull/71
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-7-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:07:21 -03:00
Ian Rogers
2a61d97fb0
perf vendor events intel: Add alderlake metric constraints
...
Previously these constraints were disabled as they contained topdown
events. Since:
https://lore.kernel.org/all/20230312021543.3060328-9-irogers@google.com/
the topdown events are correctly grouped even if no group exists.
This change was created by PR:
https://github.com/intel/perfmon/pull/71
Signed-off-by: Ian Rogers <irogers@google.com >
Tested-by: Kan Liang <kan.liang@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Ahmad Yasin <ahmad.yasin@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com >
Cc: Caleb Biggers <caleb.biggers@intel.com >
Cc: Edward Baker <edward.baker@intel.com >
Cc: Florian Fischer <florian.fischer@muhq.space >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: James Clark <james.clark@arm.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Kajol Jain <kjain@linux.ibm.com >
Cc: Kang Minchul <tegongkang@gmail.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Perry Taylor <perry.taylor@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Ravi Bangoria <ravi.bangoria@amd.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Samantha Alt <samantha.alt@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com >
Cc: Suzuki Poulouse <suzuki.poulose@arm.com >
Cc: Thomas Richter <tmricht@linux.ibm.com >
Cc: Tiezhu Yang <yangtiezhu@loongson.cn >
Cc: Weilin Wang <weilin.wang@intel.com >
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com >
Cc: Yang Jihong <yangjihong1@huawei.com >
Link: https://lore.kernel.org/r/20230502223851.2234828-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-15 09:00:29 -03:00
Jeremy Sowden
5f5486b620
selftests/bpf: Fix pkg-config call building sign-file
...
When building sign-file, the call to get the CFLAGS for libcrypto is
missing white-space between `pkg-config` and `--cflags`:
$(shell $(HOSTPKG_CONFIG)--cflags libcrypto 2> /dev/null)
Removing the redirection of stderr, we see:
$ make -C tools/testing/selftests/bpf sign-file
make: Entering directory '[...]/tools/testing/selftests/bpf'
make: pkg-config--cflags: No such file or directory
SIGN-FILE sign-file
make: Leaving directory '[...]/tools/testing/selftests/bpf'
Add the missing space.
Fixes: fc97590668 ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
Signed-off-by: Jeremy Sowden <jeremy@azazel.net >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com >
Link: https://lore.kernel.org/bpf/20230426215032.415792-1-jeremy@azazel.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2023-05-14 14:59:44 -07:00
Linus Torvalds
533c545471
Merge tag 'cxl-fixes-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
...
Pull compute express link fixes from Dan Williams:
- Fix a compilation issue with DEFINE_STATIC_SRCU() in the unit tests
- Fix leaking kernel memory to a root-only sysfs attribute
* tag 'cxl-fixes-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
cxl: Add missing return to cdat read error path
tools/testing/cxl: Use DEFINE_STATIC_SRCU()
2023-05-14 12:32:34 -07:00
Stanislav Fomichev
e01b4a72f1
selftests/bpf: Correctly handle optlen > 4096
...
Even though it's not relevant in selftests, the people
might still copy-paste from them. So let's take care
of optlen > 4096 cases explicitly.
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Link: https://lore.kernel.org/r/20230511170456.1759459-4-sdf@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org >
2023-05-13 16:55:46 -07:00
Stanislav Fomichev
989a4a7dbf
selftests/bpf: Update EFAULT {g,s}etsockopt selftests
...
Instead of assuming EFAULT, let's assume the BPF program's
output is ignored.
Remove "getsockopt: deny arbitrary ctx->retval" because it
was actually testing optlen. We have separate set of tests
for retval.
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Link: https://lore.kernel.org/r/20230511170456.1759459-3-sdf@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org >
2023-05-13 16:55:44 -07:00
Vladimir Nikishkin
305c041899
selftests: net: vxlan: Add tests for vxlan nolocalbypass option.
...
Add test to make sure that the localbypass option is on by default.
Add test to change vxlan localbypass to nolocalbypass and check
that packets are delivered to userspace.
Signed-off-by: Vladimir Nikishkin <vladimir@nikishkin.pw >
Reviewed-by: Ido Schimmel <idosch@nvidia.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2023-05-13 17:02:33 +01:00
Dan Williams
270205be71
tools/testing/cxl: Use DEFINE_STATIC_SRCU()
...
Starting with commit:
95433f7263 ("srcu: Begin offloading srcu_struct fields to srcu_update")
...it is no longer possible to do:
static DEFINE_SRCU(x)
Switch to DEFINE_STATIC_SRCU(x) to fix:
tools/testing/cxl/test/mock.c:22:1: error: duplicate ‘static’
22 | static DEFINE_SRCU(cxl_mock_srcu);
| ^~~~~~
Reviewed-by: Dave Jiang <dave.jiang@intel.com >
Link: https://lore.kernel.org/r/168392709546.1135523.10424917245934547117.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com >
2023-05-13 00:16:40 -07:00
Andrii Nakryiko
bdeeed3498
libbpf: fix offsetof() and container_of() to work with CO-RE
...
It seems like __builtin_offset() doesn't preserve CO-RE field
relocations properly. So if offsetof() macro is defined through
__builtin_offset(), CO-RE-enabled BPF code using container_of() will be
subtly and silently broken.
To avoid this problem, redefine offsetof() and container_of() in the
form that works with CO-RE relocations more reliably.
Fixes: 5fbc220862 ("tools/libpf: Add offsetof/container_of macro in bpf_helpers.h")
Reported-by: Lennart Poettering <lennart@poettering.net >
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Acked-by: Yonghong Song <yhs@fb.com >
Link: https://lore.kernel.org/r/20230509065502.2306180-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2023-05-12 12:05:21 -07:00
Adrian Hunter
d3b52f71d1
perf script: Refine printing of dso offset (dsoff)
...
Print dso offset only for object files, and in those cases force using the
dso->long_name if the dso->name starts with '[' or the dso is kcore, in
order to avoid special names such as [vdso], or mixing up kcore with
vmlinux.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20230424055107.12105-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-12 15:21:49 -03:00
Adrian Hunter
24f0af6d03
perf dso: Declare dso const as needed
...
Declare dso const, so that functions can be called with const struct *dso.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Changbin Du <changbin.du@huawei.com >
Cc: Ian Rogers <irogers@google.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: https://lore.kernel.org/r/20230424055107.12105-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-12 15:21:49 -03:00
Changbin Du
af9eb56bfe
perf script: Add new output field 'dsoff' to print dso offset
...
This adds a new 'dsoff' field to print dso offset for resolved symbols,
and the offset is appended to dso name.
Default output:
$ perf script
ls 2695501 3011030.487017: 500000 cycles: 152cc73ef4b5 get_common_indices.constprop.0+0x155 (/usr/lib/x86_64-linux-gnu/ld-2.31.so)
ls 2695501 3011030.487018: 500000 cycles: ffffffff99045b3e [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffff9968e107 [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffffc1f54afb [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffff9968382f [unknown] ([unknown])
ls 2695501 3011030.487019: 500000 cycles: ffffffff99e00094 [unknown] ([unknown])
ls 2695501 3011030.487019: 500000 cycles: 152cc718a8d0 __errno_location@plt+0x0 (/usr/lib/x86_64-linux-gnu/libselinux.so.1)
Display 'dsoff' field:
$ perf script -F +dsoff
ls 2695501 3011030.487017: 500000 cycles: 152cc73ef4b5 get_common_indices.constprop.0+0x155 (/usr/lib/x86_64-linux-gnu/ld-2.31.so+0x1c4b5)
ls 2695501 3011030.487018: 500000 cycles: ffffffff99045b3e [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffff9968e107 [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffffc1f54afb [unknown] ([unknown])
ls 2695501 3011030.487018: 500000 cycles: ffffffff9968382f [unknown] ([unknown])
ls 2695501 3011030.487019: 500000 cycles: ffffffff99e00094 [unknown] ([unknown])
ls 2695501 3011030.487019: 500000 cycles: 152cc718a8d0 __errno_location@plt+0x0 (/usr/lib/x86_64-linux-gnu/libselinux.so.1+0x68d0)
ls 2695501 3011030.487019: 500000 cycles: ffffffff992a6db0 [unknown] ([unknown])
Signed-off-by: Changbin Du <changbin.du@huawei.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Hui Wang <hw.huiwang@huawei.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 >
Link: https://lore.kernel.org/r/20230418031825.1262579-4-changbin.du@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2023-05-12 15:21:49 -03:00