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

Commit d68a29c2 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarJiri 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 2354ae9b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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: