From mboxrd@z Thu Jan 1 00:00:00 1970 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-Google-Smtp-Source: AGHT+IF5C8VA/2fRM9kYCCLZlLqYGhV04AmlC3jYIEUQSGbODqh2QipiO9UBwoWd1lb4evyabaTWm6Kl+KluhMt+3Jw= 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) Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: quoted-printable 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 wr= ote: > > > > 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 ma= p *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) =3D=3D 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) =3D=3D 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=3D= ` */ > > -- > > 2.43.0.rc2.451.g8631bc7472-goog > >