Skip to content

Commit 46f5c0c

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf tooling updates from Thomas Gleixner: "A set of perf improvements and fixes: perf db-export: - Improvements in how COMM details are exported to databases for post processing and use in the sql-viewer.py UI. - Export switch events to the database. BPF: - Bump rlimit(MEMLOCK) for 'perf test bpf' and 'perf trace', just like selftests/bpf/bpf_rlimit.h do, which makes errors due to exhaustion of this limit, which are kinda cryptic (EPERM sometimes) less frequent. perf version: - Fix segfault due to missing OPT_END(), noticed on PowerPC. perf vendor events: - Add JSON files for IBM s/390 machine type 8561. perf cs-etm (ARM): - Fix two cases of error returns not bing done properly: Invalid ERR_PTR() use and loss of propagation error codes" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (28 commits) perf version: Fix segfault due to missing OPT_END() perf vendor events s390: Add JSON files for machine type 8561 perf cs-etm: Return errcode in cs_etm__process_auxtrace_info() perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info perf scripts python: export-to-postgresql.py: Export switch events perf scripts python: export-to-sqlite.py: Export switch events perf db-export: Export switch events perf db-export: Factor out db_export__threads() perf script: Add scripting operation process_switch() perf scripts python: exported-sql-viewer.py: Use new 'has_calls' column perf scripts python: exported-sql-viewer.py: Remove redundant semi-colons perf scripts python: export-to-postgresql.py: Add has_calls column to comms table perf scripts python: export-to-sqlite.py: Add has_calls column to comms table perf db-export: Also export thread's current comm perf db-export: Factor out db_export__comm() perf scripts python: export-to-postgresql.py: Export comm details perf scripts python: export-to-sqlite.py: Export comm details perf db-export: Export comm details perf db-export: Fix a white space issue in db_export__sample() perf db-export: Move export__comm_thread into db_export__sample() ...
2 parents e6023ad + e0c5c5e commit 46f5c0c

20 files changed

+1029
-142
lines changed

tools/perf/builtin-script.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,6 +2289,12 @@ static int process_switch_event(struct perf_tool *tool,
22892289
if (perf_event__process_switch(tool, event, sample, machine) < 0)
22902290
return -1;
22912291

2292+
if (scripting_ops && scripting_ops->process_switch)
2293+
scripting_ops->process_switch(event, sample, machine);
2294+
2295+
if (!script->show_switch_events)
2296+
return 0;
2297+
22922298
thread = machine__findnew_thread(machine, sample->pid,
22932299
sample->tid);
22942300
if (thread == NULL) {
@@ -2467,7 +2473,7 @@ static int __cmd_script(struct perf_script *script)
24672473
script->tool.mmap = process_mmap_event;
24682474
script->tool.mmap2 = process_mmap2_event;
24692475
}
2470-
if (script->show_switch_events)
2476+
if (script->show_switch_events || (scripting_ops && scripting_ops->process_switch))
24712477
script->tool.context_switch = process_switch_event;
24722478
if (script->show_namespace_events)
24732479
script->tool.namespaces = process_namespaces_event;

tools/perf/builtin-trace.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <api/fs/tracing_path.h>
2020
#include <bpf/bpf.h>
2121
#include "util/bpf_map.h"
22+
#include "util/rlimit.h"
2223
#include "builtin.h"
2324
#include "util/cgroup.h"
2425
#include "util/color.h"
@@ -3864,6 +3865,15 @@ int cmd_trace(int argc, const char **argv)
38643865
goto out;
38653866
}
38663867

3868+
/*
3869+
* Parsing .perfconfig may entail creating a BPF event, that may need
3870+
* to create BPF maps, so bump RLIM_MEMLOCK as the default 64K setting
3871+
* is too small. This affects just this process, not touching the
3872+
* global setting. If it fails we'll get something in 'perf trace -v'
3873+
* to help diagnose the problem.
3874+
*/
3875+
rlimit__bump_memlock();
3876+
38673877
err = perf_config(trace__config, &trace);
38683878
if (err)
38693879
goto out;

tools/perf/builtin-version.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static struct version version;
1919
static struct option version_options[] = {
2020
OPT_BOOLEAN(0, "build-options", &version.build_options,
2121
"display the build options"),
22+
OPT_END(),
2223
};
2324

2425
static const char * const version_usage[] = {
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"Unit": "CPU-M-CF",
4+
"EventCode": "0",
5+
"EventName": "CPU_CYCLES",
6+
"BriefDescription": "CPU Cycles",
7+
"PublicDescription": "Cycle Count"
8+
},
9+
{
10+
"Unit": "CPU-M-CF",
11+
"EventCode": "1",
12+
"EventName": "INSTRUCTIONS",
13+
"BriefDescription": "Instructions",
14+
"PublicDescription": "Instruction Count"
15+
},
16+
{
17+
"Unit": "CPU-M-CF",
18+
"EventCode": "2",
19+
"EventName": "L1I_DIR_WRITES",
20+
"BriefDescription": "L1I Directory Writes",
21+
"PublicDescription": "Level-1 I-Cache Directory Write Count"
22+
},
23+
{
24+
"Unit": "CPU-M-CF",
25+
"EventCode": "3",
26+
"EventName": "L1I_PENALTY_CYCLES",
27+
"BriefDescription": "L1I Penalty Cycles",
28+
"PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
29+
},
30+
{
31+
"Unit": "CPU-M-CF",
32+
"EventCode": "4",
33+
"EventName": "L1D_DIR_WRITES",
34+
"BriefDescription": "L1D Directory Writes",
35+
"PublicDescription": "Level-1 D-Cache Directory Write Count"
36+
},
37+
{
38+
"Unit": "CPU-M-CF",
39+
"EventCode": "5",
40+
"EventName": "L1D_PENALTY_CYCLES",
41+
"BriefDescription": "L1D Penalty Cycles",
42+
"PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
43+
},
44+
{
45+
"Unit": "CPU-M-CF",
46+
"EventCode": "32",
47+
"EventName": "PROBLEM_STATE_CPU_CYCLES",
48+
"BriefDescription": "Problem-State CPU Cycles",
49+
"PublicDescription": "Problem-State Cycle Count"
50+
},
51+
{
52+
"Unit": "CPU-M-CF",
53+
"EventCode": "33",
54+
"EventName": "PROBLEM_STATE_INSTRUCTIONS",
55+
"BriefDescription": "Problem-State Instructions",
56+
"PublicDescription": "Problem-State Instruction Count"
57+
},
58+
]
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[
2+
{
3+
"Unit": "CPU-M-CF",
4+
"EventCode": "64",
5+
"EventName": "PRNG_FUNCTIONS",
6+
"BriefDescription": "PRNG Functions",
7+
"PublicDescription": "Total number of the PRNG functions issued by the CPU"
8+
},
9+
{
10+
"Unit": "CPU-M-CF",
11+
"EventCode": "65",
12+
"EventName": "PRNG_CYCLES",
13+
"BriefDescription": "PRNG Cycles",
14+
"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
15+
},
16+
{
17+
"Unit": "CPU-M-CF",
18+
"EventCode": "66",
19+
"EventName": "PRNG_BLOCKED_FUNCTIONS",
20+
"BriefDescription": "PRNG Blocked Functions",
21+
"PublicDescription": "Total number of the PRNG functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
22+
},
23+
{
24+
"Unit": "CPU-M-CF",
25+
"EventCode": "67",
26+
"EventName": "PRNG_BLOCKED_CYCLES",
27+
"BriefDescription": "PRNG Blocked Cycles",
28+
"PublicDescription": "Total number of CPU cycles blocked for the PRNG functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
29+
},
30+
{
31+
"Unit": "CPU-M-CF",
32+
"EventCode": "68",
33+
"EventName": "SHA_FUNCTIONS",
34+
"BriefDescription": "SHA Functions",
35+
"PublicDescription": "Total number of SHA functions issued by the CPU"
36+
},
37+
{
38+
"Unit": "CPU-M-CF",
39+
"EventCode": "69",
40+
"EventName": "SHA_CYCLES",
41+
"BriefDescription": "SHA Cycles",
42+
"PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
43+
},
44+
{
45+
"Unit": "CPU-M-CF",
46+
"EventCode": "70",
47+
"EventName": "SHA_BLOCKED_FUNCTIONS",
48+
"BriefDescription": "SHA Blocked Functions",
49+
"PublicDescription": "Total number of the SHA functions that are issued by the CPU and are blocked because the SHA coprocessor is busy performing a function issued by another CPU"
50+
},
51+
{
52+
"Unit": "CPU-M-CF",
53+
"EventCode": "71",
54+
"EventName": "SHA_BLOCKED_CYCLES",
55+
"BriefDescription": "SHA Bloced Cycles",
56+
"PublicDescription": "Total number of CPU cycles blocked for the SHA functions issued by the CPU because the SHA coprocessor is busy performing a function issued by another CPU"
57+
},
58+
{
59+
"Unit": "CPU-M-CF",
60+
"EventCode": "72",
61+
"EventName": "DEA_FUNCTIONS",
62+
"BriefDescription": "DEA Functions",
63+
"PublicDescription": "Total number of the DEA functions issued by the CPU"
64+
},
65+
{
66+
"Unit": "CPU-M-CF",
67+
"EventCode": "73",
68+
"EventName": "DEA_CYCLES",
69+
"BriefDescription": "DEA Cycles",
70+
"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
71+
},
72+
{
73+
"Unit": "CPU-M-CF",
74+
"EventCode": "74",
75+
"EventName": "DEA_BLOCKED_FUNCTIONS",
76+
"BriefDescription": "DEA Blocked Functions",
77+
"PublicDescription": "Total number of the DEA functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
78+
},
79+
{
80+
"Unit": "CPU-M-CF",
81+
"EventCode": "75",
82+
"EventName": "DEA_BLOCKED_CYCLES",
83+
"BriefDescription": "DEA Blocked Cycles",
84+
"PublicDescription": "Total number of CPU cycles blocked for the DEA functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
85+
},
86+
{
87+
"Unit": "CPU-M-CF",
88+
"EventCode": "76",
89+
"EventName": "AES_FUNCTIONS",
90+
"BriefDescription": "AES Functions",
91+
"PublicDescription": "Total number of AES functions issued by the CPU"
92+
},
93+
{
94+
"Unit": "CPU-M-CF",
95+
"EventCode": "77",
96+
"EventName": "AES_CYCLES",
97+
"BriefDescription": "AES Cycles",
98+
"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
99+
},
100+
{
101+
"Unit": "CPU-M-CF",
102+
"EventCode": "78",
103+
"EventName": "AES_BLOCKED_FUNCTIONS",
104+
"BriefDescription": "AES Blocked Functions",
105+
"PublicDescription": "Total number of AES functions that are issued by the CPU and are blocked because the DEA/AES coprocessor is busy performing a function issued by another CPU"
106+
},
107+
{
108+
"Unit": "CPU-M-CF",
109+
"EventCode": "79",
110+
"EventName": "AES_BLOCKED_CYCLES",
111+
"BriefDescription": "AES Blocked Cycles",
112+
"PublicDescription": "Total number of CPU cycles blocked for the AES functions issued by the CPU because the DEA/AES coprocessor is busy performing a function issued by another CPU"
113+
},
114+
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[
2+
{
3+
"Unit": "CPU-M-CF",
4+
"EventCode": "80",
5+
"EventName": "ECC_FUNCTION_COUNT",
6+
"BriefDescription": "ECC Function Count",
7+
"PublicDescription": "Long ECC function Count"
8+
},
9+
{
10+
"Unit": "CPU-M-CF",
11+
"EventCode": "81",
12+
"EventName": "ECC_CYCLES_COUNT",
13+
"BriefDescription": "ECC Cycles Count",
14+
"PublicDescription": "Long ECC Function cycles count"
15+
},
16+
{
17+
"Unit": "CPU-M-CF",
18+
"EventCode": "82",
19+
"EventName": "ECC_BLOCKED_FUNCTION_COUNT",
20+
"BriefDescription": "Ecc Blocked Function Count",
21+
"PublicDescription": "Long ECC blocked function count"
22+
},
23+
{
24+
"Unit": "CPU-M-CF",
25+
"EventCode": "83",
26+
"EventName": "ECC_BLOCKED_CYCLES_COUNT",
27+
"BriefDescription": "ECC Blocked Cycles Count",
28+
"PublicDescription": "Long ECC blocked cycles count"
29+
},
30+
]

0 commit comments

Comments
 (0)