All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, fweisbec@gmail.com, namhyung@kernel.org,
	eranian@google.com, a.p.zijlstra@chello.nl, dsahern@gmail.com,
	jolsa@kernel.org, tglx@linutronix.de, rostedt@goodmis.org,
	cjashfor@linux.vnet.ibm.com, acme@redhat.com
Subject: [tip:perf/urgent] perf buildid-cache: Remove extra debugdir variables
Date: Fri, 12 Dec 2014 00:17:05 -0800	[thread overview]
Message-ID: <tip-498922adf1173ddeebd155f82646d4a9d518d606@git.kernel.org> (raw)
In-Reply-To: <1417460789-13874-3-git-send-email-jolsa@kernel.org>

Commit-ID:  498922adf1173ddeebd155f82646d4a9d518d606
Gitweb:     http://git.kernel.org/tip/498922adf1173ddeebd155f82646d4a9d518d606
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 1 Dec 2014 20:06:23 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 9 Dec 2014 09:14:34 -0300

perf buildid-cache: Remove extra debugdir variables

There's no need to copy over the buildid_dir into separate variable with
no change.

This is leftover from commit:
  45de34bbe3e1 perf buildid: add perfconfig option to specify buildid cache dir

that added global buildid_dir variable that holds cache directory, but
did not cleanup the debugdir copies.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1417460789-13874-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-buildid-cache.c | 11 ++++-------
 tools/perf/util/build-id.c         |  9 +++------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 7038575..29f24c0 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -285,7 +285,6 @@ int cmd_buildid_cache(int argc, const char **argv,
 	struct str_node *pos;
 	int ret = 0;
 	bool force = false;
-	char debugdir[PATH_MAX];
 	char const *add_name_list_str = NULL,
 		   *remove_name_list_str = NULL,
 		   *missing_filename = NULL,
@@ -335,13 +334,11 @@ int cmd_buildid_cache(int argc, const char **argv,
 
 	setup_pager();
 
-	snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir);
-
 	if (add_name_list_str) {
 		list = strlist__new(true, add_name_list_str);
 		if (list) {
 			strlist__for_each(pos, list)
-				if (build_id_cache__add_file(pos->s, debugdir)) {
+				if (build_id_cache__add_file(pos->s, buildid_dir)) {
 					if (errno == EEXIST) {
 						pr_debug("%s already in the cache\n",
 							 pos->s);
@@ -359,7 +356,7 @@ int cmd_buildid_cache(int argc, const char **argv,
 		list = strlist__new(true, remove_name_list_str);
 		if (list) {
 			strlist__for_each(pos, list)
-				if (build_id_cache__remove_file(pos->s, debugdir)) {
+				if (build_id_cache__remove_file(pos->s, buildid_dir)) {
 					if (errno == ENOENT) {
 						pr_debug("%s wasn't in the cache\n",
 							 pos->s);
@@ -380,7 +377,7 @@ int cmd_buildid_cache(int argc, const char **argv,
 		list = strlist__new(true, update_name_list_str);
 		if (list) {
 			strlist__for_each(pos, list)
-				if (build_id_cache__update_file(pos->s, debugdir)) {
+				if (build_id_cache__update_file(pos->s, buildid_dir)) {
 					if (errno == ENOENT) {
 						pr_debug("%s wasn't in the cache\n",
 							 pos->s);
@@ -395,7 +392,7 @@ int cmd_buildid_cache(int argc, const char **argv,
 	}
 
 	if (kcore_filename &&
-	    build_id_cache__add_kcore(kcore_filename, debugdir, force))
+	    build_id_cache__add_kcore(kcore_filename, buildid_dir, force))
 		pr_warning("Couldn't add %s\n", kcore_filename);
 
 out:
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index e8d79e5..0c72680 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -410,21 +410,18 @@ int perf_session__cache_build_ids(struct perf_session *session)
 {
 	struct rb_node *nd;
 	int ret;
-	char debugdir[PATH_MAX];
 
 	if (no_buildid_cache)
 		return 0;
 
-	snprintf(debugdir, sizeof(debugdir), "%s", buildid_dir);
-
-	if (mkdir(debugdir, 0755) != 0 && errno != EEXIST)
+	if (mkdir(buildid_dir, 0755) != 0 && errno != EEXIST)
 		return -1;
 
-	ret = machine__cache_build_ids(&session->machines.host, debugdir);
+	ret = machine__cache_build_ids(&session->machines.host, buildid_dir);
 
 	for (nd = rb_first(&session->machines.guests); nd; nd = rb_next(nd)) {
 		struct machine *pos = rb_entry(nd, struct machine, rb_node);
-		ret |= machine__cache_build_ids(pos, debugdir);
+		ret |= machine__cache_build_ids(pos, buildid_dir);
 	}
 	return ret ? -1 : 0;
 }

  reply	other threads:[~2014-12-12  8:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 19:06 [PATCH 0/8] perf buildid-cache: Add clean command Jiri Olsa
2014-12-01 19:06 ` [PATCH 1/8] perf tools: Use single strcmp call instead of two Jiri Olsa
2014-12-12  8:16   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2014-12-01 19:06 ` [PATCH 2/8] perf tools: Remove extra debugdir variables Jiri Olsa
2014-12-12  8:17   ` tip-bot for Jiri Olsa [this message]
2014-12-01 19:06 ` [PATCH 3/8] perf tools: Add --buildid-dir option to set cache directory Jiri Olsa
2014-12-05 15:36   ` Arnaldo Carvalho de Melo
2014-12-12  8:17   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2014-12-01 19:06 ` [PATCH 4/8] perf buildid-cache: Add clean command Jiri Olsa
2014-12-01 19:06 ` [PATCH 5/8] perf buildid-cache: Add automated tests Jiri Olsa
2014-12-05 15:30   ` Arnaldo Carvalho de Melo
2014-12-06 12:12     ` Jiri Olsa
2014-12-01 19:06 ` [PATCH 6/8] perf buildid cache: Fix -a segfault Jiri Olsa
2014-12-05 15:30   ` Arnaldo Carvalho de Melo
2014-12-12  8:17   ` [tip:perf/urgent] perf buildid cache: Fix -a segfault related to kcore handling tip-bot for Jiri Olsa
2014-12-01 19:06 ` [PATCH 7/8] perf buildid-cache: Fix kallsyms removal Jiri Olsa
2014-12-01 19:06 ` [PATCH 8/8] perf buildid-cache: Try to remove empty directories Jiri Olsa
2014-12-01 22:29 ` [PATCH 0/8] perf buildid-cache: Add clean command Arnaldo Carvalho de Melo
2014-12-02 12:25   ` Jiri Olsa
2014-12-02 14:10     ` Arnaldo Carvalho de Melo
2014-12-03  8:13       ` Namhyung Kim
2014-12-03 13:38         ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-498922adf1173ddeebd155f82646d4a9d518d606@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.