From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
kernel-team@lge.com, David Ahern <dsahern@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH 1/2] perf tools: Decompress kernel module when reading DSO data
Date: Thu, 1 Jun 2017 13:29:31 +0200 [thread overview]
Message-ID: <20170601112931.GA15888@krava> (raw)
In-Reply-To: <20170601090605.5809-1-namhyung@kernel.org>
On Thu, Jun 01, 2017 at 06:06:04PM +0900, Namhyung Kim wrote:
SNIP
> @@ -399,6 +438,7 @@ static int __open_dso(struct dso *dso, struct machine *machine)
> int fd;
> char *root_dir = (char *)"";
> char *name = malloc(PATH_MAX);
> + bool needs_unlink = false;
>
> if (!name)
> return -ENOMEM;
> @@ -415,7 +455,23 @@ static int __open_dso(struct dso *dso, struct machine *machine)
> if (!is_regular_file(name))
> return -EINVAL;
>
> + if (dso__needs_decompress(dso)) {
> + char buf[32];
> +
> + fd = dso__decompress_kmodule(dso, name, buf, sizeof(buf));
> + if (fd < 0)
free(name)
> + return -1;
> +
> + close(fd);
> + strcpy(name, buf);
also why not use name directly instead of buf?
jirka
next prev parent reply other threads:[~2017-06-01 11:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 9:06 Namhyung Kim
2017-06-01 9:06 ` [PATCH 2/2] perf test: Decompress kernel module before objdump Namhyung Kim
2017-06-01 11:29 ` Jiri Olsa [this message]
2017-06-03 1:41 ` [PATCH 1/2] perf tools: Decompress kernel module when reading DSO data Namhyung Kim
2017-06-01 11:29 ` Jiri Olsa
2017-06-03 1:43 ` Namhyung Kim
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=20170601112931.GA15888@krava \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome