[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <437ccc68-e07f-de9a-4a0d-602b0d8189dd@amd.com>
Date: Mon, 16 Jan 2023 19:04:12 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: acme@...nel.org, jolsa@...nel.org, namhyung@...nel.org,
irogers@...gle.com, kan.liang@...ux.intel.com,
peterz@...radead.org, mark.rutland@....com, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, james.clark@....com,
german.gomez@....com, leo.yan@...aro.org,
alexey.v.bayduraev@...ux.intel.com,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
sandipan.das@....com, ananth.narayan@....com,
santosh.shukla@....com, Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [RFC 3/4] perf tool: Introduce PERF_RECORD_KMOD_SEC_MAP
Hi Adrian,
On 16-Jan-23 11:44 AM, Adrian Hunter wrote:
> On 10/01/23 07:58, Ravi Bangoria wrote:
>> Introduce, perf tool only, synthetic event type PERF_RECORD_KMOD_SEC_MAP.
>> Also add stub code for it. This event will be used to save/restore kernel
>> module section maps to/from perf.data file. This is needed because kernel
>> module elfs does not contain program header table and thus there is no
>> easy way to find out how kernel would have loaded module sections in the
>> memory.
>
> Currently machine__addnew_module_map() adds a map for a
> module, and then perf_event__synthesize_modules() creates
> an MMAP/MMAP2 event for it. Why can't we do that for the
> sections?
Do you mean why not use MMAP/MMAP2 for module sections as well?
I thought about that but:
- PERF_RECORD_MMAP has no field which can help segregate normal vs section
specific maps.
- I can probably introduce special MAP_ flag and use PERF_RECORD_MMAP2. But
that flag will be non-standard (perf tool only), which is ugly.
- I also need additional hacks while synthesizing section specific MMAP/
MMAP2 (e.g.: store section name and file path in filename[]) and similar
hacks while parsing them at perf report time.
So I felt introducing PERF_RECORD_KMOD_SEC_MAP is relatively cleaner approach.
Thanks,
Ravi
Powered by blists - more mailing lists