Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46f5c0cc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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()
  ...
parents e6023adc e0c5c5e3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2289,6 +2289,12 @@ static int process_switch_event(struct perf_tool *tool,
	if (perf_event__process_switch(tool, event, sample, machine) < 0)
		return -1;

	if (scripting_ops && scripting_ops->process_switch)
		scripting_ops->process_switch(event, sample, machine);

	if (!script->show_switch_events)
		return 0;

	thread = machine__findnew_thread(machine, sample->pid,
					 sample->tid);
	if (thread == NULL) {
@@ -2467,7 +2473,7 @@ static int __cmd_script(struct perf_script *script)
		script->tool.mmap = process_mmap_event;
		script->tool.mmap2 = process_mmap2_event;
	}
	if (script->show_switch_events)
	if (script->show_switch_events || (scripting_ops && scripting_ops->process_switch))
		script->tool.context_switch = process_switch_event;
	if (script->show_namespace_events)
		script->tool.namespaces = process_namespaces_event;
+10 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <api/fs/tracing_path.h>
#include <bpf/bpf.h>
#include "util/bpf_map.h"
#include "util/rlimit.h"
#include "builtin.h"
#include "util/cgroup.h"
#include "util/color.h"
@@ -3864,6 +3865,15 @@ int cmd_trace(int argc, const char **argv)
		goto out;
	}

	/*
	 * Parsing .perfconfig may entail creating a BPF event, that may need
	 * to create BPF maps, so bump RLIM_MEMLOCK as the default 64K setting
	 * is too small. This affects just this process, not touching the
	 * global setting. If it fails we'll get something in 'perf trace -v'
	 * to help diagnose the problem.
	 */
	rlimit__bump_memlock();

	err = perf_config(trace__config, &trace);
	if (err)
		goto out;
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ static struct version version;
static struct option version_options[] = {
	OPT_BOOLEAN(0, "build-options", &version.build_options,
		    "display the build options"),
	OPT_END(),
};

static const char * const version_usage[] = {
+58 −0
Original line number Diff line number Diff line
[
	{
		"Unit": "CPU-M-CF",
		"EventCode": "0",
		"EventName": "CPU_CYCLES",
		"BriefDescription": "CPU Cycles",
		"PublicDescription": "Cycle Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "1",
		"EventName": "INSTRUCTIONS",
		"BriefDescription": "Instructions",
		"PublicDescription": "Instruction Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "2",
		"EventName": "L1I_DIR_WRITES",
		"BriefDescription": "L1I Directory Writes",
		"PublicDescription": "Level-1 I-Cache Directory Write Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "3",
		"EventName": "L1I_PENALTY_CYCLES",
		"BriefDescription": "L1I Penalty Cycles",
		"PublicDescription": "Level-1 I-Cache Penalty Cycle Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "4",
		"EventName": "L1D_DIR_WRITES",
		"BriefDescription": "L1D Directory Writes",
		"PublicDescription": "Level-1 D-Cache Directory Write Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "5",
		"EventName": "L1D_PENALTY_CYCLES",
		"BriefDescription": "L1D Penalty Cycles",
		"PublicDescription": "Level-1 D-Cache Penalty Cycle Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "32",
		"EventName": "PROBLEM_STATE_CPU_CYCLES",
		"BriefDescription": "Problem-State CPU Cycles",
		"PublicDescription": "Problem-State Cycle Count"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "33",
		"EventName": "PROBLEM_STATE_INSTRUCTIONS",
		"BriefDescription": "Problem-State Instructions",
		"PublicDescription": "Problem-State Instruction Count"
	},
]
+114 −0
Original line number Diff line number Diff line
[
	{
		"Unit": "CPU-M-CF",
		"EventCode": "64",
		"EventName": "PRNG_FUNCTIONS",
		"BriefDescription": "PRNG Functions",
		"PublicDescription": "Total number of the PRNG functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "65",
		"EventName": "PRNG_CYCLES",
		"BriefDescription": "PRNG Cycles",
		"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing PRNG functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "66",
		"EventName": "PRNG_BLOCKED_FUNCTIONS",
		"BriefDescription": "PRNG Blocked Functions",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "67",
		"EventName": "PRNG_BLOCKED_CYCLES",
		"BriefDescription": "PRNG Blocked Cycles",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "68",
		"EventName": "SHA_FUNCTIONS",
		"BriefDescription": "SHA Functions",
		"PublicDescription": "Total number of SHA functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "69",
		"EventName": "SHA_CYCLES",
		"BriefDescription": "SHA Cycles",
		"PublicDescription": "Total number of CPU cycles when the SHA coprocessor is busy performing the SHA functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "70",
		"EventName": "SHA_BLOCKED_FUNCTIONS",
		"BriefDescription": "SHA Blocked Functions",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "71",
		"EventName": "SHA_BLOCKED_CYCLES",
		"BriefDescription": "SHA Bloced Cycles",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "72",
		"EventName": "DEA_FUNCTIONS",
		"BriefDescription": "DEA Functions",
		"PublicDescription": "Total number of the DEA functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "73",
		"EventName": "DEA_CYCLES",
		"BriefDescription": "DEA Cycles",
		"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the DEA functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "74",
		"EventName": "DEA_BLOCKED_FUNCTIONS",
		"BriefDescription": "DEA Blocked Functions",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "75",
		"EventName": "DEA_BLOCKED_CYCLES",
		"BriefDescription": "DEA Blocked Cycles",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "76",
		"EventName": "AES_FUNCTIONS",
		"BriefDescription": "AES Functions",
		"PublicDescription": "Total number of AES functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "77",
		"EventName": "AES_CYCLES",
		"BriefDescription": "AES Cycles",
		"PublicDescription": "Total number of CPU cycles when the DEA/AES coprocessor is busy performing the AES functions issued by the CPU"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "78",
		"EventName": "AES_BLOCKED_FUNCTIONS",
		"BriefDescription": "AES Blocked Functions",
		"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"
	},
	{
		"Unit": "CPU-M-CF",
		"EventCode": "79",
		"EventName": "AES_BLOCKED_CYCLES",
		"BriefDescription": "AES Blocked Cycles",
		"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"
	},
]
Loading