-
Notifications
You must be signed in to change notification settings - Fork 51
/
run_tests.sh
executable file
·540 lines (505 loc) · 15.1 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
#!/bin/sh
cd $(dirname $0)
PERF_EVENT_ROOT=${PWD}
export TESTS_QUIET=y
export TESTS_DIR=${PERF_EVENT_ROOT}/tests
echo
echo "**** RUNNING perf_event_tests ****"
uname -a
echo
echo "* Testing /proc/sys/kernel/perf_event_paranoid setting"
echo " + tests/utils/check_paranoid"
echo -n " "
$TESTS_DIR/utils/check_paranoid
if [ "$?" -ne "0" ]; then
echo
echo "*** PARANOID VALUE TOO HIGH, EXITING EARLY ***"
echo
exit;
fi
echo
echo "* Checking infrastructure"
echo " + tests/utils/get_cache_info"
echo -n " "
$TESTS_DIR/utils/get_cache_info
echo " + tests/sysfs/events"
echo -n " "
$TESTS_DIR/sysfs/events
echo
echo "* Checking generalized events"
echo " + tests/generalized_events/branches"
echo -n " "
$TESTS_DIR/generalized_events/branches
echo " + tests/generalized_events/branch-misses"
echo -n " "
$TESTS_DIR/generalized_events/branch-misses
echo " + tests/generalized_events/cycles"
echo -n " "
$TESTS_DIR/generalized_events/cycles
echo " + tests/generalized_events/instructions"
echo -n " "
$TESTS_DIR/generalized_events/instructions
echo " + tests/generalized_events/l1-dcache-stores"
echo -n " "
$TESTS_DIR/generalized_events/l1-dcache-stores
echo " + tests/generalized_events/l1-dcache-loads"
echo -n " "
$TESTS_DIR/generalized_events/l1-dcache-loads
arch="$(uname -m)"
case "$arch"
in x86|x86_64)
echo
echo "* Checking Intel x86 specific features"
echo " + tests/x86_intel/fixed_ctr0"
echo -n " "
$TESTS_DIR/x86_intel/fixed_ctr0
echo " + tests/x86_intel/fixed_ctr1"
echo -n " "
$TESTS_DIR/x86_intel/fixed_ctr1
echo " + tests/x86_intel/fixed_ctr2"
echo -n " "
$TESTS_DIR/x86_intel/fixed_ctr2
echo " + tests/x86_intel/offcore_response"
echo -n " "
$TESTS_DIR/x86_intel/offcore_response
echo " + tests/x86_intel/offcore_response_mask"
echo -n " "
$TESTS_DIR/x86_intel/offcore_response_mask
echo " + tests/x86_intel/uncore_events"
echo -n " "
$TESTS_DIR/x86_intel/uncore_events
;; s390x|s390)
:
esac
echo
echo "* Checking breakpoint support"
echo " + tests/breakpoints/breakpoint_support"
echo -n " "
$TESTS_DIR/breakpoints/breakpoint_support
echo
echo "* Checking basic perf_event functionality"
echo " + tests/attr_fields/disabled"
echo -n " "
$TESTS_DIR/attr_fields/disabled
echo " + tests/attr_fields/exclusive"
echo -n " "
$TESTS_DIR/attr_fields/exclusive
echo " + tests/attr_fields/format_id_support"
echo -n " "
$TESTS_DIR/attr_fields/format_id_support
echo " + tests/attr_fields/inherit"
echo -n " "
$TESTS_DIR/attr_fields/inherit
echo " + tests/attr_fields/inherit_stat"
echo -n " "
$TESTS_DIR/attr_fields/inherit_stat
echo " + tests/attr_fields/pinned"
echo -n " "
$TESTS_DIR/attr_fields/pinned
echo " + tests/attr_fields/read_format_range_check"
echo -n " "
$TESTS_DIR/attr_fields/read_format_range_check
echo " + tests/attr_fields/sample_type_range_check"
echo -n " "
$TESTS_DIR/attr_fields/sample_type_range_check
echo " + tests/attr_fields/exclude_user"
echo -n " "
$TESTS_DIR/attr_fields/exclude_user
echo " + tests/attr_fields/exclude_kernel"
echo -n " "
$TESTS_DIR/attr_fields/exclude_kernel
echo " + tests/attr_fields/exclude_hv"
echo -n " "
$TESTS_DIR/attr_fields/exclude_hv
echo " + tests/attr_fields/exclude_idle"
echo -n " "
$TESTS_DIR/attr_fields/exclude_idle
echo " + tests/attr_fields/exclude_guest"
echo -n " "
$TESTS_DIR/attr_fields/exclude_guest
echo " + tests/attr_fields/exclude_host"
echo -n " "
$TESTS_DIR/attr_fields/exclude_host
echo " + tests/flags/flags_range_check"
echo -n " "
$TESTS_DIR/flags/flags_range_check
echo " + tests/flags/flags_cgroup"
echo -n " "
$TESTS_DIR/flags/flags_cgroup
echo " + tests/flags/flags_fd_no_group"
echo -n " "
$TESTS_DIR/flags/flags_fd_no_group
echo " + tests/flags/flags_fd_output"
echo -n " "
$TESTS_DIR/flags/flags_fd_output
echo " + tests/socket/socket_pass"
echo -n " "
$TESTS_DIR/socket/socket_pass
echo
echo "* Checking attr.size behavior"
echo " + tests/size/too_big"
echo -n " "
$TESTS_DIR/size/too_big
echo " + tests/size/too_little"
echo -n " "
$TESTS_DIR/size/too_little
echo " + tests/size/just_right"
echo -n " "
$TESTS_DIR/size/just_right
echo " + tests/size/header_mismatch"
echo -n " "
$TESTS_DIR/size/header_mismatch
echo
echo "* Checking perf_event ioctl calls"
echo " + tests/ioctl/ioctl_flag_group"
echo -n " "
$TESTS_DIR/ioctl/ioctl_flag_group
echo " + tests/ioctl/ioctl_0_enable"
echo -n " "
$TESTS_DIR/ioctl/ioctl_0_enable
echo " + tests/ioctl/ioctl_1_disable"
echo -n " "
$TESTS_DIR/ioctl/ioctl_1_disable
echo " + tests/ioctl/ioctl_2_refresh"
echo -n " "
$TESTS_DIR/ioctl/ioctl_2_refresh
echo " + tests/ioctl/ioctl_3_reset"
echo -n " "
$TESTS_DIR/ioctl/ioctl_3_reset
echo " + tests/ioctl/ioctl_4_period"
echo -n " "
$TESTS_DIR/ioctl/ioctl_4_period
echo " + tests/ioctl/ioctl_5_set_output"
echo -n " "
$TESTS_DIR/ioctl/ioctl_5_set_output
echo " + tests/ioctl/ioctl_6_set_filter"
echo -n " "
$TESTS_DIR/ioctl/ioctl_6_set_filter
echo " + tests/ioctl/ioctl_7_id"
echo -n " "
$TESTS_DIR/ioctl/ioctl_7_id
echo " + tests/ioctl/ioctl_8_set_bpf"
echo -n " "
$TESTS_DIR/ioctl/ioctl_8_set_bpf
echo " + tests/ioctl/ioctl_9_pause_output"
echo -n " "
$TESTS_DIR/ioctl/ioctl_9_pause_output
echo " + tests/ioctl/ioctl_10_query_bpf"
echo -n " "
$TESTS_DIR/ioctl/ioctl_10_query_bpf
echo " + tests/ioctl/ioctl_11_modify_attributes"
echo -n " "
$TESTS_DIR/ioctl/ioctl_11_modify_attributes
echo
echo "* Checking perf_event prctl calls"
echo " + tests/prctl/prctl"
echo -n " "
$TESTS_DIR/prctl/prctl
echo " + tests/prctl/prctl_child"
echo -n " "
$TESTS_DIR/prctl/prctl_child
echo " + tests/prctl/prctl_parent"
echo -n " "
$TESTS_DIR/prctl/prctl_parent
echo " + tests/prctl/prctl_inherit"
echo -n " "
$TESTS_DIR/prctl/prctl_inherit
echo " + tests/prctl/prctl_attach"
echo -n " "
$TESTS_DIR/prctl/prctl_attach
echo
echo "* Checking error returns"
echo " + tests/error_returns/e2big"
echo -n " "
$TESTS_DIR/error_returns/e2big
echo " + tests/error_returns/eacces"
echo -n " "
$TESTS_DIR/error_returns/eacces
echo " + tests/error_returns/ebadf"
echo -n " "
$TESTS_DIR/error_returns/ebadf
echo " + tests/error_returns/efault"
echo -n " "
$TESTS_DIR/error_returns/efault
echo " + tests/error_returns/einval"
echo -n " "
$TESTS_DIR/error_returns/einval
echo " + tests/error_returns/emfile"
echo -n " "
$TESTS_DIR/error_returns/emfile
echo " + tests/error_returns/enoent"
echo -n " "
$TESTS_DIR/error_returns/enoent
echo " + tests/error_returns/enospc"
echo -n " "
$TESTS_DIR/error_returns/enospc
echo " + tests/error_returns/eopnotsupp"
echo -n " "
$TESTS_DIR/error_returns/eopnotsupp
echo " + tests/error_returns/eoverflow"
echo -n " "
$TESTS_DIR/error_returns/eoverflow
echo " + tests/error_returns/eperm"
echo -n " "
$TESTS_DIR/error_returns/eperm
echo " + tests/error_returns/esrch"
echo -n " "
$TESTS_DIR/error_returns/esrch
echo " + tests/error_returns/non-existent"
echo -n " "
$TESTS_DIR/error_returns/non-existent
echo
echo "* Checking multithread functionality"
echo " + tests/multithread/fork_then_read"
echo -n " "
$TESTS_DIR/multithread/fork_then_read
echo
echo "* Checking overflow functionality"
echo " + tests/overflow/breakpoint_overflow"
echo -n " "
$TESTS_DIR/overflow/breakpoint_overflow
echo " + tests/overflow/simple_overflow_leader"
echo -n " "
$TESTS_DIR/overflow/simple_overflow_leader
echo " + tests/overflow/simple_overflow_sibling"
echo -n " "
$TESTS_DIR/overflow/simple_overflow_sibling
echo " + tests/overflow/simultaneous_overflow"
echo -n " "
$TESTS_DIR/overflow/simultaneous_overflow
echo " + tests/overflow/simultaneous_group_overflow"
echo -n " "
$TESTS_DIR/overflow/simultaneous_group_overflow
echo " + tests/overflow/simul_oneshot_group_overflow"
echo -n " "
$TESTS_DIR/overflow/simul_oneshot_group_overflow
echo " + tests/overflow/single_shot_overflow"
echo -n " "
$TESTS_DIR/overflow/single_shot_overflow
echo " + tests/overflow/single_shot_w_enable"
echo -n " "
$TESTS_DIR/overflow/single_shot_w_enable
echo " + tests/overflow/wakeup_events_overflow"
echo -n " "
$TESTS_DIR/overflow/wakeup_events_overflow
echo " + tests/overflow/overflow_requires_wakeup"
echo -n " "
$TESTS_DIR/overflow/overflow_requires_wakeup
echo " + tests/overflow/overflow_poll"
echo -n " "
$TESTS_DIR/overflow/overflow_poll
echo " + tests/overflow/overflow_large"
echo -n " "
$TESTS_DIR/overflow/overflow_large
echo " + tests/overflow/overflow_skid"
echo -n " "
$TESTS_DIR/overflow/overflow_skid
echo
echo "* Checking tracepoint functionality"
echo " + tests/tracepoints/tracepoint_alias"
echo -n " "
$TESTS_DIR/tracepoints/tracepoint_alias
echo
echo "* Checking mmap record sample functionality"
echo " + tests/record_sample/print_record_sample"
echo -n " "
$TESTS_DIR/record_sample/print_record_sample
echo " + tests/record_sample/validate_record_sample"
echo -n " "
$TESTS_DIR/record_sample/validate_record_sample
echo " + tests/record_sample/lost_record_sample"
echo -n " "
$TESTS_DIR/record_sample/lost_record_sample
echo " + tests/record_sample/multiple_mmap_sizes"
echo -n " "
$TESTS_DIR/record_sample/multiple_mmap_sizes
echo " + tests/record_sample/sample_branch_stack"
echo -n " "
$TESTS_DIR/record_sample/sample_branch_stack
echo " + tests/record_sample/record_comm"
echo -n " "
$TESTS_DIR/record_sample/record_comm
echo " + tests/record_sample/record_comm_exec"
echo -n " "
$TESTS_DIR/record_sample/record_comm_exec
echo " + tests/record_sample/record_fork"
echo -n " "
$TESTS_DIR/record_sample/record_fork
echo " + tests/record_sample/record_mmap"
echo -n " "
$TESTS_DIR/record_sample/record_mmap
echo " + tests/record_sample/record_mmap2"
echo -n " "
$TESTS_DIR/record_sample/record_mmap2
echo " + tests/record_sample/record_mmap_data"
echo -n " "
$TESTS_DIR/record_sample/record_mmap_data
echo " + tests/record_sample/sample_data_src"
echo -n " "
$TESTS_DIR/record_sample/sample_data_src
echo " + tests/record_sample/sample_regs_intr"
echo -n " "
$TESTS_DIR/record_sample/sample_regs_intr
echo " + tests/record_sample/sample_regs_user"
echo -n " "
$TESTS_DIR/record_sample/sample_regs_user
echo " + tests/record_sample/sample_stack_user"
echo -n " "
$TESTS_DIR/record_sample/sample_stack_user
echo " + tests/record_sample/sample_weight"
echo -n " "
$TESTS_DIR/record_sample/sample_weight
echo " + tests/record_sample/overwrite_mmap"
echo -n " "
$TESTS_DIR/record_sample/overwrite_mmap
echo " + tests/record_sample/mmap_multiple"
echo -n " "
$TESTS_DIR/record_sample/mmap_multiple
echo
echo "* Checking bugs that PAPI has to work around"
echo " + tests/bugs/sync_read_required"
echo -n " "
$TESTS_DIR/bugs/sync_read_required
echo " + tests/bugs/read_group_attached"
echo -n " "
$TESTS_DIR/bugs/read_group_attached
echo " + tests/bugs/check_schedulability"
echo -n " "
$TESTS_DIR/bugs/check_schedulability
echo " + tests/multiplexing/check_papi_multiplexing"
echo -n " "
$TESTS_DIR/multiplexing/check_papi_multiplexing
echo " + tests/multiplexing/check_multiplexing"
echo -n " "
$TESTS_DIR/multiplexing/check_multiplexing
echo
echo "* Checking other bugs"
echo " + tests/corner_cases/sw_start_leader"
echo -n " "
$TESTS_DIR/corner_cases/sw_start_leader
echo " + tests/corner_cases/hw_sw_mix"
echo -n " "
$TESTS_DIR/corner_cases/hw_sw_mix
echo " + tests/bugs/peo_zero_return"
echo -n " "
$TESTS_DIR/bugs/peo_zero_return
echo
echo "* Checking bugs that can silently produce wrong results"
echo " + tests/constraints/check_constraints"
echo -n " "
$TESTS_DIR/constraints/check_constraints
echo " + tests/corner_cases/context_switch_user_kernel"
echo -n " "
$TESTS_DIR/corner_cases/context_switch_user_kernel
echo
echo "* Checking interfaces that have changed over the years"
echo " + tests/corner_cases/overflow_requires_mmap"
echo -n " "
$TESTS_DIR/corner_cases/overflow_requires_mmap
echo " + tests/corner_cases/signal_after_exec"
echo -n " "
$TESTS_DIR/corner_cases/signal_after_exec
echo " + tests/corner_cases/sampled_notleader_refresh"
echo -n " "
$TESTS_DIR/corner_cases/sampled_notleader_refresh
echo
echo "* Checking for corner-cases in the ABI (not necessarily bugs)"
echo " + tests/corner_cases/multiple_active"
echo -n " "
$TESTS_DIR/corner_cases/multiple_active
echo " + tests/corner_cases/max_num_events"
echo -n " "
$TESTS_DIR/corner_cases/max_num_events
echo " + tests/corner_cases/max_multiplex"
echo -n " "
$TESTS_DIR/corner_cases/max_multiplex
echo " + tests/corner_cases/reset_leader"
echo -n " "
$TESTS_DIR/corner_cases/reset_leader
echo " + tests/corner_cases/check_reset_mpx"
echo -n " "
$TESTS_DIR/corner_cases/check_reset_mpx
echo " + tests/corner_cases/huge_events_start"
echo -n " "
$TESTS_DIR/corner_cases/huge_events_start
echo " + tests/corner_cases/huge_group_start"
echo -n " "
$TESTS_DIR/corner_cases/huge_group_start
echo " + tests/corner_cases/signal_after_close"
echo -n " "
$TESTS_DIR/corner_cases/signal_after_close
echo
echo "* Checking for fast RDPMC support"
echo " + tests/rdpmc/rdpmc_support"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_support
echo " + tests/rdpmc/rdpmc_validation"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_validation
echo " + tests/rdpmc/rdpmc_multiplexing"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_multiplexing
echo " + tests/rdpmc/rdpmc_reset"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_reset
echo " + tests/rdpmc/rdpmc_group"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_group
echo " + tests/rdpmc/rdpmc_attach"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_attach
echo " + tests/rdpmc/rdpmc_attach_cpu"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_attach_cpu
echo " + tests/rdpmc/rdpmc_attach_global_cpu"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_attach_global_cpu
echo " + tests/rdpmc/rdpmc_attach_other_cpu"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_attach_other_cpu
echo " + tests/rdpmc/rdpmc_multiattach"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_multiattach
echo " + tests/rdpmc/rdpmc_multiattach_papi"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_multiattach_papi
echo " + tests/rdpmc/rdpmc_pthreads"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_pthreads
echo " + tests/rdpmc/rdpmc_pthreads_group"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_pthreads_group
echo " + tests/rdpmc/rdpmc_attach_multi_enable"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_attach_multi_enable
echo " + tests/rdpmc/rdpmc_exec"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_exec
echo " + tests/rdpmc/rdpmc_exec_papi"
echo -n " "
$TESTS_DIR/rdpmc/rdpmc_exec_papi
echo
echo "* Checking OpenMP support"
echo " + tests/openmp/openmp_test"
echo -n " "
$TESTS_DIR/openmp/openmp_test
echo " + tests/openmp/openmp_overflow"
echo -n " "
$TESTS_DIR/openmp/openmp_overflow
echo " + tests/openmp/openmp_sample"
echo -n " "
$TESTS_DIR/openmp/openmp_sample
echo
echo "* Checking proposed interface updates (not in any released kernel)"
echo " + tests/corner_cases/ioctl_refresh_0"
echo -n " "
$TESTS_DIR/corner_cases/ioctl_refresh_0
echo " + tests/corner_cases/wrong_size_enospc"
echo -n " "
$TESTS_DIR/corner_cases/wrong_size_enospc
echo
echo "* Checking for major bugs that are unlikely to ever be fixed"
echo " + tests/bugs/nmi_watchdog_group_leader"
echo -n " "
$TESTS_DIR/bugs/nmi_watchdog_group_leader
echo