[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-d68a29c2823ff6bd7a25cb748b577f2d88c1f47a@git.kernel.org>
Date: Thu, 23 Aug 2018 01:40:11 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, jolsa@...nel.org,
alexander.shishkin@...ux.intel.com, mingo@...nel.org,
linux-kernel@...r.kernel.org, peterz@...radead.org,
namhyung@...nel.org, hpa@...or.com, dsahern@...il.com,
tglx@...utronix.de, mpetlan@...hat.com
Subject: [tip:perf/urgent] perf tools: Get rid of dso__needs_decompress()
call in __open_dso()
Commit-ID: d68a29c2823ff6bd7a25cb748b577f2d88c1f47a
Gitweb: https://git.kernel.org/tip/d68a29c2823ff6bd7a25cb748b577f2d88c1f47a
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Fri, 17 Aug 2018 11:48:03 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 20 Aug 2018 08:54:59 -0300
perf tools: Get rid of dso__needs_decompress() call in __open_dso()
There's no need to call dso__needs_decompress() twice in the function.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Michael Petlan <mpetlan@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20180817094813.15086-4-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/dso.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 51cf82cf1882..8ee1faa5726f 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -468,6 +468,7 @@ static int __open_dso(struct dso *dso, struct machine *machine)
int fd = -EINVAL;
char *root_dir = (char *)"";
char *name = malloc(PATH_MAX);
+ bool decomp = false;
if (!name)
return -ENOMEM;
@@ -491,12 +492,13 @@ static int __open_dso(struct dso *dso, struct machine *machine)
goto out;
}
+ decomp = true;
strcpy(name, newpath);
}
fd = do_open(name);
- if (dso__needs_decompress(dso))
+ if (decomp)
unlink(name);
out:
Powered by blists - more mailing lists