lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 May 2016 16:17:32 +0900
From:	Taeung Song <treeze.taeung@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Taeung Song <treeze.taeung@...il.com>,
	Jiri Olsa <jolsa@...hat.com>
Subject: [PATCH v2 5/5] perf config: Reset config set at only 'config' sub-command

When first calling perf_config(), config set is
initialized but 'config' sub-command need to reset
config set because of '--user' or '--system' options.

The options of 'config' sub-command is to select
a particular config file location so the config set
should be reinitialized collecting configs from
selected exclusive config file.

Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Signed-off-by: Taeung Song <treeze.taeung@...il.com>
---
 tools/perf/builtin-config.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index 4a61411..dc5b52f 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -47,7 +47,6 @@ static int show_config(const char *key, const char *value,
 int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
 {
 	int ret = 0;
-	struct perf_config_set *set;
 	char *user_config = mkpath("%s/.perfconfig", getenv("HOME"));
 
 	argc = parse_options(argc, argv, config_options, config_usage,
@@ -65,11 +64,11 @@ int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
 	else if (use_user_config)
 		config_exclusive_filename = user_config;
 
-	set = perf_config_set__new();
-	if (!set) {
-		ret = -1;
-		goto out_err;
-	}
+	/*
+	 * Reset config set at only 'config' sub-command
+	 * because of options config file location.
+	 */
+	perf_config_set__delete();
 
 	switch (actions) {
 	case ACTION_LIST:
@@ -92,6 +91,5 @@ int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
 	}
 
 	perf_config_set__delete();
-out_err:
 	return ret;
 }
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ