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

Commit fe7a2eaa authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo' of...

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

  - Do not print trailing spaces in the hists browser (top, report) to
    avoid line wrapping issues when long C++ demangled functions are
    sampled (Arnaldo Carvalho de Melo)

  - Allow 'perf config' to show --system or --user settings (Taeung Song)

  - Add better warning about the need to install the audit-lib-python
    package when using perf python scripts (Taeung Song)

  - Fix symbol resolution when kernel modules files are only in the
    build id cache (~/.debug) (Wang Nan)

Build fixes:

  - Fix 'perf test' build on older systems where 'signal' is reserved (Arnaldo Carvalho de Melo)

Infrastructure changes:

  - Free the terms list_head in parse_events__free_terms(), also unlink the entries
    when deleting them (Wang Nan)

  - Fix releasing event_class in 'perf data' fixing integration with
    libbabeltrace (Wang Nan)

  - Add EXTRA_LDFLAGS option to Makefile (Zubair Lutfullah Kakakhel)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents a7636d9e 1ad826ba
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -8,7 +8,7 @@ perf-config - Get and set variables in a configuration file.
SYNOPSIS
SYNOPSIS
--------
--------
[verse]
[verse]
'perf config' -l | --list
'perf config' [<file-option>] -l | --list


DESCRIPTION
DESCRIPTION
-----------
-----------
@@ -21,6 +21,14 @@ OPTIONS
--list::
--list::
	Show current config variables, name and value, for all sections.
	Show current config variables, name and value, for all sections.


--user::
	For writing and reading options: write to user
	'$HOME/.perfconfig' file or read it.

--system::
	For writing and reading options: write to system-wide
	'$(sysconfdir)/perfconfig' or read it.

CONFIGURATION FILE
CONFIGURATION FILE
------------------
------------------


@@ -30,6 +38,10 @@ The '$HOME/.perfconfig' file is used to store a per-user configuration.
The file '$(sysconfdir)/perfconfig' can be used to
The file '$(sysconfdir)/perfconfig' can be used to
store a system-wide default configuration.
store a system-wide default configuration.


When reading or writing, the values are read from the system and user
configuration files by default, and options '--system' and '--user'
can be used to tell the command to read from or write to only that location.

Syntax
Syntax
~~~~~~
~~~~~~


+2 −0
Original line number Original line Diff line number Diff line
@@ -139,6 +139,8 @@ $(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,AR,$(CROSS_COMPILE)ar)
$(call allow-override,AR,$(CROSS_COMPILE)ar)
$(call allow-override,LD,$(CROSS_COMPILE)ld)
$(call allow-override,LD,$(CROSS_COMPILE)ld)


LD += $(EXTRA_LDFLAGS)

PKG_CONFIG = $(CROSS_COMPILE)pkg-config
PKG_CONFIG = $(CROSS_COMPILE)pkg-config


RM      = rm -f
RM      = rm -f
+1 −1
Original line number Original line Diff line number Diff line
@@ -89,7 +89,7 @@ static int intel_pt_parse_terms_with_default(struct list_head *formats,


	*config = attr.config;
	*config = attr.config;
out_free:
out_free:
	parse_events__free_terms(terms);
	parse_events_terms__delete(terms);
	return err;
	return err;
}
}


+24 −3
Original line number Original line Diff line number Diff line
@@ -13,8 +13,10 @@
#include "util/util.h"
#include "util/util.h"
#include "util/debug.h"
#include "util/debug.h"


static bool use_system_config, use_user_config;

static const char * const config_usage[] = {
static const char * const config_usage[] = {
	"perf config [options]",
	"perf config [<file-option>] [options]",
	NULL
	NULL
};
};


@@ -25,6 +27,8 @@ enum actions {
static struct option config_options[] = {
static struct option config_options[] = {
	OPT_SET_UINT('l', "list", &actions,
	OPT_SET_UINT('l', "list", &actions,
		     "show current config variables", ACTION_LIST),
		     "show current config variables", ACTION_LIST),
	OPT_BOOLEAN(0, "system", &use_system_config, "use system config file"),
	OPT_BOOLEAN(0, "user", &use_user_config, "use user config file"),
	OPT_END()
	OPT_END()
};
};


@@ -42,10 +46,23 @@ static int show_config(const char *key, const char *value,
int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
{
{
	int ret = 0;
	int ret = 0;
	char *user_config = mkpath("%s/.perfconfig", getenv("HOME"));


	argc = parse_options(argc, argv, config_options, config_usage,
	argc = parse_options(argc, argv, config_options, config_usage,
			     PARSE_OPT_STOP_AT_NON_OPTION);
			     PARSE_OPT_STOP_AT_NON_OPTION);


	if (use_system_config && use_user_config) {
		pr_err("Error: only one config file at a time\n");
		parse_options_usage(config_usage, config_options, "user", 0);
		parse_options_usage(NULL, config_options, "system", 0);
		return -1;
	}

	if (use_system_config)
		config_exclusive_filename = perf_etc_perfconfig();
	else if (use_user_config)
		config_exclusive_filename = user_config;

	switch (actions) {
	switch (actions) {
	case ACTION_LIST:
	case ACTION_LIST:
		if (argc) {
		if (argc) {
@@ -53,9 +70,13 @@ int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
			parse_options_usage(config_usage, config_options, "l", 1);
			parse_options_usage(config_usage, config_options, "l", 1);
		} else {
		} else {
			ret = perf_config(show_config, NULL);
			ret = perf_config(show_config, NULL);
			if (ret < 0)
			if (ret < 0) {
				const char * config_filename = config_exclusive_filename;
				if (!config_exclusive_filename)
					config_filename = user_config;
				pr_err("Nothing configured, "
				pr_err("Nothing configured, "
				       "please check your ~/.perfconfig file\n");
				       "please check your %s \n", config_filename);
			}
		}
		}
		break;
		break;
	default:
	default:
+4 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,10 @@ try:
except:
except:
	if not audit_package_warned:
	if not audit_package_warned:
		audit_package_warned = True
		audit_package_warned = True
		print "Install the audit-libs-python package to get syscall names"
		print "Install the audit-libs-python package to get syscall names.\n" \
                    "For example:\n  # apt-get install python-audit (Ubuntu)" \
                    "\n  # yum install audit-libs-python (Fedora)" \
                    "\n  etc.\n"


def syscall_name(id):
def syscall_name(id):
	try:
	try:
Loading