Ian Rogers
5b562763d7
perf test stat: Additional topdown grouping tests
...
Add a loop and helper function to avoid repetition, the loop uses
arrays so switch the shell to bash. Add additional topdown group tests
where a topdown event needs to be moved beyond others and the slots
event isn't first in the target group. This replicates issues that
occur on hybrid systems where the other events are for the cpu_atom
PMU. Test with both PMU and software events. Place the slots event
later in the event list.
Signed-off-by: Ian Rogers <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2025-03-11 19:05:04 -07:00
Ian Rogers
f9c506fb69
perf test stat: Avoid hybrid assumption when virtualized
...
The cycles event will fallback to task-clock in the hybrid test when
running virtualized. Change the test to not fail for this.
Fixes: 65d1182191 ("perf test: Add a test for default perf stat command")
Reviewed-by: James Clark <[email protected] >
Signed-off-by: Ian Rogers <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2025-01-14 14:57:19 -03:00
Namhyung Kim
bb6e7cb11d
perf tools: Add fallback for exclude_guest
...
Commit 7b100989b4 ("perf evlist: Remove __evlist__add_default")
changed to parse "cycles:P" event instead of creating a new cycles
event for perf record. But it also changed the way how modifiers are
handled so it doesn't set the exclude_guest bit by default.
It seems Apple M1 PMU requires exclude_guest set and returns EOPNOTSUPP
if not. Let's add a fallback so that it can work with default events.
Also update perf stat hybrid tests to handle possible u or H modifiers.
Reviewed-by: Ian Rogers <[email protected] >
Reviewed-by: James Clark <[email protected] >
Reviewed-by: Ravi Bangoria <[email protected] >
Acked-by: Kan Liang <[email protected] >
Cc: James Clark <[email protected] >
Cc: Atish Patra <[email protected] >
Cc: Mingwei Zhang <[email protected] >
Cc: Kajol Jain <[email protected] >
Cc: Thomas Richter <[email protected] >
Cc: Palmer Dabbelt <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Fixes: 7b100989b4 ("perf evlist: Remove __evlist__add_default")
Signed-off-by: Namhyung Kim <[email protected] >
2024-10-22 09:51:22 -07:00
Dapeng Mi
80f192724e
perf tests: Add more topdown events regroup tests
...
Add more test cases to cover all supported topdown events regroup cases.
Reviewed-by: Kan Liang <[email protected] >
Signed-off-by: Dapeng Mi <[email protected] >
Cc: Yongwei Ma <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2024-09-30 15:23:44 -07:00
Dapeng Mi
0836aa6008
perf tests: Add topdown events counting and sampling tests
...
Add counting and leader sampling tests to verify topdown events including
raw format can be reordered correctly.
Reviewed-by: Kan Liang <[email protected] >
Signed-off-by: Dapeng Mi <[email protected] >
Cc: Yongwei Ma <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2024-09-30 15:23:44 -07:00
James Clark
65d1182191
perf test: Add a test for default perf stat command
...
Test that one cycles event is opened for each core PMU when "perf stat"
is run without arguments.
The event line can either be output as "pmu/cycles/" or just "cycles" if
there is only one PMU. Include 2 spaces for padding in the one PMU case
to avoid matching when the word cycles is included in metric
descriptions.
Acked-by: Namhyung Kim <[email protected] >
Acked-by: Kan Liang <[email protected] >
Signed-off-by: James Clark <[email protected] >
Cc: Yang Jihong <[email protected] >
Cc: Dominique Martinet <[email protected] >
Cc: Colin Ian King <[email protected] >
Cc: Howard Chu <[email protected] >
Cc: Ze Gao <[email protected] >
Cc: Yicong Yang <[email protected] >
Cc: Weilin Wang <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Jing Zhang <[email protected] >
Cc: Yang Li <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: [email protected]
Cc: Athira Rajeev <[email protected] >
Cc: [email protected]
Cc: Yanteng Si <[email protected] >
Cc: Sun Haiyong <[email protected] >
Cc: John Garry <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2024-09-26 13:26:12 -07:00
James Clark
14b6b269f4
perf test: Make stat test work on DT devices
...
PMUs aren't listed in /sys/devices/ on DT devices, so change the search
directory to /sys/bus/event_source/devices which works everywhere. Also
add armv8_cortex_* as a known PMU type to search for to make the test
run on more devices.
Acked-by: Namhyung Kim <[email protected] >
Acked-by: Kan Liang <[email protected] >
Signed-off-by: James Clark <[email protected] >
Cc: Yang Jihong <[email protected] >
Cc: Dominique Martinet <[email protected] >
Cc: Colin Ian King <[email protected] >
Cc: Howard Chu <[email protected] >
Cc: Yunseong Kim <[email protected] >
Cc: Ze Gao <[email protected] >
Cc: Yicong Yang <[email protected] >
Cc: Weilin Wang <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Jing Zhang <[email protected] >
Cc: Yang Li <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: [email protected]
Cc: Athira Rajeev <[email protected] >
Cc: [email protected]
Cc: Sun Haiyong <[email protected] >
Cc: John Garry <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2024-09-26 13:26:12 -07:00
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 <[email protected] >
Tested-by: Kan Liang <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Ahmad Yasin <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Athira Rajeev <[email protected] >
Cc: Caleb Biggers <[email protected] >
Cc: Edward Baker <[email protected] >
Cc: Florian Fischer <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Kajol Jain <[email protected] >
Cc: Kang Minchul <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Perry Taylor <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Ravi Bangoria <[email protected] >
Cc: Rob Herring <[email protected] >
Cc: Samantha Alt <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Sumanth Korikkar <[email protected] >
Cc: Suzuki Poulouse <[email protected] >
Cc: Thomas Richter <[email protected] >
Cc: Tiezhu Yang <[email protected] >
Cc: Weilin Wang <[email protected] >
Cc: Xing Zhengjun <[email protected] >
Cc: Yang Jihong <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2023-05-15 09:18:43 -03:00
Sandipan Das
8669862388
perf test: Add stat test for record and script
...
When using the global aggregation mode, running perf script after perf
stat record can result in a segmentation fault as seen with commit
8b76a3188b ("perf stat: Remove unused perf_counts.aggr field").
Add a basic test to the existing suite of stat-related tests for
checking if that workflow runs without erroring out.
Signed-off-by: Sandipan Das <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Ananth Narayan <[email protected] >
Cc: Ian Rogers <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Nick Terrell <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Ravi Bangoria <[email protected] >
Link: https://lore.kernel.org/r/6a5429879764e3dac984cbb11ee2d95cc1604161.1683280603.git.sandipan.das@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2023-05-10 14:36:18 -03:00
Tiezhu Yang
818448e9cf
perf tools: Use "grep -E" instead of "egrep"
...
The latest version of grep claims the egrep is now obsolete so the build
now contains warnings that look like:
egrep: warning: egrep is obsolescent; using grep -E
fix this up by moving the related file to use "grep -E" instead.
sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/perf`
Here are the steps to install the latest grep:
wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz
tar xf grep-3.8.tar.gz
cd grep-3.8 && ./configure && make
sudo make install
export PATH=/usr/local/bin:$PATH
Signed-off-by: Tiezhu Yang <[email protected] >
Acked-by: Ian Rogers <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-12-14 15:28:19 -03:00
Ian Rogers
0c361c6eab
perf test: Stat test for repeat with a weak group
...
Breaking a weak group requires multiple passes of an evlist, with
multiple runs this can introduce bugs ultimately leading to
segfaults. Add a test to cover this.
Signed-off-by: Ian Rogers <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-08-27 11:55:17 -03:00
Ian Rogers
0dd9769f0c
perf stat: Add stat record+report test
...
This would have caught:
"Subject: Re: perf stat report segfaults"
https://lore.kernel.org/linux-perf-users/CAP-5=fWQR=sCuiSMktvUtcbOLidEpUJLCybVF6=BRvORcDOq+g@mail.gmail.com/
Signed-off-by: Ian Rogers <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexei Starovoitov <[email protected] >
Cc: Andrii Nakryiko <[email protected] >
Cc: Daniel Borkmann <[email protected] >
Cc: Dave Marchevsky <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Fastabend <[email protected] >
Cc: KP Singh <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Lv Ruyi <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Martin KaFai Lau <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Quentin Monnet <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Xing Zhengjun <[email protected] >
Cc: Yonghong Song <[email protected] >
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-05-23 09:51:55 -03:00
Ian Rogers
6a973e2919
perf test: Add basic stat and topdown group test
...
Add a basic stat test.
Add two tests of grouping behavior for topdown events. Topdown events
are special as they must be grouped with the slots event first.
Reviewed-by: Kan Liang <[email protected] >
Signed-off-by: Ian Rogers <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Florian Fischer <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Kim Phillips <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Riccardo Mancini <[email protected] >
Cc: Shunsuke Nakamura <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Xing Zhengjun <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-05-17 12:02:30 -03:00