Skip to content

Commit 45b2e5a

Browse files
committed
Merge tag 'perf-tools-for-v5.19-2022-06-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull more perf tools updates from Arnaldo Carvalho de Melo: - Synthesize task events for pre-existing threads when using 'perf lock --threads', as we need to show task names. - Fix unwinding with ld.lld (>= version 10.0) linked objects, where .eh_frame_hdr and .text are in different PT_LOAD program headers, which makes perf record --call-graph dwarf fail with such obkects. - Check if 'perf record' hangs in the ARM SPE (Statistical Profiling Extensions) 'perf test' entry when recording a workload with forks. - Trace physical address for Arm SPE events, needed for 'perf c2c' to locate the memory node for samples. - Fix sorting in percent_rmt_hitm_cmp() in 'perf c2c'. - Further support for Intel hybrid systems in the evlist and 'perf record' code. - Update IBM s/390 vendor event JSON tables. - Add metrics (JSON) for Intel Sapphirerapids. - Update metrics for Intel Alderlake. - Correct typo of sysf 'event_source' directory in the documentation. * tag 'perf-tools-for-v5.19-2022-06-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf vendor events intel: Update metrics for Alderlake perf vendor events intel: Add metrics for Sapphirerapids perf c2c: Fix sorting in percent_rmt_hitm_cmp() perf mem: Trace physical address for Arm SPE events perf list: Update event description for IBM zEC12/zBC12 to latest level perf list: Update event description for IBM z196/z114 to latest level perf list: Update event description for IBM z15 to latest level perf list: Update event description for IBM z14 to latest level perf list: Update event description for IBM z13 to latest level perf list: Update event description for IBM z10 to latest level perf list: Add IBM z16 event description for s390 perf record: Support sample-read topdown metric group for hybrid platforms perf lock: Change to synthesize task events perf unwind: Fix segbase for ld.lld linked objects perf test arm-spe: Check if perf-record hangs when recording workload with forks perf docs: Correct typo of event_sources perf evlist: Extend arch_evsel__must_be_in_group to support hybrid systems
2 parents 032dcf0 + 1bcca2b commit 45b2e5a

38 files changed

+2163
-738
lines changed

tools/perf/Documentation/perf-record.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ OPTIONS
3333
- a raw PMU event in the form of rN where N is a hexadecimal value
3434
that represents the raw register encoding with the layout of the
3535
event control registers as described by entries in
36-
/sys/bus/event_sources/devices/cpu/format/*.
36+
/sys/bus/event_source/devices/cpu/format/*.
3737

3838
- a symbolic or raw PMU event followed by an optional colon
3939
and a list of event modifiers, e.g., cpu-cycles:p. See the

tools/perf/Documentation/perf-stat.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ report::
3939
- a raw PMU event in the form of rN where N is a hexadecimal value
4040
that represents the raw register encoding with the layout of the
4141
event control registers as described by entries in
42-
/sys/bus/event_sources/devices/cpu/format/*.
42+
/sys/bus/event_source/devices/cpu/format/*.
4343

4444
- a symbolic or raw PMU event followed by an optional colon
4545
and a list of event modifiers, e.g., cpu-cycles:p. See the

tools/perf/Documentation/perf-top.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Default is to monitor all CPUS.
4141
(use 'perf list' to list all events) or a raw PMU event in the form
4242
of rN where N is a hexadecimal value that represents the raw register
4343
encoding with the layout of the event control registers as described
44-
by entries in /sys/bus/event_sources/devices/cpu/format/*.
44+
by entries in /sys/bus/event_source/devices/cpu/format/*.
4545

4646
-E <entries>::
4747
--entries=<entries>::

tools/perf/arch/arm64/util/mem-events.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#define E(t, n, s) { .tag = t, .name = n, .sysfs_name = s }
66

77
static struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {
8-
E("spe-load", "arm_spe_0/ts_enable=1,load_filter=1,store_filter=0,min_latency=%u/", "arm_spe_0"),
9-
E("spe-store", "arm_spe_0/ts_enable=1,load_filter=0,store_filter=1/", "arm_spe_0"),
10-
E("spe-ldst", "arm_spe_0/ts_enable=1,load_filter=1,store_filter=1,min_latency=%u/", "arm_spe_0"),
8+
E("spe-load", "arm_spe_0/ts_enable=1,pa_enable=1,load_filter=1,store_filter=0,min_latency=%u/", "arm_spe_0"),
9+
E("spe-store", "arm_spe_0/ts_enable=1,pa_enable=1,load_filter=0,store_filter=1/", "arm_spe_0"),
10+
E("spe-ldst", "arm_spe_0/ts_enable=1,pa_enable=1,load_filter=1,store_filter=1,min_latency=%u/", "arm_spe_0"),
1111
};
1212

1313
static char mem_ev_name[100];

tools/perf/arch/x86/util/evsel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "util/env.h"
66
#include "util/pmu.h"
77
#include "linux/string.h"
8+
#include "evsel.h"
89

910
void arch_evsel__set_sample_weight(struct evsel *evsel)
1011
{
@@ -32,7 +33,7 @@ void arch_evsel__fixup_new_cycles(struct perf_event_attr *attr)
3233
}
3334

3435
/* Check whether the evsel's PMU supports the perf metrics */
35-
static bool evsel__sys_has_perf_metrics(const struct evsel *evsel)
36+
bool evsel__sys_has_perf_metrics(const struct evsel *evsel)
3637
{
3738
const char *pmu_name = evsel->pmu_name ? evsel->pmu_name : "cpu";
3839

@@ -57,6 +58,6 @@ bool arch_evsel__must_be_in_group(const struct evsel *evsel)
5758
return false;
5859

5960
return evsel->name &&
60-
(!strcasecmp(evsel->name, "slots") ||
61+
(strcasestr(evsel->name, "slots") ||
6162
strcasestr(evsel->name, "topdown"));
6263
}

tools/perf/arch/x86/util/evsel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _EVSEL_H
3+
#define _EVSEL_H 1
4+
5+
bool evsel__sys_has_perf_metrics(const struct evsel *evsel);
6+
7+
#endif

tools/perf/arch/x86/util/topdown.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "util/pmu.h"
55
#include "util/topdown.h"
66
#include "topdown.h"
7+
#include "evsel.h"
78

89
/* Check whether there is a PMU which supports the perf metrics. */
910
bool topdown_sys_has_perf_metrics(void)
@@ -55,33 +56,19 @@ void arch_topdown_group_warn(void)
5556

5657
#define TOPDOWN_SLOTS 0x0400
5758

58-
static bool is_topdown_slots_event(struct evsel *counter)
59-
{
60-
if (!counter->pmu_name)
61-
return false;
62-
63-
if (strcmp(counter->pmu_name, "cpu"))
64-
return false;
65-
66-
if (counter->core.attr.config == TOPDOWN_SLOTS)
67-
return true;
68-
69-
return false;
70-
}
71-
7259
/*
7360
* Check whether a topdown group supports sample-read.
7461
*
75-
* Only Topdown metic supports sample-read. The slots
62+
* Only Topdown metric supports sample-read. The slots
7663
* event must be the leader of the topdown group.
7764
*/
7865

7966
bool arch_topdown_sample_read(struct evsel *leader)
8067
{
81-
if (!pmu_have_event("cpu", "slots"))
68+
if (!evsel__sys_has_perf_metrics(leader))
8269
return false;
8370

84-
if (is_topdown_slots_event(leader))
71+
if (leader->core.attr.config == TOPDOWN_SLOTS)
8572
return true;
8673

8774
return false;

tools/perf/builtin-c2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,8 @@ percent_rmt_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
928928
double per_left;
929929
double per_right;
930930

931-
per_left = PERCENT(left, lcl_hitm);
932-
per_right = PERCENT(right, lcl_hitm);
931+
per_left = PERCENT(left, rmt_hitm);
932+
per_right = PERCENT(right, rmt_hitm);
933933

934934
return per_left - per_right;
935935
}

tools/perf/builtin-lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ static int __cmd_report(bool display_info)
10831083
static int __cmd_record(int argc, const char **argv)
10841084
{
10851085
const char *record_args[] = {
1086-
"record", "-R", "-m", "1024", "-c", "1", "--synth", "no",
1086+
"record", "-R", "-m", "1024", "-c", "1", "--synth", "task",
10871087
};
10881088
unsigned int rec_argc, i, j, ret;
10891089
const char **rec_argv;

tools/perf/pmu-events/arch/s390/cf_z10/basic.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,84 +3,84 @@
33
"Unit": "CPU-M-CF",
44
"EventCode": "0",
55
"EventName": "CPU_CYCLES",
6-
"BriefDescription": "CPU Cycles",
7-
"PublicDescription": "Cycle Count"
6+
"BriefDescription": "Cycle Count",
7+
"PublicDescription": "This counter counts the total number of CPU cycles, excluding the number of cycles while the CPU is in the wait state."
88
},
99
{
1010
"Unit": "CPU-M-CF",
1111
"EventCode": "1",
1212
"EventName": "INSTRUCTIONS",
13-
"BriefDescription": "Instructions",
14-
"PublicDescription": "Instruction Count"
13+
"BriefDescription": "Instruction Count",
14+
"PublicDescription": "This counter counts the total number of instructions executed by the CPU."
1515
},
1616
{
1717
"Unit": "CPU-M-CF",
1818
"EventCode": "2",
1919
"EventName": "L1I_DIR_WRITES",
20-
"BriefDescription": "L1I Directory Writes",
21-
"PublicDescription": "Level-1 I-Cache Directory Write Count"
20+
"BriefDescription": "Level-1 I-Cache Directory Write Count",
21+
"PublicDescription": "This counter counts the total number of level-1 instruction-cache or unified-cache directory writes."
2222
},
2323
{
2424
"Unit": "CPU-M-CF",
2525
"EventCode": "3",
2626
"EventName": "L1I_PENALTY_CYCLES",
27-
"BriefDescription": "L1I Penalty Cycles",
28-
"PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
27+
"BriefDescription": "Level-1 I-Cache Penalty Cycle Count",
28+
"PublicDescription": "This counter counts the total number of cache penalty cycles for level-1 instruction cache or unified cache."
2929
},
3030
{
3131
"Unit": "CPU-M-CF",
3232
"EventCode": "4",
3333
"EventName": "L1D_DIR_WRITES",
34-
"BriefDescription": "L1D Directory Writes",
35-
"PublicDescription": "Level-1 D-Cache Directory Write Count"
34+
"BriefDescription": "Level-1 D-Cache Directory Write Count",
35+
"PublicDescription": "This counter counts the total number of level-1 data-cache directory writes."
3636
},
3737
{
3838
"Unit": "CPU-M-CF",
3939
"EventCode": "5",
4040
"EventName": "L1D_PENALTY_CYCLES",
41-
"BriefDescription": "L1D Penalty Cycles",
42-
"PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
41+
"BriefDescription": "Level-1 D-Cache Penalty Cycle Count",
42+
"PublicDescription": "This counter counts the total number of cache penalty cycles for level-1 data cache."
4343
},
4444
{
4545
"Unit": "CPU-M-CF",
4646
"EventCode": "32",
4747
"EventName": "PROBLEM_STATE_CPU_CYCLES",
48-
"BriefDescription": "Problem-State CPU Cycles",
49-
"PublicDescription": "Problem-State Cycle Count"
48+
"BriefDescription": "Problem-State Cycle Count",
49+
"PublicDescription": "This counter counts the total number of CPU cycles when the CPU is in the problem state, excluding the number of cycles while the CPU is in the wait state."
5050
},
5151
{
5252
"Unit": "CPU-M-CF",
5353
"EventCode": "33",
5454
"EventName": "PROBLEM_STATE_INSTRUCTIONS",
55-
"BriefDescription": "Problem-State Instructions",
56-
"PublicDescription": "Problem-State Instruction Count"
55+
"BriefDescription": "Problem-State Instruction Count",
56+
"PublicDescription": "This counter counts the total number of instructions executed by the CPU while in the problem state."
5757
},
5858
{
5959
"Unit": "CPU-M-CF",
6060
"EventCode": "34",
6161
"EventName": "PROBLEM_STATE_L1I_DIR_WRITES",
62-
"BriefDescription": "Problem-State L1I Directory Writes",
63-
"PublicDescription": "Problem-State Level-1 I-Cache Directory Write Count"
62+
"BriefDescription": "Problem-State Level-1 I-Cache Directory Write Count",
63+
"PublicDescription": "This counter counts the total number of level-1 instruction-cache or unified-cache directory writes while the CPU is in the problem state."
6464
},
6565
{
6666
"Unit": "CPU-M-CF",
6767
"EventCode": "35",
6868
"EventName": "PROBLEM_STATE_L1I_PENALTY_CYCLES",
69-
"BriefDescription": "Problem-State L1I Penalty Cycles",
70-
"PublicDescription": "Problem-State Level-1 I-Cache Penalty Cycle Count"
69+
"BriefDescription": "Level-1 I-Cache Penalty Cycle Count",
70+
"PublicDescription": "This counter counts the total number of penalty cycles for level-1 instruction cache or unified cache while the CPU is in the problem state."
7171
},
7272
{
7373
"Unit": "CPU-M-CF",
7474
"EventCode": "36",
7575
"EventName": "PROBLEM_STATE_L1D_DIR_WRITES",
76-
"BriefDescription": "Problem-State L1D Directory Writes",
77-
"PublicDescription": "Problem-State Level-1 D-Cache Directory Write Count"
76+
"BriefDescription": "Problem-State Level-1 D-Cache Directory Write Count",
77+
"PublicDescription": "This counter counts the total number of level-1 data-cache directory writes while the CPU is in the problem state."
7878
},
7979
{
8080
"Unit": "CPU-M-CF",
8181
"EventCode": "37",
8282
"EventName": "PROBLEM_STATE_L1D_PENALTY_CYCLES",
83-
"BriefDescription": "Problem-State L1D Penalty Cycles",
84-
"PublicDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count"
83+
"BriefDescription": "Problem-State Level-1 D-Cache Penalty Cycle Count",
84+
"PublicDescription": "This counter counts the total number of penalty cycles for level-1 data cache while the CPU is in the problem state."
8585
}
8686
]

0 commit comments

Comments
 (0)