public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 <peterz@infradead.org>,
	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 v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path}
Date: Mon, 5 Jun 2017 11:58:01 +0200	[thread overview]
Message-ID: <20170605095801.GA2253@krava> (raw)
In-Reply-To: <20170603020033.28677-1-namhyung@kernel.org>

On Sat, Jun 03, 2017 at 11:00:31AM +0900, Namhyung Kim wrote:
> Move decompress_kmodule() to util/dso.c and split it to two functions
> returning fd and (decompressed) file path.  Existing user only wants the
> fd version but the path version will be used soon.
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/dso.c        | 51 ++++++++++++++++++++++++++++++++++++++++++++
>  tools/perf/util/dso.h        |  3 +++
>  tools/perf/util/symbol-elf.c | 36 +------------------------------
>  3 files changed, 55 insertions(+), 35 deletions(-)
> 
> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> index b27d127cdf68..fc4747a8c283 100644
> --- a/tools/perf/util/dso.c
> +++ b/tools/perf/util/dso.c
> @@ -248,6 +248,57 @@ bool dso__needs_decompress(struct dso *dso)
>  		dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE_COMP;
>  }
>  
> +static int decompress_kmodule(struct dso *dso, const char *name, char *tmpbuf)
> +{
> +	int fd = -1;
> +	struct kmod_path m;
> +
> +	if (!dso__needs_decompress(dso))
> +		return -1;

the original code had also DSO_BINARY_TYPE__BUILD_ID_CACHE check,
not sure why though.. ;-)

jirka

  parent reply	other threads:[~2017-06-05  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-03  2:00 [PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path} Namhyung Kim
2017-06-03  2:00 ` [PATCH v2 2/3] perf tools: Decompress kernel module when reading DSO data Namhyung Kim
2017-06-03  2:00 ` [PATCH v2 3/3] perf test: Decompress kernel module before objdump Namhyung Kim
2017-06-05 11:13   ` Adrian Hunter
2017-06-06  1:42     ` Namhyung Kim
2017-06-05  9:58 ` Jiri Olsa [this message]
2017-06-06  1:36   ` [PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path} 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=20170605095801.GA2253@krava \
    --to=jolsa@redhat.com \
    --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 \
    --cc=peterz@infradead.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