* [PATCH] perf tools: Remove misleading comments on map functions
@ 2024-02-08 18:10 Namhyung Kim
2024-02-08 18:59 ` Ian Rogers
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-02-08 18:10 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ian Rogers
Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
linux-perf-users
When it converts sample IP to or from objdump-capable one, there's a
comment saying that kernel modules have DSO_SPACE__USER. But commit
02213cec64bb ("perf maps: Mark module DSOs with kernel type") changed
it and makes the comment confusing. Let's get rid of it.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/map.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index cf5a15db3a1f..14a5ea70d81e 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -553,10 +553,6 @@ u64 map__rip_2objdump(struct map *map, u64 rip)
if (dso->rel)
return rip - map__pgoff(map);
- /*
- * kernel modules also have DSO_TYPE_USER in dso->kernel,
- * but all kernel modules are ET_REL, so won't get here.
- */
if (dso->kernel == DSO_SPACE__USER)
return rip + dso->text_offset;
@@ -585,10 +581,6 @@ u64 map__objdump_2mem(struct map *map, u64 ip)
if (dso->rel)
return map__unmap_ip(map, ip + map__pgoff(map));
- /*
- * kernel modules also have DSO_TYPE_USER in dso->kernel,
- * but all kernel modules are ET_REL, so won't get here.
- */
if (dso->kernel == DSO_SPACE__USER)
return map__unmap_ip(map, ip - dso->text_offset);
--
2.43.0.687.g38aa6559b0-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] perf tools: Remove misleading comments on map functions
2024-02-08 18:10 [PATCH] perf tools: Remove misleading comments on map functions Namhyung Kim
@ 2024-02-08 18:59 ` Ian Rogers
2024-02-08 19:29 ` Arnaldo Carvalho de Melo
2024-02-09 22:17 ` Namhyung Kim
2 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2024-02-08 18:59 UTC (permalink / raw)
To: Namhyung Kim
Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Adrian Hunter,
Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users
On Thu, Feb 8, 2024 at 10:10 AM Namhyung Kim <namhyung@kernel.org> wrote:
>
> When it converts sample IP to or from objdump-capable one, there's a
> comment saying that kernel modules have DSO_SPACE__USER. But commit
> 02213cec64bb ("perf maps: Mark module DSOs with kernel type") changed
> it and makes the comment confusing. Let's get rid of it.
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> ---
> tools/perf/util/map.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index cf5a15db3a1f..14a5ea70d81e 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -553,10 +553,6 @@ u64 map__rip_2objdump(struct map *map, u64 rip)
> if (dso->rel)
> return rip - map__pgoff(map);
>
> - /*
> - * kernel modules also have DSO_TYPE_USER in dso->kernel,
> - * but all kernel modules are ET_REL, so won't get here.
> - */
> if (dso->kernel == DSO_SPACE__USER)
> return rip + dso->text_offset;
>
> @@ -585,10 +581,6 @@ u64 map__objdump_2mem(struct map *map, u64 ip)
> if (dso->rel)
> return map__unmap_ip(map, ip + map__pgoff(map));
>
> - /*
> - * kernel modules also have DSO_TYPE_USER in dso->kernel,
> - * but all kernel modules are ET_REL, so won't get here.
> - */
> if (dso->kernel == DSO_SPACE__USER)
> return map__unmap_ip(map, ip - dso->text_offset);
>
> --
> 2.43.0.687.g38aa6559b0-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf tools: Remove misleading comments on map functions
2024-02-08 18:10 [PATCH] perf tools: Remove misleading comments on map functions Namhyung Kim
2024-02-08 18:59 ` Ian Rogers
@ 2024-02-08 19:29 ` Arnaldo Carvalho de Melo
2024-02-09 22:17 ` Namhyung Kim
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-02-08 19:29 UTC (permalink / raw)
To: Namhyung Kim
Cc: Ian Rogers, Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar,
LKML, linux-perf-users
On Thu, Feb 08, 2024 at 10:10:25AM -0800, Namhyung Kim wrote:
> When it converts sample IP to or from objdump-capable one, there's a
> comment saying that kernel modules have DSO_SPACE__USER. But commit
> 02213cec64bb ("perf maps: Mark module DSOs with kernel type") changed
> it and makes the comment confusing. Let's get rid of it.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Arnaldo
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/util/map.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index cf5a15db3a1f..14a5ea70d81e 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -553,10 +553,6 @@ u64 map__rip_2objdump(struct map *map, u64 rip)
> if (dso->rel)
> return rip - map__pgoff(map);
>
> - /*
> - * kernel modules also have DSO_TYPE_USER in dso->kernel,
> - * but all kernel modules are ET_REL, so won't get here.
> - */
> if (dso->kernel == DSO_SPACE__USER)
> return rip + dso->text_offset;
>
> @@ -585,10 +581,6 @@ u64 map__objdump_2mem(struct map *map, u64 ip)
> if (dso->rel)
> return map__unmap_ip(map, ip + map__pgoff(map));
>
> - /*
> - * kernel modules also have DSO_TYPE_USER in dso->kernel,
> - * but all kernel modules are ET_REL, so won't get here.
> - */
> if (dso->kernel == DSO_SPACE__USER)
> return map__unmap_ip(map, ip - dso->text_offset);
>
> --
> 2.43.0.687.g38aa6559b0-goog
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf tools: Remove misleading comments on map functions
2024-02-08 18:10 [PATCH] perf tools: Remove misleading comments on map functions Namhyung Kim
2024-02-08 18:59 ` Ian Rogers
2024-02-08 19:29 ` Arnaldo Carvalho de Melo
@ 2024-02-09 22:17 ` Namhyung Kim
2 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-02-09 22:17 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo, Ian Rogers
Cc: Ingo Molnar, Adrian Hunter, Peter Zijlstra, LKML, Jiri Olsa,
linux-perf-users
On Thu, 8 Feb 2024 10:10:25 -0800, Namhyung Kim wrote:
> When it converts sample IP to or from objdump-capable one, there's a
> comment saying that kernel modules have DSO_SPACE__USER. But commit
> 02213cec64bb ("perf maps: Mark module DSOs with kernel type") changed
> it and makes the comment confusing. Let's get rid of it.
>
>
Applied perf-tools-next, thanks!
Best regards,
--
Namhyung Kim <namhyung@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-09 22:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 18:10 [PATCH] perf tools: Remove misleading comments on map functions Namhyung Kim
2024-02-08 18:59 ` Ian Rogers
2024-02-08 19:29 ` Arnaldo Carvalho de Melo
2024-02-09 22:17 ` Namhyung Kim
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).