Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4312848rdb; Mon, 11 Dec 2023 15:52:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeBQ5m8Ltw7iWHkSmwSW9rT0zXkQwNiG3DUYuPe7xr9ds9Hfmd3VF5H0AdtpRALPn7awa2 X-Received: by 2002:a05:6a20:9751:b0:190:c761:97a6 with SMTP id hs17-20020a056a20975100b00190c76197a6mr3439535pzc.42.1702338761020; Mon, 11 Dec 2023 15:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702338761; cv=none; d=google.com; s=arc-20160816; b=szyGf/CG8dwsUDLt8GJf5G5JSq2Vty4Vx0TM1v8BtiTy3Iny4Jp9Fk7h35uwy+f9yB 5l2Yj/zkygKuy6anjqC8UTjs8Bem9k8VKeX5p9e7iuajfpocJ++ih9HIHinaZlHOqYeT tykDG/xUJ0OFUfEB13r3uGxhoRab1rwWeYe2AklSuhfzKagum/Ed/RgdafKy69xM6nBc TPBjwUjZMPO4PgiKBiVOptbLSSf+pbZW7JJr59PR7hgWh0BPSQhyKUwFERM+vdSNTvtr NWc0yt3ZZnbKaXQUUk50rth+A0L3Ur2HvkTjqbieWcJfAQVX2yEPT+mdFE2SQgPjRGBo PUmA== 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 :dkim-signature; bh=lmlX5QGQE6gjvCh0QJ4AiLgcXStLjnVB79eHCrcfOEw=; fh=zt+aMtm74o2VDnWd+fyn50LeDgsHvuUMqskurVhx6uc=; b=oATZ5BOhSRNUWlxnzGmR1Lmpsh8NjCVNKl8CWskeWMaEcwp6skCg7NErPlGiSJfPbf zM6A1jES+OjEMbNVzHsTC/7THpoNLrS7jcA/kVQvzuwxIOtRHbiU/kY4bpJERjhYwm0D nlTfwCCzm4sX2HPQJ9qQx8i6FmG3fzHbhqUflZVf4PyfVY1D7ikASHxRjk7jywQJqeml N8yx2BARRg1NySxD+eu5jTfhVckRxkkqZY+A3TrFVfY3szXzi3ib5vLDPWW0c5AGLMk8 mDgbsnn6lu+wOMr+SnXDEB1WsoRRbTVhpJNgGm/n/D2drt6qEP6ve9+Wx3yIeRdqjMmi GzIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Ztgx1Am/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q10-20020a056a00084a00b006cef51f51basi4610890pfk.300.2023.12.11.15.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 15:52:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Ztgx1Am/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 141A3804E886; Mon, 11 Dec 2023 15:52:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345413AbjLKXw2 (ORCPT + 99 others); Mon, 11 Dec 2023 18:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345163AbjLKXw1 (ORCPT ); Mon, 11 Dec 2023 18:52:27 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA729B for ; Mon, 11 Dec 2023 15:52:33 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50beed2a46eso1565e87.0 for ; Mon, 11 Dec 2023 15:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702338751; x=1702943551; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lmlX5QGQE6gjvCh0QJ4AiLgcXStLjnVB79eHCrcfOEw=; b=Ztgx1Am/uCKmUJaHxZC3h1WW0RBFy3ogyj3hPJAr/aloFookgoKj4UrlyQMgc45B4s 4F6ohAwg2LWGiUfBiM3lOl5FHTTj+axQQ8bcd2rmNxF4PGjSi/tsMtev48JX+Hw+g7mt /LCQ2+I2eCN05lGmDm+p4e9qbb8vCbOorxBr11/NRFIJ4zK1T49OMejokiDtiN+b6ise zUv7cEhwmFuciof79KBcz0KSXwNCnIShK3ZwtHBYpsrvi37r0EAwieQS86yo/zdGkEV4 8y2dybrs7fCKCd5CyKFqOvAnBnDYfur4iRsg0hJ87tzA9KFaPjP+sj5sW+G34L+ga84c fNWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702338751; x=1702943551; 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=lmlX5QGQE6gjvCh0QJ4AiLgcXStLjnVB79eHCrcfOEw=; b=FkKeJtRP0HmGZBgsMHehqmGcmoB9M05sI0n2G2CVJ0F+s+JokvZXtXqp4k69IlJuFS e+8sW0vn2YdBP4Is5qfwJkhDffYgatqCFHjAQFKD0K55/rLiJGMCdiK90QWfjyWhlhiO 2sf6MenEypyuBKUzBbJLjusxgke2jqOVFnTQZ4Eues9xxd8ODc/TNnpxtPzp7fNLQW5h tubpxJ9auNSWWH8nP01nELknbWDGarMiq/1OnR6ix25WwoHSB6A1Xb2hZkur18bGPtuo AzbafibxgDDhjyd8U7oUTcJHa9rcuY2OqNatLy3KU1kjKIFQ2dFjutgmseVCgOmIMc46 rysw== X-Gm-Message-State: AOJu0Yw16fnBM4A6+hqYyO7vIHr7b0t0Ux0nIC+ySDiNGFbSn6l40OLr cJ7P0IHrodVEbHL4XVZ9S28kdoF82ZTG+SSMQxFb1g== X-Received: by 2002:a19:4f07:0:b0:50b:fcb7:15af with SMTP id d7-20020a194f07000000b0050bfcb715afmr168488lfb.3.1702338751256; Mon, 11 Dec 2023 15:52:31 -0800 (PST) MIME-Version: 1.0 References: <20231207011722.1220634-1-irogers@google.com> <20231207011722.1220634-2-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 11 Dec 2023 15:52:19 -0800 Message-ID: Subject: Re: [PATCH v6 01/47] perf map: Improve map/unmap parameter names To: Namhyung Kim 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: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 15:52:40 -0800 (PST) On Mon, Dec 11, 2023 at 3:39=E2=80=AFPM Namhyung Kim = wrote: > > On Mon, Dec 11, 2023 at 3:38=E2=80=AFPM Namhyung Kim wrote: > > > > On Wed, Dec 6, 2023 at 5:17=E2=80=AFPM 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'? > > Oh.. I think it should be 'ip'. But sometimes it is an ip and sometimes it is an rip, hence the long name. I don't think this really affects much so I'd prefer to stick with the intention revealing name if possible. Thanks, Ian > > > > > { > > > if ((RC_CHK_ACCESS(map)->mapping_type) =3D=3D MAPPING_TYPE__D= SO) > > > - 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) =3D=3D MAPPING_TYPE__D= SO) > > > - 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= =3D` */ > > > -- > > > 2.43.0.rc2.451.g8631bc7472-goog > > >