Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4308098rdb; Mon, 11 Dec 2023 15:39:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOJqD576lWgS7n9oD8xa4Af9ZJAoCQxCjEuevHada0KdAWoGbGoTMnVeMHaEn1bTVYxHbr X-Received: by 2002:a05:6a20:914f:b0:190:37a0:f343 with SMTP id x15-20020a056a20914f00b0019037a0f343mr7386869pzc.34.1702337950219; Mon, 11 Dec 2023 15:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702337950; cv=none; d=google.com; s=arc-20160816; b=m3ImZ2AyVuuAJjva1jdhkVx2vZrvg5oT4RykUIu4rt8xz6n/7MMPcHIv84pxL6b+sv Oci/zv5lTr3CBmtZFnbP9XoSlI/hY25BNu33xG0IOCDlP8NV58APYt8mEUczBCiOS+0F 6CwjsG9qgTuEWlWlxoKtlMGVUrMCwV0Qg79zmbF6q9NPAosuQB7xqAk1JDyfKUtw8Dzh j27N2UsMR2Dt/4uxQ1f67sMoCpgOkwOJ9HwaIe8s4rxYnXleeMXYBuH0s7nkITkb2051 D2nwPNJRy/A/yETj3iLDpPNXKwE+vySweFssbuqilneTTH0qlNmG+l1Xs+5u6xDYctMB gigg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=8T083SMK6t8/JtCrgwFqqlubPbLx/4ARxHmdGqF78+0=; fh=aWa9tyepd0GWyBFjkZa5ys7uNwpZ1AjfSj0Mu1iuQbE=; b=ffL2ShtVMEU6JOKPjPYT3LF1O3tgUjT4+MzN3obsPxVaJNo7h6f8Jt1E8ehkpJjWuQ Q255Q/cUgqtF+qXJxuDrbjFOgAMbej16EILAyddVawOHi/h3k6eVjSBYDQl0LAIHkjtP 0Ut8U7FQfW3vP00LgTrkoXVhuE7UvQWEM/jGMeliu1pwzl04zxf1tw7C3j/KRZLF6jvh tB/EA7oxhbC7YBp4TKXOM4p81mwrh/D6yC9INDK1erAn9ajP6EP14PBF+VVtOGWAQBHl b7xPkV96xqCOHjkUYONpgUQ7GiJ1UPUNeBFT4eyxhwrnf11ItiuzIZdLy9uz07aWfK6+ Iapw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id k82-20020a628455000000b006ce97669ffcsi6812608pfd.387.2023.12.11.15.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 15:39:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BD54E809A7B1; Mon, 11 Dec 2023 15:39:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345163AbjLKXiY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Dec 2023 18:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjLKXiW (ORCPT ); Mon, 11 Dec 2023 18:38:22 -0500 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F749CB; Mon, 11 Dec 2023 15:38:29 -0800 (PST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-5c66b093b86so4569315a12.0; Mon, 11 Dec 2023 15:38:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702337909; x=1702942709; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BHpTfcyEiSTL+Iiy4h09/0w/ff7Mj2tSbGaHW/cYLyA=; b=T2Kwi0LCSCwD/ZpCvx58zqth91J+IUDNe5Ys9tf9uYJaAaSpKZ0PMXqEwECQI6sa0E 5OoT3dhnH0y3Am8DCNtuCCCAq55ho+Aw/ERg98cZLhfvnLp29nAqq28B9R3ylaPryk8x dsE4MUOkm1pul/f/oYEfHDokX41fd8l+ISgHathEEO43Uthg5wYcwj2o0h4pmeqdx8qD Du4AKHV0HnY7QkYjuPCso8Cuob+zblECT+Lp9mLHzqTbAxG5pw+6OcmrQ14G/jk4Lagl LW34/4fqsn2lwf/HD/I2qlAMQ+JSl7ZD1NgUM4kBJAA5R9JL3/DmGL918smqpROV3mMe kucA== X-Gm-Message-State: AOJu0YzgXBwycHTZfHhaFZ3j+hJmuo1DPHJlKwI35zr9ohg7oaYmCJnU ZK5HEcXy9NM6IcepJkz5stGZtRnUwvxHWkOndT8= X-Received: by 2002:a17:90a:5b08:b0:286:9212:a7cf with SMTP id o8-20020a17090a5b0800b002869212a7cfmr5765857pji.44.1702337908760; Mon, 11 Dec 2023 15:38:28 -0800 (PST) MIME-Version: 1.0 References: <20231207011722.1220634-1-irogers@google.com> <20231207011722.1220634-2-irogers@google.com> In-Reply-To: <20231207011722.1220634-2-irogers@google.com> From: Namhyung Kim Date: Mon, 11 Dec 2023 15:38:17 -0800 Message-ID: Subject: Re: [PATCH v6 01/47] perf map: Improve map/unmap parameter names To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Guilherme Amadio Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 15:39:07 -0800 (PST) On Wed, Dec 6, 2023 at 5:17 PM Ian Rogers wrote: > > The u64 values are either absolute or relative, try to hint better in > the parameter names. > > Suggested-by: Namhyung Kim > Signed-off-by: Ian Rogers > --- > tools/perf/util/map.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h > index 3a3b7757da5f..49756716cb13 100644 > --- a/tools/perf/util/map.h > +++ b/tools/perf/util/map.h > @@ -105,25 +105,25 @@ static inline u64 map__dso_map_ip(const struct map *map, u64 ip) > } > > /* dso rip -> ip */ > -static inline u64 map__dso_unmap_ip(const struct map *map, u64 ip) > +static inline u64 map__dso_unmap_ip(const struct map *map, u64 rip) > { > - return ip + map__start(map) - map__pgoff(map); > + return rip + map__start(map) - map__pgoff(map); > } > > -static inline u64 map__map_ip(const struct map *map, u64 ip) > +static inline u64 map__map_ip(const struct map *map, u64 ip_or_rip) I'm afraid it's gonna be more confusing. Can we say just 'rip'? > { > if ((RC_CHK_ACCESS(map)->mapping_type) == MAPPING_TYPE__DSO) > - return map__dso_map_ip(map, ip); > + return map__dso_map_ip(map, ip_or_rip); > else > - return ip; > + return ip_or_rip; > } > > -static inline u64 map__unmap_ip(const struct map *map, u64 ip) > +static inline u64 map__unmap_ip(const struct map *map, u64 ip_or_rip) Ditto. Thanks, Namhyung > { > if ((RC_CHK_ACCESS(map)->mapping_type) == MAPPING_TYPE__DSO) > - return map__dso_unmap_ip(map, ip); > + return map__dso_unmap_ip(map, ip_or_rip); > else > - return ip; > + return ip_or_rip; > } > > /* rip/ip <-> addr suitable for passing to `objdump --start-address=` */ > -- > 2.43.0.rc2.451.g8631bc7472-goog >