mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org,
	irogers@google.com, kan.liang@linux.intel.com,
	peterz@infradead.org, mark.rutland@arm.com, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, james.clark@arm.com,
	german.gomez@arm.com, leo.yan@linaro.org,
	alexey.v.bayduraev@linux.intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	sandipan.das@amd.com, ananth.narayan@amd.com,
	santosh.shukla@amd.com, Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [RFC 3/4] perf tool: Introduce PERF_RECORD_KMOD_SEC_MAP
Date: Mon, 16 Jan 2023 19:04:12 +0530	[thread overview]
Message-ID: <437ccc68-e07f-de9a-4a0d-602b0d8189dd@amd.com> (raw)
In-Reply-To: <cbcb6109-0c23-9270-a534-c4fabdddfbbc@intel.com>

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

  reply	other threads:[~2023-01-16 13:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10  5:58 [RFC 0/4] perf tool: Fix non-".text" symbol resolution for kernel modules Ravi Bangoria
2023-01-10  5:58 ` [RFC 1/4] perf tool: Simplify machine__create_modules() a bit Ravi Bangoria
2023-01-10  5:58 ` [RFC 2/4] perf tool: Refactor perf_event__synthesize_modules() Ravi Bangoria
2023-01-10  5:58 ` [RFC 3/4] perf tool: Introduce PERF_RECORD_KMOD_SEC_MAP Ravi Bangoria
2023-01-16  6:14   ` Adrian Hunter
2023-01-16 13:34     ` Ravi Bangoria [this message]
2023-01-10  5:58 ` [RFC 4/4] perf tool: Fix non-".text" symbol resolution for kernel modules Ravi Bangoria
2023-02-07  7:35   ` kernel test robot
2023-01-10  6:35 ` [RFC 0/4] " Adrian Hunter
2023-01-10  8:43   ` Ravi Bangoria
2023-01-10  8:58     ` Ravi Bangoria
2023-01-16  4:21 ` Ravi Bangoria

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=437ccc68-e07f-de9a-4a0d-602b0d8189dd@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.v.bayduraev@linux.intel.com \
    --cc=ananth.narayan@amd.com \
    --cc=german.gomez@arm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    /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

all inboxes | Powered by JetHome®