From: Leo Yan <leo.yan@arm.com>
To: Steve Clevenger <scclevenger@os.amperecomputing.com>,
james.clark@linaro.org, mike.leach@linaro.org
Cc: suzuki.poulose@arm.com, ilkka@os.amperecomputing.com,
coresight@lists.linaro.org, linux-perf-users@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V4 2/4] Force MAPPING_TYPE__IDENTIY for PIE
Date: Wed, 28 Aug 2024 09:26:02 +0100 [thread overview]
Message-ID: <63879f18-4176-4e61-acd8-1cd7f13dbd12@arm.com> (raw)
In-Reply-To: <05faf8cf48948cdadcf3757eb5fc0305497805c6.1724820993.git.scclevenger@os.amperecomputing.com>
On 8/28/2024 6:09 AM, Steve Clevenger wrote:
>
> Use dso__is_pie() to check whether the DSO file is a Position
> Independent Executable (PIE). If PIE, change the MAPPING_TYPE to
> MAPPING_TYPE__IDENTITY so a zero map pgoff (text offset) is passed
> into the script.
>
> Signed-off-by: Steve Clevenger <scclevenger@os.amperecomputing.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/perf/util/map.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index e781c8d56a9a..c846faec177b 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -173,8 +173,8 @@ struct map *map__new(struct machine *machine, u64 start, u64 len,
> assert(!dso__kernel(dso));
> map__init(result, start, start + len, pgoff, dso, prot, flags);
>
> - if (anon || no_dso) {
> - map->mapping_type = MAPPING_TYPE__IDENTITY;
> + if (anon || no_dso || dso__is_pie(dso)) {
> + map__set_mapping_type(map, MAPPING_TYPE__IDENTITY);
>
> /*
> * Set memory without DSO as loaded. All map__find_*
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-08-28 8:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 5:09 [PATCH V4 0/4] arm-cs-trace-disasm.py/perf must accommodate non-zero DSO text offset Steve Clevenger
2024-08-28 5:09 ` [PATCH V4 4/4] Adjust objdump start/end range per map pgoff parameter Steve Clevenger
2024-08-28 8:46 ` Leo Yan
2024-08-28 5:09 ` [PATCH V4 3/4] Add map pgoff to python dictionary based on MAPPING_TYPE Steve Clevenger
2024-08-28 8:44 ` Leo Yan
2024-08-28 21:26 ` Steve Clevenger
2024-08-28 5:09 ` [PATCH V4 2/4] Force MAPPING_TYPE__IDENTIY for PIE Steve Clevenger
2024-08-28 8:26 ` Leo Yan [this message]
2024-08-28 5:09 ` [PATCH V4 1/4] Add dso__is_pie call to identify ELF PIE Steve Clevenger
2024-08-28 8:23 ` Leo Yan
2024-08-28 15:48 ` Steve Clevenger
2024-08-28 20:34 ` Leo Yan
2024-08-28 20:36 ` Leo Yan
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=63879f18-4176-4e61-acd8-1cd7f13dbd12@arm.com \
--to=leo.yan@arm.com \
--cc=coresight@lists.linaro.org \
--cc=ilkka@os.amperecomputing.com \
--cc=james.clark@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=scclevenger@os.amperecomputing.com \
--cc=suzuki.poulose@arm.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;
as well as URLs for NNTP newsgroup(s).