File perf-tests-attr-Add-missing-topdown-metrics-events.patch of Package perf
xxxxxxxxxx
1
From: Kan Liang <kan.liang@linux.intel.com>
2
Date: Thu, 30 Sep 2021 12:52:46 -0700
3
Subject: perf tests attr: Add missing topdown metrics events
4
Git-commit: 0b6c5371c03c2b17963e1abd7ed0e3f1f950cba9
5
Patch-mainline: v5.15-rc5
6
References: git-fixes
7
8
The Topdown metrics events were added as 'perf stat' default events
9
since commit 42641d6f4d15e6db ("perf stat: Add Topdown metrics events as
10
default events").
11
12
However, the perf attr tests were not updated
13
accordingly.
14
15
The perf attr test fails on the platform which supports Topdown metrics.
16
17
# perf test 17
18
19
17: Setup struct perf_event_attr :FAILED!
20
21
Add Topdown metrics events into perf attr test cases. Make them optional
22
since they are only available on newer platforms.
23
24
Fixes: 42641d6f4d15e6db ("perf stat: Add Topdown metrics events as default events")
25
Reported-by: kernel test robot <oliver.sang@intel.com>
26
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
27
Cc: Andi Kleen <ak@linux.intel.com>
28
Cc: Jiri Olsa <jolsa@redhat.com>
29
Link: http://lore.kernel.org/lkml/1633031566-176517-1-git-send-email-kan.liang@linux.intel.com
30
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
31
Signed-off-by: Tony Jones <tonyj@suse.de>
32
---
33
tools/perf/tests/attr/test-stat-default | 97 +++++++++++++++++++
34
tools/perf/tests/attr/test-stat-detailed-1 | 113 ++++++++++++++++++++--
35
tools/perf/tests/attr/test-stat-detailed-2 | 137 +++++++++++++++++++++++----
36
tools/perf/tests/attr/test-stat-detailed-3 | 145 ++++++++++++++++++++++++-----
37
4 files changed, 440 insertions(+), 52 deletions(-)
38
39
diff --git a/tools/perf/tests/attr/test-stat-default b/tools/perf/tests/attr/test-stat-default
40
index d9e99b3f77e6..d8ea6a88163f 100644
41
--- a/tools/perf/tests/attr/test-stat-default
42
+++ b/tools/perf/tests/attr/test-stat-default
43
44
type=0
45
config=5
46
optional=1
47
+
48
+# PERF_TYPE_RAW / slots (0x400)
49
+[event11:base-stat]
50
+fd=11
51
+group_fd=-1
52
+type=4
53
+config=1024
54
+read_format=15
55
+optional=1
56
+
57
+# PERF_TYPE_RAW / topdown-retiring (0x8000)
58
+[event12:base-stat]
59
+fd=12
60
+group_fd=11
61
+type=4
62
+config=32768
63
+disabled=0
64
+enable_on_exec=0
65
+read_format=15
66
+optional=1
67
+
68
+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
69
+[event13:base-stat]
70
+fd=13
71
+group_fd=11
72
+type=4
73
+config=33024
74
+disabled=0
75
+enable_on_exec=0
76
+read_format=15
77
+optional=1
78
+
79
+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
80
+[event14:base-stat]
81
+fd=14
82
+group_fd=11
83
+type=4
84
+config=33280
85
+disabled=0
86
+enable_on_exec=0
87
+read_format=15
88
+optional=1
89
+
90
+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
91
+[event15:base-stat]
92
+fd=15
93
+group_fd=11
94
+type=4
95
+config=33536
96
+disabled=0
97
+enable_on_exec=0
98
+read_format=15
99
+optional=1
100
+
101
+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
102
+[event16:base-stat]
103
+fd=16
104
+group_fd=11
105
+type=4
106
+config=33792
107
+disabled=0
108
+enable_on_exec=0
109
+read_format=15
110
+optional=1
111
+
112
+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
113
+[event17:base-stat]
114
+fd=17
115
+group_fd=11
116
+type=4
117
+config=34048
118
+disabled=0
119
+enable_on_exec=0
120
+read_format=15
121
+optional=1
122
+
123
+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
124
+[event18:base-stat]
125
+fd=18
126
+group_fd=11
127
+type=4
128
+config=34304
129
+disabled=0
130
+enable_on_exec=0
131
+read_format=15
132
+optional=1
133
+
134
+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
135
+[event19:base-stat]
136
+fd=19
137
+group_fd=11
138
+type=4
139
+config=34560
140
+disabled=0
141
+enable_on_exec=0
142
+read_format=15
143
+optional=1
144
diff --git a/tools/perf/tests/attr/test-stat-detailed-1 b/tools/perf/tests/attr/test-stat-detailed-1
145
index 8b04a055d154..b656ab93c5bf 100644
146
--- a/tools/perf/tests/attr/test-stat-detailed-1
147
+++ b/tools/perf/tests/attr/test-stat-detailed-1
148
149
config=5
150
optional=1
151
152
+# PERF_TYPE_RAW / slots (0x400)
153
+[event11:base-stat]
154
+fd=11
155
+group_fd=-1
156
+type=4
157
+config=1024
158
+read_format=15
159
+optional=1
160
+
161
+# PERF_TYPE_RAW / topdown-retiring (0x8000)
162
+[event12:base-stat]
163
+fd=12
164
+group_fd=11
165
+type=4
166
+config=32768
167
+disabled=0
168
+enable_on_exec=0
169
+read_format=15
170
+optional=1
171
+
172
+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
173
+[event13:base-stat]
174
+fd=13
175
+group_fd=11
176
+type=4
177
+config=33024
178
+disabled=0
179
+enable_on_exec=0
180
+read_format=15
181
+optional=1
182
+
183
+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
184
+[event14:base-stat]
185
+fd=14
186
+group_fd=11
187
+type=4
188
+config=33280
189
+disabled=0
190
+enable_on_exec=0
191
+read_format=15
192
+optional=1
193
+
194
+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
195
+[event15:base-stat]
196
+fd=15
197
+group_fd=11
198
+type=4
199
+config=33536
200
+disabled=0
201
+enable_on_exec=0
202
+read_format=15
203
+optional=1
204
+
205
+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
206
+[event16:base-stat]
207
+fd=16
208
+group_fd=11
209
+type=4
210
+config=33792
211
+disabled=0
212
+enable_on_exec=0
213
+read_format=15
214
+optional=1
215
+
216
+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
217
+[event17:base-stat]
218
+fd=17
219
+group_fd=11
220
+type=4
221
+config=34048
222
+disabled=0
223
+enable_on_exec=0
224
+read_format=15
225
+optional=1
226
+
227
+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
228
+[event18:base-stat]
229
+fd=18
230
+group_fd=11
231
+type=4
232
+config=34304
233
+disabled=0
234
+enable_on_exec=0
235
+read_format=15
236
+optional=1
237
+
238
+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
239
+[event19:base-stat]
240
+fd=19
241
+group_fd=11
242
+type=4
243
+config=34560
244
+disabled=0
245
+enable_on_exec=0
246
+read_format=15
247
+optional=1
248
+
249
# PERF_TYPE_HW_CACHE /
250
# PERF_COUNT_HW_CACHE_L1D << 0 |
251
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
252
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
253
-[event11:base-stat]
254
-fd=11
255
+[event20:base-stat]
256
+fd=20
257
type=3
258
config=0
259
optional=1
260
261
# PERF_COUNT_HW_CACHE_L1D << 0 |
262
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
263
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
264
-[event12:base-stat]
265
-fd=12
266
+[event21:base-stat]
267
+fd=21
268
type=3
269
config=65536
270
optional=1
271
272
# PERF_COUNT_HW_CACHE_LL << 0 |
273
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
274
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
275
-[event13:base-stat]
276
-fd=13
277
+[event22:base-stat]
278
+fd=22
279
type=3
280
config=2
281
optional=1
282
283
# PERF_COUNT_HW_CACHE_LL << 0 |
284
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
285
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
286
-[event14:base-stat]
287
-fd=14
288
+[event23:base-stat]
289
+fd=23
290
type=3
291
config=65538
292
optional=1
293
diff --git a/tools/perf/tests/attr/test-stat-detailed-2 b/tools/perf/tests/attr/test-stat-detailed-2
294
index 4fca9f1bfbf8..97625090a1c4 100644
295
--- a/tools/perf/tests/attr/test-stat-detailed-2
296
+++ b/tools/perf/tests/attr/test-stat-detailed-2
297
298
config=5
299
optional=1
300
301
+# PERF_TYPE_RAW / slots (0x400)
302
+[event11:base-stat]
303
+fd=11
304
+group_fd=-1
305
+type=4
306
+config=1024
307
+read_format=15
308
+optional=1
309
+
310
+# PERF_TYPE_RAW / topdown-retiring (0x8000)
311
+[event12:base-stat]
312
+fd=12
313
+group_fd=11
314
+type=4
315
+config=32768
316
+disabled=0
317
+enable_on_exec=0
318
+read_format=15
319
+optional=1
320
+
321
+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
322
+[event13:base-stat]
323
+fd=13
324
+group_fd=11
325
+type=4
326
+config=33024
327
+disabled=0
328
+enable_on_exec=0
329
+read_format=15
330
+optional=1
331
+
332
+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
333
+[event14:base-stat]
334
+fd=14
335
+group_fd=11
336
+type=4
337
+config=33280
338
+disabled=0
339
+enable_on_exec=0
340
+read_format=15
341
+optional=1
342
+
343
+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
344
+[event15:base-stat]
345
+fd=15
346
+group_fd=11
347
+type=4
348
+config=33536
349
+disabled=0
350
+enable_on_exec=0
351
+read_format=15
352
+optional=1
353
+
354
+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
355
+[event16:base-stat]
356
+fd=16
357
+group_fd=11
358
+type=4
359
+config=33792
360
+disabled=0
361
+enable_on_exec=0
362
+read_format=15
363
+optional=1
364
+
365
+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
366
+[event17:base-stat]
367
+fd=17
368
+group_fd=11
369
+type=4
370
+config=34048
371
+disabled=0
372
+enable_on_exec=0
373
+read_format=15
374
+optional=1
375
+
376
+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
377
+[event18:base-stat]
378
+fd=18
379
+group_fd=11
380
+type=4
381
+config=34304
382
+disabled=0
383
+enable_on_exec=0
384
+read_format=15
385
+optional=1
386
+
387
+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
388
+[event19:base-stat]
389
+fd=19
390
+group_fd=11
391
+type=4
392
+config=34560
393
+disabled=0
394
+enable_on_exec=0
395
+read_format=15
396
+optional=1
397
+
398
# PERF_TYPE_HW_CACHE /
399
# PERF_COUNT_HW_CACHE_L1D << 0 |
400
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
401
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
402
-[event11:base-stat]
403
-fd=11
404
+[event20:base-stat]
405
+fd=20
406
type=3
407
config=0
408
optional=1
409
410
# PERF_COUNT_HW_CACHE_L1D << 0 |
411
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
412
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
413
-[event12:base-stat]
414
-fd=12
415
+[event21:base-stat]
416
+fd=21
417
type=3
418
config=65536
419
optional=1
420
421
# PERF_COUNT_HW_CACHE_LL << 0 |
422
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
423
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
424
-[event13:base-stat]
425
-fd=13
426
+[event22:base-stat]
427
+fd=22
428
type=3
429
config=2
430
optional=1
431
432
# PERF_COUNT_HW_CACHE_LL << 0 |
433
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
434
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
435
-[event14:base-stat]
436
-fd=14
437
+[event23:base-stat]
438
+fd=23
439
type=3
440
config=65538
441
optional=1
442
443
# PERF_COUNT_HW_CACHE_L1I << 0 |
444
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
445
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
446
-[event15:base-stat]
447
-fd=15
448
+[event24:base-stat]
449
+fd=24
450
type=3
451
config=1
452
optional=1
453
454
# PERF_COUNT_HW_CACHE_L1I << 0 |
455
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
456
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
457
-[event16:base-stat]
458
-fd=16
459
+[event25:base-stat]
460
+fd=25
461
type=3
462
config=65537
463
optional=1
464
465
# PERF_COUNT_HW_CACHE_DTLB << 0 |
466
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
467
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
468
-[event17:base-stat]
469
-fd=17
470
+[event26:base-stat]
471
+fd=26
472
type=3
473
config=3
474
optional=1
475
476
# PERF_COUNT_HW_CACHE_DTLB << 0 |
477
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
478
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
479
-[event18:base-stat]
480
-fd=18
481
+[event27:base-stat]
482
+fd=27
483
type=3
484
config=65539
485
optional=1
486
487
# PERF_COUNT_HW_CACHE_ITLB << 0 |
488
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
489
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
490
-[event19:base-stat]
491
-fd=19
492
+[event28:base-stat]
493
+fd=28
494
type=3
495
config=4
496
optional=1
497
498
# PERF_COUNT_HW_CACHE_ITLB << 0 |
499
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
500
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
501
-[event20:base-stat]
502
-fd=20
503
+[event29:base-stat]
504
+fd=29
505
type=3
506
config=65540
507
optional=1
508
diff --git a/tools/perf/tests/attr/test-stat-detailed-3 b/tools/perf/tests/attr/test-stat-detailed-3
509
index 4bb58e1c82a6..d555042e3fbf 100644
510
--- a/tools/perf/tests/attr/test-stat-detailed-3
511
+++ b/tools/perf/tests/attr/test-stat-detailed-3
512
513
config=5
514
optional=1
515
516
+# PERF_TYPE_RAW / slots (0x400)
517
+[event11:base-stat]
518
+fd=11
519
+group_fd=-1
520
+type=4
521
+config=1024
522
+read_format=15
523
+optional=1
524
+
525
+# PERF_TYPE_RAW / topdown-retiring (0x8000)
526
+[event12:base-stat]
527
+fd=12
528
+group_fd=11
529
+type=4
530
+config=32768
531
+disabled=0
532
+enable_on_exec=0
533
+read_format=15
534
+optional=1
535
+
536
+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
537
+[event13:base-stat]
538
+fd=13
539
+group_fd=11
540
+type=4
541
+config=33024
542
+disabled=0
543
+enable_on_exec=0
544
+read_format=15
545
+optional=1
546
+
547
+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
548
+[event14:base-stat]
549
+fd=14
550
+group_fd=11
551
+type=4
552
+config=33280
553
+disabled=0
554
+enable_on_exec=0
555
+read_format=15
556
+optional=1
557
+
558
+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
559
+[event15:base-stat]
560
+fd=15
561
+group_fd=11
562
+type=4
563
+config=33536
564
+disabled=0
565
+enable_on_exec=0
566
+read_format=15
567
+optional=1
568
+
569
+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
570
+[event16:base-stat]
571
+fd=16
572
+group_fd=11
573
+type=4
574
+config=33792
575
+disabled=0
576
+enable_on_exec=0
577
+read_format=15
578
+optional=1
579
+
580
+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
581
+[event17:base-stat]
582
+fd=17
583
+group_fd=11
584
+type=4
585
+config=34048
586
+disabled=0
587
+enable_on_exec=0
588
+read_format=15
589
+optional=1
590
+
591
+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
592
+[event18:base-stat]
593
+fd=18
594
+group_fd=11
595
+type=4
596
+config=34304
597
+disabled=0
598
+enable_on_exec=0
599
+read_format=15
600
+optional=1
601
+
602
+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
603
+[event19:base-stat]
604
+fd=19
605
+group_fd=11
606
+type=4
607
+config=34560
608
+disabled=0
609
+enable_on_exec=0
610
+read_format=15
611
+optional=1
612
+
613
# PERF_TYPE_HW_CACHE /
614
# PERF_COUNT_HW_CACHE_L1D << 0 |
615
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
616
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
617
-[event11:base-stat]
618
-fd=11
619
+[event20:base-stat]
620
+fd=20
621
type=3
622
config=0
623
optional=1
624
625
# PERF_COUNT_HW_CACHE_L1D << 0 |
626
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
627
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
628
-[event12:base-stat]
629
-fd=12
630
+[event21:base-stat]
631
+fd=21
632
type=3
633
config=65536
634
optional=1
635
636
# PERF_COUNT_HW_CACHE_LL << 0 |
637
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
638
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
639
-[event13:base-stat]
640
-fd=13
641
+[event22:base-stat]
642
+fd=22
643
type=3
644
config=2
645
optional=1
646
647
# PERF_COUNT_HW_CACHE_LL << 0 |
648
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
649
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
650
-[event14:base-stat]
651
-fd=14
652
+[event23:base-stat]
653
+fd=23
654
type=3
655
config=65538
656
optional=1
657
658
# PERF_COUNT_HW_CACHE_L1I << 0 |
659
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
660
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
661
-[event15:base-stat]
662
-fd=15
663
+[event24:base-stat]
664
+fd=24
665
type=3
666
config=1
667
optional=1
668
669
# PERF_COUNT_HW_CACHE_L1I << 0 |
670
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
671
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
672
-[event16:base-stat]
673
-fd=16
674
+[event25:base-stat]
675
+fd=25
676
type=3
677
config=65537
678
optional=1
679
680
# PERF_COUNT_HW_CACHE_DTLB << 0 |
681
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
682
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
683
-[event17:base-stat]
684
-fd=17
685
+[event26:base-stat]
686
+fd=26
687
type=3
688
config=3
689
optional=1
690
691
# PERF_COUNT_HW_CACHE_DTLB << 0 |
692
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
693
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
694
-[event18:base-stat]
695
-fd=18
696
+[event27:base-stat]
697
+fd=27
698
type=3
699
config=65539
700
optional=1
701
702
# PERF_COUNT_HW_CACHE_ITLB << 0 |
703
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
704
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
705
-[event19:base-stat]
706
-fd=19
707
+[event28:base-stat]
708
+fd=28
709
type=3
710
config=4
711
optional=1
712
713
# PERF_COUNT_HW_CACHE_ITLB << 0 |
714
# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
715
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
716
-[event20:base-stat]
717
-fd=20
718
+[event29:base-stat]
719
+fd=29
720
type=3
721
config=65540
722
optional=1
723
724
# PERF_COUNT_HW_CACHE_L1D << 0 |
725
# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
726
# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
727
-[event21:base-stat]
728
-fd=21
729
+[event30:base-stat]
730
+fd=30
731
type=3
732
config=512
733
optional=1
734
735
# PERF_COUNT_HW_CACHE_L1D << 0 |
736
# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
737
# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
738
-[event22:base-stat]
739
-fd=22
740
+[event31:base-stat]
741
+fd=31
742
type=3
743
config=66048
744
optional=1
745
746