Skip to content

Commit 8076dc8

Browse files
captain5050namhyung
authored andcommitted
perf vendor metrics intel: Make transaction metrics conditional
Make the transaction metrics conditional on the cycles-tx event being present. This event may not be present when TSX extensions have been disabled. Signed-off-by: Ian Rogers <[email protected]> Tested-by: Namhyung Kim <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Eduard Zingerman <[email protected]> Cc: Sohom Datta <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Caleb Biggers <[email protected]> Cc: Edward Baker <[email protected]> Cc: Perry Taylor <[email protected]> Cc: Samantha Alt <[email protected]> Cc: Weilin Wang <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Jing Zhang <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Kan Liang <[email protected]> Cc: Zhengjun Xing <[email protected]> Cc: John Garry <[email protected]> Cc: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent eadc004 commit 8076dc8

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

tools/perf/pmu-events/arch/x86/alderlake/adl-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,28 @@
9292
},
9393
{
9494
"BriefDescription": "Percentage of cycles in aborted transactions.",
95-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
95+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
9696
"MetricGroup": "transaction",
9797
"MetricName": "tsx_aborted_cycles",
9898
"ScaleUnit": "100%"
9999
},
100100
{
101101
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
102-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
102+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
103103
"MetricGroup": "transaction",
104104
"MetricName": "tsx_cycles_per_elision",
105105
"ScaleUnit": "1cycles / elision"
106106
},
107107
{
108108
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
109-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
109+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
110110
"MetricGroup": "transaction",
111111
"MetricName": "tsx_cycles_per_transaction",
112112
"ScaleUnit": "1cycles / transaction"
113113
},
114114
{
115115
"BriefDescription": "Percentage of cycles within a transaction region.",
116-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
116+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
117117
"MetricGroup": "transaction",
118118
"MetricName": "tsx_transactional_cycles",
119119
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/cascadelakex/clx-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,28 +1830,28 @@
18301830
},
18311831
{
18321832
"BriefDescription": "Percentage of cycles in aborted transactions.",
1833-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1833+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
18341834
"MetricGroup": "transaction",
18351835
"MetricName": "tsx_aborted_cycles",
18361836
"ScaleUnit": "100%"
18371837
},
18381838
{
18391839
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1840-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1840+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
18411841
"MetricGroup": "transaction",
18421842
"MetricName": "tsx_cycles_per_elision",
18431843
"ScaleUnit": "1cycles / elision"
18441844
},
18451845
{
18461846
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1847-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1847+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
18481848
"MetricGroup": "transaction",
18491849
"MetricName": "tsx_cycles_per_transaction",
18501850
"ScaleUnit": "1cycles / transaction"
18511851
},
18521852
{
18531853
"BriefDescription": "Percentage of cycles within a transaction region.",
1854-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1854+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
18551855
"MetricGroup": "transaction",
18561856
"MetricName": "tsx_transactional_cycles",
18571857
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/icelake/icl-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,28 +1516,28 @@
15161516
},
15171517
{
15181518
"BriefDescription": "Percentage of cycles in aborted transactions.",
1519-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1519+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
15201520
"MetricGroup": "transaction",
15211521
"MetricName": "tsx_aborted_cycles",
15221522
"ScaleUnit": "100%"
15231523
},
15241524
{
15251525
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1526-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1526+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
15271527
"MetricGroup": "transaction",
15281528
"MetricName": "tsx_cycles_per_elision",
15291529
"ScaleUnit": "1cycles / elision"
15301530
},
15311531
{
15321532
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1533-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1533+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
15341534
"MetricGroup": "transaction",
15351535
"MetricName": "tsx_cycles_per_transaction",
15361536
"ScaleUnit": "1cycles / transaction"
15371537
},
15381538
{
15391539
"BriefDescription": "Percentage of cycles within a transaction region.",
1540-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1540+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
15411541
"MetricGroup": "transaction",
15421542
"MetricName": "tsx_transactional_cycles",
15431543
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/icelakex/icx-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,28 +1812,28 @@
18121812
},
18131813
{
18141814
"BriefDescription": "Percentage of cycles in aborted transactions.",
1815-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1815+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
18161816
"MetricGroup": "transaction",
18171817
"MetricName": "tsx_aborted_cycles",
18181818
"ScaleUnit": "100%"
18191819
},
18201820
{
18211821
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1822-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1822+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
18231823
"MetricGroup": "transaction",
18241824
"MetricName": "tsx_cycles_per_elision",
18251825
"ScaleUnit": "1cycles / elision"
18261826
},
18271827
{
18281828
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1829-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1829+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
18301830
"MetricGroup": "transaction",
18311831
"MetricName": "tsx_cycles_per_transaction",
18321832
"ScaleUnit": "1cycles / transaction"
18331833
},
18341834
{
18351835
"BriefDescription": "Percentage of cycles within a transaction region.",
1836-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1836+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
18371837
"MetricGroup": "transaction",
18381838
"MetricName": "tsx_transactional_cycles",
18391839
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/sapphirerapids/spr-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,28 +1938,28 @@
19381938
},
19391939
{
19401940
"BriefDescription": "Percentage of cycles in aborted transactions.",
1941-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1941+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
19421942
"MetricGroup": "transaction",
19431943
"MetricName": "tsx_aborted_cycles",
19441944
"ScaleUnit": "100%"
19451945
},
19461946
{
19471947
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1948-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1948+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
19491949
"MetricGroup": "transaction",
19501950
"MetricName": "tsx_cycles_per_elision",
19511951
"ScaleUnit": "1cycles / elision"
19521952
},
19531953
{
19541954
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1955-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1955+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
19561956
"MetricGroup": "transaction",
19571957
"MetricName": "tsx_cycles_per_transaction",
19581958
"ScaleUnit": "1cycles / transaction"
19591959
},
19601960
{
19611961
"BriefDescription": "Percentage of cycles within a transaction region.",
1962-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1962+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
19631963
"MetricGroup": "transaction",
19641964
"MetricName": "tsx_transactional_cycles",
19651965
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/skylake/skl-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,28 +1466,28 @@
14661466
},
14671467
{
14681468
"BriefDescription": "Percentage of cycles in aborted transactions.",
1469-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1469+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
14701470
"MetricGroup": "transaction",
14711471
"MetricName": "tsx_aborted_cycles",
14721472
"ScaleUnit": "100%"
14731473
},
14741474
{
14751475
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1476-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1476+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
14771477
"MetricGroup": "transaction",
14781478
"MetricName": "tsx_cycles_per_elision",
14791479
"ScaleUnit": "1cycles / elision"
14801480
},
14811481
{
14821482
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1483-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1483+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
14841484
"MetricGroup": "transaction",
14851485
"MetricName": "tsx_cycles_per_transaction",
14861486
"ScaleUnit": "1cycles / transaction"
14871487
},
14881488
{
14891489
"BriefDescription": "Percentage of cycles within a transaction region.",
1490-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1490+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
14911491
"MetricGroup": "transaction",
14921492
"MetricName": "tsx_transactional_cycles",
14931493
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,28 +1774,28 @@
17741774
},
17751775
{
17761776
"BriefDescription": "Percentage of cycles in aborted transactions.",
1777-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1777+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
17781778
"MetricGroup": "transaction",
17791779
"MetricName": "tsx_aborted_cycles",
17801780
"ScaleUnit": "100%"
17811781
},
17821782
{
17831783
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1784-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1784+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
17851785
"MetricGroup": "transaction",
17861786
"MetricName": "tsx_cycles_per_elision",
17871787
"ScaleUnit": "1cycles / elision"
17881788
},
17891789
{
17901790
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1791-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1791+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
17921792
"MetricGroup": "transaction",
17931793
"MetricName": "tsx_cycles_per_transaction",
17941794
"ScaleUnit": "1cycles / transaction"
17951795
},
17961796
{
17971797
"BriefDescription": "Percentage of cycles within a transaction region.",
1798-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1798+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
17991799
"MetricGroup": "transaction",
18001800
"MetricName": "tsx_transactional_cycles",
18011801
"ScaleUnit": "100%"

tools/perf/pmu-events/arch/x86/tigerlake/tgl-metrics.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,28 +1530,28 @@
15301530
},
15311531
{
15321532
"BriefDescription": "Percentage of cycles in aborted transactions.",
1533-
"MetricExpr": "max(cpu@cycles\\-t@ - cpu@cycles\\-ct@, 0) / cycles",
1533+
"MetricExpr": "(max(cycles\\-t - cycles\\-ct, 0) / cycles if has_event(cycles\\-t) else 0)",
15341534
"MetricGroup": "transaction",
15351535
"MetricName": "tsx_aborted_cycles",
15361536
"ScaleUnit": "100%"
15371537
},
15381538
{
15391539
"BriefDescription": "Number of cycles within a transaction divided by the number of elisions.",
1540-
"MetricExpr": "cpu@cycles\\-t@ / cpu@el\\-start@",
1540+
"MetricExpr": "(cycles\\-t / el\\-start if has_event(cycles\\-t) else 0)",
15411541
"MetricGroup": "transaction",
15421542
"MetricName": "tsx_cycles_per_elision",
15431543
"ScaleUnit": "1cycles / elision"
15441544
},
15451545
{
15461546
"BriefDescription": "Number of cycles within a transaction divided by the number of transactions.",
1547-
"MetricExpr": "cpu@cycles\\-t@ / cpu@tx\\-start@",
1547+
"MetricExpr": "(cycles\\-t / tx\\-start if has_event(cycles\\-t) else 0)",
15481548
"MetricGroup": "transaction",
15491549
"MetricName": "tsx_cycles_per_transaction",
15501550
"ScaleUnit": "1cycles / transaction"
15511551
},
15521552
{
15531553
"BriefDescription": "Percentage of cycles within a transaction region.",
1554-
"MetricExpr": "cpu@cycles\\-t@ / cycles",
1554+
"MetricExpr": "(cycles\\-t / cycles if has_event(cycles\\-t) else 0)",
15551555
"MetricGroup": "transaction",
15561556
"MetricName": "tsx_transactional_cycles",
15571557
"ScaleUnit": "100%"

0 commit comments

Comments
 (0)