Name Date Size #Lines LOC

..--

READMEH A D21-Feb-20233.8 KiB7062

base-recordH A D15-Jul-2024572 4241

base-record-speH A D14-Dec-2022510 4140

base-statH A D31-Aug-2023559 4241

system-wide-dummyH A D15-Jul-2024859 5352

test-record-C0H A D15-Jul-2024419 2317

test-record-basicH A D11-Jul-2019105 75

test-record-branch-anyH A D11-Jul-2019146 97

test-record-branch-filter-anyH A D11-Jul-2019150 97

test-record-branch-filter-any_callH A D11-Jul-2019156 97

test-record-branch-filter-any_retH A D11-Jul-2019155 97

test-record-branch-filter-hvH A D11-Jul-2019149 97

test-record-branch-filter-ind_callH A D11-Jul-2019156 97

test-record-branch-filter-kH A D11-Jul-2019148 97

test-record-branch-filter-uH A D11-Jul-2019148 97

test-record-countH A D11-Jul-2019151 108

test-record-dataH A D11-Jul-2019271 119

test-record-dummy-C0H A D15-Jul-2024818 5654

test-record-freqH A D11-Jul-2019130 86

test-record-graph-defaultH A D14-Dec-2022194 108

test-record-graph-default-aarch64H A D14-Dec-2022171 108

test-record-graph-dwarfH A D11-Jul-2019280 1311

test-record-graph-fpH A D14-Dec-2022193 108

test-record-graph-fp-aarch64H A D14-Dec-2022184 108

test-record-group-samplingH A D14-Dec-2022566 4032

test-record-group1H A D14-Dec-2022321 2421

test-record-group2H A D14-Dec-2022439 3027

test-record-no-bufferingH A D11-Jul-2019164 108

test-record-no-inheritH A D11-Jul-2019134 97

test-record-no-samplesH A D11-Jul-2019124 86

test-record-periodH A D11-Jul-2019140 97

test-record-pfm-periodH A D15-Dec-2020188 108

test-record-rawH A D11-Jul-2019125 86

test-record-spe-periodH A D14-Dec-2022217 1310

test-record-spe-period-termH A D14-Dec-2022220 1310

test-record-spe-physical-addressH A D14-Dec-2022291 1210

test-record-user-regs-no-sve-aarch64H A D15-Jul-2024311 109

test-record-user-regs-old-sve-aarch64H A D21-Feb-2023307 1110

test-record-user-regs-sve-aarch64H A D15-Jul-2024367 1513

test-stat-C0H A D05-Apr-2018194 119

test-stat-basicH A D05-Apr-2018107 86

test-stat-defaultH A D31-Aug-20232.7 KiB186162

test-stat-detailed-1H A D31-Aug-20233.6 KiB228198

test-stat-detailed-2H A D31-Aug-20234.9 KiB288252

test-stat-detailed-3H A D31-Aug-20235.4 KiB308270

test-stat-group1H A D05-Apr-2018240 1815

test-stat-no-inheritH A D05-Apr-2018120 97

README

1The struct perf_event_attr test (attr tests) support
2====================================================
3This testing support is embedded into perf directly and is governed
4by the PERF_TEST_ATTR environment variable and hook inside the
5sys_perf_event_open function.
6
7The general idea is to store 'struct perf_event_attr' details for
8each event created within single perf command. Each event details
9are stored into separate text file. Once perf command is finished
10these files are checked for values we expect for command.
11
12The attr tests consist of following parts:
13
14tests/attr.c
15------------
16This is the sys_perf_event_open hook implementation. The hook
17is triggered when the PERF_TEST_ATTR environment variable is
18defined. It must contain name of existing directory with access
19and write permissions.
20
21For each sys_perf_event_open call event details are stored in
22separate file. Besides 'struct perf_event_attr' values we also
23store 'fd' and 'group_fd' values to allow checking for groups.
24
25tests/attr.py
26-------------
27This is the python script that does all the hard work. It reads
28the test definition, executes it and checks results.
29
30tests/attr/
31-----------
32Directory containing all attr test definitions.
33Following tests are defined (with perf commands):
34
35  perf record kill                              (test-record-basic)
36  perf record -b kill                           (test-record-branch-any)
37  perf record -j any kill                       (test-record-branch-filter-any)
38  perf record -j any_call kill                  (test-record-branch-filter-any_call)
39  perf record -j any_ret kill                   (test-record-branch-filter-any_ret)
40  perf record -j hv kill                        (test-record-branch-filter-hv)
41  perf record -j ind_call kill                  (test-record-branch-filter-ind_call)
42  perf record -j k kill                         (test-record-branch-filter-k)
43  perf record -j u kill                         (test-record-branch-filter-u)
44  perf record -c 123 kill                       (test-record-count)
45  perf record -d kill                           (test-record-data)
46  perf record -F 100 kill                       (test-record-freq)
47  perf record -g kill                           (test-record-graph-default)
48  perf record -g kill                           (test-record-graph-default-aarch64)
49  perf record --call-graph dwarf kill		(test-record-graph-dwarf)
50  perf record --call-graph fp kill              (test-record-graph-fp)
51  perf record --call-graph fp kill              (test-record-graph-fp-aarch64)
52  perf record -e '{cycles,instructions}' kill   (test-record-group1)
53  perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
54  perf record -D kill                           (test-record-no-delay)
55  perf record -i kill                           (test-record-no-inherit)
56  perf record -n kill                           (test-record-no-samples)
57  perf record -c 100 -P kill                    (test-record-period)
58  perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period)
59  perf record -R kill                           (test-record-raw)
60  perf record -c 2 -e arm_spe_0// -- kill       (test-record-spe-period)
61  perf record -e arm_spe_0/period=3/ -- kill    (test-record-spe-period-term)
62  perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
63  perf stat -e cycles kill                      (test-stat-basic)
64  perf stat kill                                (test-stat-default)
65  perf stat -d kill                             (test-stat-detailed-1)
66  perf stat -dd kill                            (test-stat-detailed-2)
67  perf stat -ddd kill                           (test-stat-detailed-3)
68  perf stat -e '{cycles,instructions}' kill     (test-stat-group1)
69  perf stat -i -e cycles kill                   (test-stat-no-inherit)
70