Directory Files
.. 114
File Size
README 4.2 kB
base-record 572 B
base-record-spe 510 B
base-stat 559 B
base-stat-group 871 B
system-wide-dummy 859 B
test-record-C0 439 B
test-record-basic 105 B
test-record-branch-any 146 B
test-record-branch-filter-any 150 B
test-record-branch-filter-any_call 156 B
test-record-branch-filter-any_ret 155 B
test-record-branch-filter-hv 149 B
test-record-branch-filter-ind_call 156 B
test-record-branch-filter-k 148 B
test-record-branch-filter-u 148 B
test-record-count 151 B
test-record-data 271 B
test-record-dummy-C0 818 B
test-record-freq 130 B
test-record-graph-default 194 B
test-record-graph-default-aarch64 171 B
test-record-graph-dwarf 280 B
test-record-graph-fp 193 B
test-record-graph-fp-aarch64 184 B
test-record-group-sampling 709 B
test-record-group-sampling1 997 B
test-record-group-sampling2 1.1 kB
test-record-group1 367 B
test-record-group2 504 B
test-record-group3 515 B
test-record-no-buffering 164 B
test-record-no-inherit 134 B
test-record-no-samples 124 B
test-record-period 140 B
test-record-pfm-period 188 B
test-record-raw 125 B
test-record-spe-period 217 B
test-record-spe-period-term 220 B
test-record-spe-physical-address 291 B
test-record-user-regs-no-sve-aarch64 311 B
test-record-user-regs-old-sve-aarch64 307 B
test-record-user-regs-sve-aarch64 367 B
test-stat-C0 214 B
test-stat-basic 127 B
test-stat-default 4.3 kB
test-stat-detailed-1 5.3 kB
test-stat-detailed-2 6.7 kB
test-stat-detailed-3 7.2 kB
test-stat-group1 286 B
test-stat-no-inherit 140 B

Linux v7.4-rc3 - attr

The struct perf_event_attr test (attr tests) support
====================================================
This testing support is embedded into perf directly and is governed
by the PERF_TEST_ATTR environment variable and hook inside the
sys_perf_event_open function.

The general idea is to store 'struct perf_event_attr' details for
each event created within single perf command. Each event details
are stored into separate text file. Once perf command is finished
these files are checked for values we expect for command.

The attr tests consist of following parts:

tests/attr.c
------------
This is the sys_perf_event_open hook implementation. The hook
is triggered when the PERF_TEST_ATTR environment variable is
defined. It must contain name of existing directory with access
and write permissions.

For each sys_perf_event_open call event details are stored in
separate file. Besides 'struct perf_event_attr' values we also
store 'fd' and 'group_fd' values to allow checking for groups.

tests/attr.py
-------------
This is the python script that does all the hard work. It reads
the test definition, executes it and checks results.

tests/attr/
-----------
Directory containing all attr test definitions.
Following tests are defined (with perf commands):

  perf record kill                              (test-record-basic)
  perf record -b kill                           (test-record-branch-any)
  perf record -j any kill                       (test-record-branch-filter-any)
  perf record -j any_call kill                  (test-record-branch-filter-any_call)
  perf record -j any_ret kill                   (test-record-branch-filter-any_ret)
  perf record -j hv kill                        (test-record-branch-filter-hv)
  perf record -j ind_call kill                  (test-record-branch-filter-ind_call)
  perf record -j k kill                         (test-record-branch-filter-k)
  perf record -j u kill                         (test-record-branch-filter-u)
  perf record -c 123 kill                       (test-record-count)
  perf record -d kill                           (test-record-data)
  perf record -F 100 kill                       (test-record-freq)
  perf record -g kill                           (test-record-graph-default)
  perf record -g kill                           (test-record-graph-default-aarch64)
  perf record --call-graph dwarf kill		(test-record-graph-dwarf)
  perf record --call-graph fp kill              (test-record-graph-fp)
  perf record --call-graph fp kill              (test-record-graph-fp-aarch64)
  perf record -e '{cycles,default_core/legacy-hardware-config=1/}' kill (test-record-group1)
  perf record -e '{cycles/period=1234000/,default_core/legacy-hardware-config=1,period=6789000/}:S' kill (test-record-group2)
  perf record -e '{cycles,default_core/legacy-hardware-config=3/}:S' kill (test-record-group-sampling1)
  perf record -c 10000 -e '{cycles,default_core/legacy-hardware-config=3/}:S' kill (test-record-group-sampling2)
  perf record -D kill                           (test-record-no-delay)
  perf record -i kill                           (test-record-no-inherit)
  perf record -n kill                           (test-record-no-samples)
  perf record -c 100 -P kill                    (test-record-period)
  perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period)
  perf record -R kill                           (test-record-raw)
  perf record -c 2 -e arm_spe_0// -- kill       (test-record-spe-period)
  perf record -e arm_spe_0/period=3/ -- kill    (test-record-spe-period-term)
  perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
  perf stat -e cycles kill                      (test-stat-basic)
  perf stat kill                                (test-stat-default)
  perf stat -d kill                             (test-stat-detailed-1)
  perf stat -dd kill                            (test-stat-detailed-2)
  perf stat -ddd kill                           (test-stat-detailed-3)
  perf stat -e '{cycles,default_core/legacy-hardware-config=1/}' kill (test-stat-group1)
  perf stat -i -e cycles kill                   (test-stat-no-inherit)