Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1361790rdb; Wed, 6 Dec 2023 17:18:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPxSMuMnwJc8J4jSQfXEKpnVOzitggIT0O05VTwQ4vYlz8933M2PF67UZzgs8n+m8ESEKF X-Received: by 2002:a05:6808:6408:b0:3b8:b063:8268 with SMTP id fg8-20020a056808640800b003b8b0638268mr2327556oib.106.1701911881370; Wed, 06 Dec 2023 17:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701911881; cv=none; d=google.com; s=arc-20160816; b=MRdQtr/oytK3NRBnNrb9KE9Uany2lTjV9dGVayvyGUn9a8AUqr9HocyyKL1cJZvWUZ jtg5kzCp1s+AHptZAtrcY0NpKXBL7BZrDMrkOu+wVcr4bybXWL1QIiTN8ExmH7P0tJ0t yh2cVzGNO4Chnk9nnwuYqRvD3y1uuTYeL5Y4H6cSzPwRYMKEp8x8HfbdG0gNamHxbCK+ /5quCVr6rcVDN7UNLKYKzH/vqa+nTkHn4ChWD6+HZ9HOMoJ01y9ZFVZoPVIWTu6hvaVY vRAHWmFhzCQEfcXb1qfUgc3CSHI+2bjb15P74nxaliEm3nJ1RVJR+gIGJMmqgvQ7LQEP LJLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=JwUZYyK0Ujy/qNX/TFIi+04XnhZ1QaUR4WIBvLcrqEc=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=o+C2RXeC2lEkrkJ7nQa+4cHw190YrBRFiPcG4k6VUoD5KPDxoJSQHRT7oOiB9tDnzP 89Ye7g+g72ZVzIwqjLEivOuNf7QRRKKSen0N0uRmAzQmu7HeVdi6cOFAQMMzePovY3AB P5n1a+mKXY6ukM63P2ZcAAbV3Qrsv0m+tiOf9lJJFZ7ssjKW7YOeREld2StHe3u2C0Xi iVysg8nSi6fdhVrQZ4w1XomGdGKdygl7ZK5XofA91eV/VzcolOgQa64qXX8kth8ZXzYE xhZ49F+EhjJi7+lKkDZajgjyNwREn+HHKWwchDhTeRc10xvb/NiOZDowmtvLIVTiKus3 hoDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=av+IemWZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k9-20020a63ba09000000b0057e21f51ab3si192015pgf.665.2023.12.06.17.18.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 17:18:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=av+IemWZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id A034681C3940; Wed, 6 Dec 2023 17:17:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441985AbjLGBR0 (ORCPT + 99 others); Wed, 6 Dec 2023 20:17:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441968AbjLGBRY (ORCPT ); Wed, 6 Dec 2023 20:17:24 -0500 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 68F3F10D for ; Wed, 6 Dec 2023 17:17:30 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d7e7e10231so1128767b3.1 for ; Wed, 06 Dec 2023 17:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701911849; x=1702516649; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=JwUZYyK0Ujy/qNX/TFIi+04XnhZ1QaUR4WIBvLcrqEc=; b=av+IemWZ1ObNifkU9XUiDGYnbgA7KZxdubWFjauvMpPdmtrrEpccv3lLGrt4XC1sVd Zhu0Ul6FryaOfFSG2KLabjS9r2qNlPFE2cT2d7sViiDxThHn+0HFBF9umBj0qBm/MvY8 GCq7rJgTUfeQTkRMqYYap4RAydaUecwaibByJCVEktb6tZDPQxqolOoMIFEclm/rQEP7 7VB2X0j0WoSJROu1zwCOz01dRaB2zYOBb5nhhYDsg9rTyO7doG0WOdm5vfKdBOPAhgOC tmH/NBZSSEM0N9o/1fEmwN/ivoxeGmzoFNsIJIqkE3JsWWY+NT2UMIa1ydPz11Sjlj+8 WbFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701911849; x=1702516649; h=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=JwUZYyK0Ujy/qNX/TFIi+04XnhZ1QaUR4WIBvLcrqEc=; b=tzotBOy3w321oh+CewVHQn0c68Taz3Lv5GlWBgo7I4m1l4onUXPblZA5eBvSkf4/9K zcqOEO8JGkb+oWGXjOmtzHOdiCyDIn9C6giEP+F5onTAQVVDOVi8e1eOOZF4YcyMS3cE TJRnVhIJQSWJu1sirNIDF5SQVhcUkIla7s3lGvJ+rndMab8ukb/oKMMy/TiH3ysAG5tK ERVIr1sPAqjzxEMD8iwy4H8/maNrq3lbuUL7NYiyBNdHX0zMUXa+lD7WlmUsydjq2mSL d4puXCwB8kFqLE/NaAWuDrJwSuqzuPG/8lfT3KkdgS0qU9w21d1ny8HiOG2wRiAYYue3 hIgw== X-Gm-Message-State: AOJu0YxDsaY+aipl2BCjk+/MrF4DpCqB8yYenGEfGvMQezUiJDR891JP azfJekIuVdm+usEFigp6qRFcbxnZ3FRZ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:35bf:293e:7696:34e9]) (user=irogers job=sendgmr) by 2002:a81:b658:0:b0:5d3:ffa2:56ec with SMTP id h24-20020a81b658000000b005d3ffa256ecmr126424ywk.1.1701911849559; Wed, 06 Dec 2023 17:17:29 -0800 (PST) Date: Wed, 6 Dec 2023 17:16:35 -0800 In-Reply-To: <20231207011722.1220634-1-irogers@google.com> Message-Id: <20231207011722.1220634-2-irogers@google.com> Mime-Version: 1.0 References: <20231207011722.1220634-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Subject: [PATCH v6 01/47] perf map: Improve map/unmap parameter names From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , 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" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 17:17:53 -0800 (PST) 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) { 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) { 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