summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-08-17 11:48:03 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-20 08:54:59 -0300
commitd68a29c2823ff6bd7a25cb748b577f2d88c1f47a (patch)
tree63b9bfc5622b97184ab2a6996d574642880329a9 /tools/perf
parent2354ae9bdc320939cc74695b564ccf178780dd61 (diff)
downloadlinux-d68a29c2823ff6bd7a25cb748b577f2d88c1f47a.tar.gz
linux-d68a29c2823ff6bd7a25cb748b577f2d88c1f47a.tar.bz2
linux-d68a29c2823ff6bd7a25cb748b577f2d88c1f47a.zip
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@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20180817094813.15086-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/dso.c4
1 files changed, 3 insertions, 1 deletions
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: