From nobody Wed Feb 11 02:06:48 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16499C7618A for ; Mon, 20 Mar 2023 03:41:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjCTDlj (ORCPT ); Sun, 19 Mar 2023 23:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjCTDka (ORCPT ); Sun, 19 Mar 2023 23:40:30 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CC7F222CB for ; Sun, 19 Mar 2023 20:40:03 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-536d63d17dbso110903927b3.22 for ; Sun, 19 Mar 2023 20:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679283602; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=y10GnXOzH9U5tz9iFzVskmw05u/+9XHwA2jBfRW8OlY=; b=ZVomonjoLY0q9cKdr2OeubslSy7rduq4h3LiVMua2Gtaz59IYf5m+BA8wv2jSvHAg7 zchoBdhKIKx10hwDg4H7G+QooFben/vb8LlkZ7WxU3cM0HBeiIpfBH7jx/wJ3/GeJRf3 QCtTlBh7WNawAtlg3vU2cn1wwaZ7zNWj+hDW4I/w7bL4PjmnWmzwMK0Zgb2u+XhJCAMP KvoKYDrSfRGfm7D5btbJMtr4S+LaDe4pJrZ4vfZ0CyWncVxCLSe881h2FMRo/jzEMGIh thzdx+ZBqqThRLq9733OkQO4mYFxGanzGSoAPvUELix9bQeIDNFTbAGnRAde5wYK5X2m 8VoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679283602; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y10GnXOzH9U5tz9iFzVskmw05u/+9XHwA2jBfRW8OlY=; b=N7QBBTMPBKRbk++tK449tE1KlAGxVORA/KIX4KGG8pxyG8fW9N2gmsK9RJ4xAB7AVk bpW58m+efJOKhBQNecqvNc7bsbuXiFpiKgyF4Jadr16esuS79pimtSd5/4ERRSZiSl1K w7yHJj8nIbAhGbiIqDvcpweet5fKlUVVyPca0LTUVw2X7r24o2lTHYE6Whs88HqySZWr wSHvk3Yk0vNQoYiIHwZDZ8uD8FqNeLufZW5aS1KFK4XrJkm/KF4umMUjPHw/+kgO3bQN 8g8odfXiypJzv9xmLnGt17MbaC9jtXenQFExaY3BwWjjhT6m/70JntlcyUe/wAi+tsqb xjEg== X-Gm-Message-State: AO0yUKW7lf5WT/h7Q6l7lRh1mbXI7xyd3p4DlvT5+1aTVf2UujCGlB40 8v2WMeXsfGOocCJ4yXIhlzxtORhdf8X7 X-Google-Smtp-Source: AK7set9e1ValGvdqpgqK0HZEf9ILOBrsd3K4MJU9K9TX6KJorK+AA56T5qrbfDEWWrQXxR5Q8Xe8V+p1W+mg X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:1895:9fa0:27f5:cb71]) (user=irogers job=sendgmr) by 2002:a05:6902:723:b0:b6a:2590:6c63 with SMTP id l3-20020a056902072300b00b6a25906c63mr3762098ybt.2.1679283601785; Sun, 19 Mar 2023 20:40:01 -0700 (PDT) Date: Sun, 19 Mar 2023 20:37:59 -0700 In-Reply-To: <20230320033810.980165-1-irogers@google.com> Message-Id: <20230320033810.980165-12-irogers@google.com> Mime-Version: 1.0 References: <20230320033810.980165-1-irogers@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Subject: [PATCH v4 11/22] perf map: Rename map_ip and unmap_ip From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Darren Hart , Davidlohr Bueso , "=?UTF-8?q?Andr=C3=A9=20Almeida?=" , James Clark , John Garry , Riccardo Mancini , Yury Norov , Andy Shevchenko , Andrew Morton , Adrian Hunter , Leo Yan , Andi Kleen , Thomas Richter , Kan Liang , Madhavan Srinivasan , Shunsuke Nakamura , Song Liu , Masami Hiramatsu , Steven Rostedt , Miaoqian Lin , Stephen Brennan , Kajol Jain , Alexey Bayduraev , German Gomez , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Dumazet , Dmitry Vyukov , Hao Luo Cc: Stephane Eranian , Ian Rogers Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add dso to match comment. This avoids a naming conflict with later added accessor functions for variables in struct map. Signed-off-by: Ian Rogers --- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-script.c | 4 ++-- tools/perf/util/machine.c | 4 ++-- tools/perf/util/map.c | 8 ++++---- tools/perf/util/map.h | 4 ++-- tools/perf/util/symbol-elf.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index f3029742b800..4d4b770a401c 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -423,7 +423,7 @@ static u64 find_callsite(struct evsel *evsel, struct pe= rf_sample *sample) if (!caller) { /* found */ if (node->ms.map) - addr =3D map__unmap_ip(node->ms.map, node->ip); + addr =3D map__dso_unmap_ip(node->ms.map, node->ip); else addr =3D node->ip; =20 diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index eb49689d0f00..21944adf4c17 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1012,11 +1012,11 @@ static int perf_sample__fprintf_brstackoff(struct p= erf_sample *sample, =20 if (thread__find_map_fb(thread, sample->cpumode, from, &alf) && !map__dso(alf.map)->adjust_symbols) - from =3D map__map_ip(alf.map, from); + from =3D map__dso_map_ip(alf.map, from); =20 if (thread__find_map_fb(thread, sample->cpumode, to, &alt) && !map__dso(alt.map)->adjust_symbols) - to =3D map__map_ip(alt.map, to); + to =3D map__dso_map_ip(alt.map, to); =20 printed +=3D fprintf(fp, " 0x%"PRIx64, from); if (PRINT_FIELD(DSO)) { diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 08fb3ab0c205..5bf035b23a79 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -3053,7 +3053,7 @@ static int append_inlines(struct callchain_cursor *cu= rsor, struct map_symbol *ms if (!symbol_conf.inline_name || !map || !sym) return ret; =20 - addr =3D map__map_ip(map, ip); + addr =3D map__dso_map_ip(map, ip); addr =3D map__rip_2objdump(map, addr); dso =3D map__dso(map); =20 @@ -3098,7 +3098,7 @@ static int unwind_entry(struct unwind_entry *entry, v= oid *arg) * its corresponding binary. */ if (entry->ms.map) - addr =3D map__map_ip(entry->ms.map, entry->ip); + addr =3D map__dso_map_ip(entry->ms.map, entry->ip); =20 srcline =3D callchain_srcline(&entry->ms, addr); return callchain_cursor_append(cursor, entry->ip, &entry->ms, diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 416fc449bde8..d97a6d20626f 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -109,8 +109,8 @@ void map__init(struct map *map, u64 start, u64 end, u64= pgoff, struct dso *dso) map->pgoff =3D pgoff; map->reloc =3D 0; map->dso =3D dso__get(dso); - map->map_ip =3D map__map_ip; - map->unmap_ip =3D map__unmap_ip; + map->map_ip =3D map__dso_map_ip; + map->unmap_ip =3D map__dso_unmap_ip; map->erange_warned =3D false; refcount_set(&map->refcnt, 1); } @@ -590,12 +590,12 @@ struct maps *map__kmaps(struct map *map) return kmap->kmaps; } =20 -u64 map__map_ip(const struct map *map, u64 ip) +u64 map__dso_map_ip(const struct map *map, u64 ip) { return ip - map__start(map) + map->pgoff; } =20 -u64 map__unmap_ip(const struct map *map, u64 ip) +u64 map__dso_unmap_ip(const struct map *map, u64 ip) { return ip + map__start(map) - map->pgoff; } diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 16646b94fa3a..9b0a84e46e48 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -41,9 +41,9 @@ struct kmap *map__kmap(struct map *map); struct maps *map__kmaps(struct map *map); =20 /* ip -> dso rip */ -u64 map__map_ip(const struct map *map, u64 ip); +u64 map__dso_map_ip(const struct map *map, u64 ip); /* dso rip -> ip */ -u64 map__unmap_ip(const struct map *map, u64 ip); +u64 map__dso_unmap_ip(const struct map *map, u64 ip); /* Returns ip */ u64 identity__map_ip(const struct map *map __maybe_unused, u64 ip); =20 diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 0542985ecaf6..93ae3f22fd03 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1351,8 +1351,8 @@ static int dso__process_kernel_symbol(struct dso *dso= , struct map *map, map->start =3D shdr->sh_addr + ref_reloc(kmap); map->end =3D map__start(map) + shdr->sh_size; map->pgoff =3D shdr->sh_offset; - map->map_ip =3D map__map_ip; - map->unmap_ip =3D map__unmap_ip; + map->map_ip =3D map__dso_map_ip; + map->unmap_ip =3D map__dso_unmap_ip; /* Ensure maps are correctly ordered */ if (kmaps) { int err; --=20 2.40.0.rc1.284.g88254d51c5-goog