Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658308

Re: [PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path}

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path}
Date 2017-06-06 03:40 +0200
Message-ID <tPbDr-24f-9@gated-at.bofh.it> (permalink)
References <tO6FP-QT-3@gated-at.bofh.it> <tOWXM-1fC-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Jiri,

On Mon, Jun 5, 2017 at 6:58 PM, Jiri Olsa <jolsa@redhat.com> wrote:
> 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.. ;-)

It's because decompressed modules which were found in the build-id
cache didn't set dso->symtab_type properly.  It was fixed by my
previous patch so checking symtab_type will cover the (compressed)
build-id cache case too now.

Thanks,
Namhyung

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path} Namhyung Kim <namhyung@kernel.org> - 2017-06-03 04:10 +0200
  [PATCH v2 2/3] perf tools: Decompress kernel module when reading DSO data Namhyung Kim <namhyung@kernel.org> - 2017-06-03 04:10 +0200
  [PATCH v2 3/3] perf test: Decompress kernel module before objdump Namhyung Kim <namhyung@kernel.org> - 2017-06-03 04:10 +0200
    Re: [PATCH v2 3/3] perf test: Decompress kernel module before objdump Adrian Hunter <adrian.hunter@intel.com> - 2017-06-05 13:20 +0200
      Re: [PATCH v2 3/3] perf test: Decompress kernel module before objdump Namhyung Kim <namhyung@kernel.org> - 2017-06-06 03:50 +0200
  Re: [PATCH v2 1/3] perf tools: Introduce  dso__decompress_kmodule_{fd,path} Jiri Olsa <jolsa@redhat.com> - 2017-06-05 12:00 +0200
    Re: [PATCH v2 1/3] perf tools: Introduce dso__decompress_kmodule_{fd,path} Namhyung Kim <namhyung@kernel.org> - 2017-06-06 03:40 +0200

csiph-web