• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

READMED13-Dec-20203.5 KiB6759

base-recordD13-Dec-2020565 4241

base-statD13-Dec-2020557 4241

system-wide-dummyD13-Dec-2020758 5150

test-record-C0D13-Dec-2020409 2317

test-record-basicD13-Dec-2020105 75

test-record-branch-anyD13-Dec-2020146 97

test-record-branch-filter-anyD13-Dec-2020150 97

test-record-branch-filter-any_callD13-Dec-2020156 97

test-record-branch-filter-any_retD13-Dec-2020155 97

test-record-branch-filter-hvD13-Dec-2020149 97

test-record-branch-filter-ind_callD13-Dec-2020156 97

test-record-branch-filter-kD13-Dec-2020148 97

test-record-branch-filter-uD13-Dec-2020148 97

test-record-countD13-Dec-2020151 108

test-record-dataD13-Dec-2020271 119

test-record-freqD13-Dec-2020130 86

test-record-graph-defaultD13-Dec-2020124 86

test-record-graph-dwarfD13-Dec-2020280 1311

test-record-graph-fpD13-Dec-2020137 86

test-record-groupD13-Dec-2020312 2320

test-record-group-samplingD13-Dec-2020540 4032

test-record-group1D13-Dec-2020315 2421

test-record-group2D13-Dec-2020433 3027

test-record-no-bufferingD13-Dec-2020164 108

test-record-no-inheritD13-Dec-2020134 97

test-record-no-samplesD13-Dec-2020124 86

test-record-periodD13-Dec-2020140 97

test-record-pfm-periodD13-Dec-2020188 108

test-record-rawD13-Dec-2020125 86

test-stat-C0D13-Dec-2020194 119

test-stat-basicD13-Dec-2020107 86

test-stat-defaultD13-Dec-20201 KiB7160

test-stat-detailed-1D13-Dec-20202 KiB11296

test-stat-detailed-2D13-Dec-20203.3 KiB172150

test-stat-detailed-3D13-Dec-20203.7 KiB192168

test-stat-groupD13-Dec-2020244 1815

test-stat-group1D13-Dec-2020240 1815

test-stat-no-inheritD13-Dec-2020120 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 --call-graph dwarf kill		(test-record-graph-dwarf)
49  perf record --call-graph fp kill              (test-record-graph-fp)
50  perf record --group -e cycles,instructions kill (test-record-group)
51  perf record -e '{cycles,instructions}' kill   (test-record-group1)
52  perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
53  perf record -D kill                           (test-record-no-delay)
54  perf record -i kill                           (test-record-no-inherit)
55  perf record -n kill                           (test-record-no-samples)
56  perf record -c 100 -P kill                    (test-record-period)
57  perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period)
58  perf record -R kill                           (test-record-raw)
59  perf stat -e cycles kill                      (test-stat-basic)
60  perf stat kill                                (test-stat-default)
61  perf stat -d kill                             (test-stat-detailed-1)
62  perf stat -dd kill                            (test-stat-detailed-2)
63  perf stat -ddd kill                           (test-stat-detailed-3)
64  perf stat --group -e cycles,instructions kill (test-stat-group)
65  perf stat -e '{cycles,instructions}' kill     (test-stat-group1)
66  perf stat -i -e cycles kill                   (test-stat-no-inherit)
67