0001 The struct perf_event_attr test (attr tests) support
0002 ====================================================
0003 This testing support is embedded into perf directly and is governed
0004 by the PERF_TEST_ATTR environment variable and hook inside the
0005 sys_perf_event_open function.
0006
0007 The general idea is to store 'struct perf_event_attr' details for
0008 each event created within single perf command. Each event details
0009 are stored into separate text file. Once perf command is finished
0010 these files are checked for values we expect for command.
0011
0012 The attr tests consist of following parts:
0013
0014 tests/attr.c
0015 ------------
0016 This is the sys_perf_event_open hook implementation. The hook
0017 is triggered when the PERF_TEST_ATTR environment variable is
0018 defined. It must contain name of existing directory with access
0019 and write permissions.
0020
0021 For each sys_perf_event_open call event details are stored in
0022 separate file. Besides 'struct perf_event_attr' values we also
0023 store 'fd' and 'group_fd' values to allow checking for groups.
0024
0025 tests/attr.py
0026 -------------
0027 This is the python script that does all the hard work. It reads
0028 the test definition, executes it and checks results.
0029
0030 tests/attr/
0031 -----------
0032 Directory containing all attr test definitions.
0033 Following tests are defined (with perf commands):
0034
0035 perf record kill (test-record-basic)
0036 perf record -b kill (test-record-branch-any)
0037 perf record -j any kill (test-record-branch-filter-any)
0038 perf record -j any_call kill (test-record-branch-filter-any_call)
0039 perf record -j any_ret kill (test-record-branch-filter-any_ret)
0040 perf record -j hv kill (test-record-branch-filter-hv)
0041 perf record -j ind_call kill (test-record-branch-filter-ind_call)
0042 perf record -j k kill (test-record-branch-filter-k)
0043 perf record -j u kill (test-record-branch-filter-u)
0044 perf record -c 123 kill (test-record-count)
0045 perf record -d kill (test-record-data)
0046 perf record -F 100 kill (test-record-freq)
0047 perf record -g kill (test-record-graph-default)
0048 perf record -g kill (test-record-graph-default-aarch64)
0049 perf record --call-graph dwarf kill (test-record-graph-dwarf)
0050 perf record --call-graph fp kill (test-record-graph-fp)
0051 perf record --call-graph fp kill (test-record-graph-fp-aarch64)
0052 perf record --group -e cycles,instructions kill (test-record-group)
0053 perf record -e '{cycles,instructions}' kill (test-record-group1)
0054 perf record -e '{cycles/period=1/,instructions/period=2/}:S' kill (test-record-group2)
0055 perf record -D kill (test-record-no-delay)
0056 perf record -i kill (test-record-no-inherit)
0057 perf record -n kill (test-record-no-samples)
0058 perf record -c 100 -P kill (test-record-period)
0059 perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period)
0060 perf record -R kill (test-record-raw)
0061 perf record -c 2 -e arm_spe_0// -- kill (test-record-spe-period)
0062 perf record -e arm_spe_0/period=3/ -- kill (test-record-spe-period-term)
0063 perf record -e arm_spe_0/pa_enable=1/ -- kill (test-record-spe-physical-address)
0064 perf stat -e cycles kill (test-stat-basic)
0065 perf stat kill (test-stat-default)
0066 perf stat -d kill (test-stat-detailed-1)
0067 perf stat -dd kill (test-stat-detailed-2)
0068 perf stat -ddd kill (test-stat-detailed-3)
0069 perf stat --group -e cycles,instructions kill (test-stat-group)
0070 perf stat -e '{cycles,instructions}' kill (test-stat-group1)
0071 perf stat -i -e cycles kill (test-stat-no-inherit)