Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4308298rdb; Mon, 11 Dec 2023 15:39:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkeh/fjX02UyBzJMj6ThF+7hH+68dbzVBSqIjA1zd7BY8B9JO+s8rgj1PI6LDwwNkuzoJI X-Received: by 2002:a05:6a00:1889:b0:6c6:2885:82c7 with SMTP id x9-20020a056a00188900b006c6288582c7mr5032446pfh.25.1702337989645; Mon, 11 Dec 2023 15:39:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702337989; cv=none; d=google.com; s=arc-20160816; b=m4d/CI0VhCXt5WY3iH9oSIaDBdN0+OVJQ36TMAqNz18RV6xJytDI+/fxrN9kEDmAYM EqAms4zkGELGbUgV4psA+gB1s2Xut1IppRwdcbKFEuLWGpKVNYtcxzfCjPSBeTR+TigC bKC1LoCNIs/kPLvTqyDX8WXpAcG6KGCiaUxlQdw4NymnssK3NVFlFGMWEiqt3s1EpzFc E6LJ6sQbjrWb7S6W42jMK6DJ5eFEpmFKKk85C4Q2mGlfdmkE5Nz4toBFEw3bplSZ7hbN F4UoBgyIOnyfaBmTLFFXZs/MyuZw+g8eDbyjIx+CNUfoYNDrEYUTG+T56fClUTsNbSl8 yXog== 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=Gv4uyzyzlGD6gqyGfCke+hc/EL3oTlESGPRC9eI+9QM=; fh=aWa9tyepd0GWyBFjkZa5ys7uNwpZ1AjfSj0Mu1iuQbE=; b=v842onTbv0QbhKzG93BDQ5yClc6P/aH8vNgq0nsOM9Q+YAJcHfeMMF/2l8iJ3JMUrd w2XEpnv0/c3jwiCQ5H0eg+51rfYFl51eZZA2pg9RENN7pNmqGF9NSyndd2E6+u0hl6ky 7GntRaLnmQf2LKjqc3+RpIohd8/hgt5OLDpBVug3oEBYWZtbuMBTttYUJsIET8FlbrGa lXBX/PFustpyzpS70QGeLqwngv7z2CTo++PjjSZgbeERRDXUSjdOx+FyJWkYehls3P70 F3NbNqbgIzm+8HqdX9RMmdMpUEwPEaaqWVPdzpRYLlkq/rQrdbktZqPnBD5kTLZijwlJ h3Ig== 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 d11-20020a056a00244b00b006cbf2bc6eaesi6804904pfj.188.2023.12.11.15.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 15:39:49 -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 8B24D809A7B9; Mon, 11 Dec 2023 15:39:46 -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 S1345164AbjLKXjU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Dec 2023 18:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjLKXjS (ORCPT ); Mon, 11 Dec 2023 18:39:18 -0500 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878A1CB; Mon, 11 Dec 2023 15:39:25 -0800 (PST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d053c45897so44436645ad.2; Mon, 11 Dec 2023 15:39:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702337965; x=1702942765; 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=2Ej4vpm5j5oJxsSNlbT7DL94C7tipsVRUtuspta96IQ=; b=dH8TVsb0lt7V6sblebmV2m142PsYXE9zQseF0rXFemJKfNQfjDIj8058ccVL71mkz9 hs6+bvJtD2JjA0Ur+KNpYXXoj3Jq2Iu7K8s0YHqsECHUPk88EkBiji8iH1k3kbbmr5qf RsZis7ZiMp39urLwGTeBTeHL/qqlnpbiKUAqee2otBqcVweWPqxTzUMXnZnptDKS8W4C 3SYBEhYreQBs+iFDypSlFlESZWJO/5QROOgReHX5SagcIiYI62Vljj1WO7YcT1dxerg5 yuS7+mAbHV1DIjc8wRAwVfYAH/WQDmyFhL+hoWc7HGnlDll7yEFaRelQVy/CmXvL19wH nSWw== X-Gm-Message-State: AOJu0Yx67q1O0Tp1+vtUfW8eIwEDyrCQtl1QnFGrkiM6Ss9VprJ6OKle FM5jVnFIf9OvoAqgDAYeVH9AlliUshC0CztojKM= X-Received: by 2002:a17:902:9a0a:b0:1d0:6ffd:9e1c with SMTP id v10-20020a1709029a0a00b001d06ffd9e1cmr4828110plp.110.1702337964847; Mon, 11 Dec 2023 15:39:24 -0800 (PST) MIME-Version: 1.0 References: <20231207011722.1220634-1-irogers@google.com> <20231207011722.1220634-2-irogers@google.com> In-Reply-To: From: Namhyung Kim Date: Mon, 11 Dec 2023 15:39:13 -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:46 -0800 (PST) On Mon, Dec 11, 2023 at 3:38 PM Namhyung Kim wrote: > > 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'? Oh.. I think it should be 'ip'. > > > { > > 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 > >