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