Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp558816rdh; Wed, 7 Feb 2024 12:43:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGr7jPpFdDLTcCJalpp5MisCmblea0aybGxDI92s2HvZ6JZZcgZEOkTNMT/caPiX9jsj6p/ X-Received: by 2002:a17:906:f0cb:b0:a38:8b64:c8f4 with SMTP id dk11-20020a170906f0cb00b00a388b64c8f4mr1772925ejb.70.1707338620516; Wed, 07 Feb 2024 12:43:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707338620; cv=pass; d=google.com; s=arc-20160816; b=nFYmQ2zYN7pssOuDWmMnFo7moWRiqf+BCmbdlW3FTO6Q/mC7SoW01KSGWbe8YTHo+l 57+B4xEQ8UbW7kjjb8OYk8qaXujfURKq99eTtyjovLV39NnRLOoq+X8i1g+sYrFdoomF 8ceWEBvR3r62iEC8INokATy7ZhtuqSnfMBeoWHtWkpPxjlje6uHZmEXAedUo3n+iEq4/ 7+GuR5fgeRuNEC23jvDtACbrwprSOAuiJXx7+nJ4yrkfaiQsBuyxzp6PQAfYJXhVfuA5 SCytfTzjSYZSUY0D15HWi3/SnQXR5gLPx4NI9g7kd2QWpYXEnCcQiYrqtTAtzW/aSToE vMqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=SR135J3otmhqAafGVl5D5NnoHYrYuXrRvaKntsyJrCo=; fh=iBsujGZxTinDdpnOLqij7SOGYHam+q4fBeSpZqvaJxo=; b=wDN8FOzJC6uj5hBL4eeDa5DFGZ0MBzC2N4cGbRxEhumP7wXLgYzP2z+h+IOo6FHqFL oHhZFpZcnDzfO7G5Q7E70LaU1+OsXZ+XOzdig7B6kyTi93hvFwc7uVnoyLzKDFuNI4zn sAeJ1oepFSPxg9RatUapWEdYxTdlFjCz/h0Y4fpM4uTGCUjo8Zkj+EJKJOImcesbBBdT d9fwl6JbRNBXcqkpHT4i6RyJqyQ3WLUFgLZTLvIAtlE1t3fafCdoNZmhza0oIBRJ6QmB +dDriIvpV6/BShKvSldkpuFnE8bbHAquBwxuXRmEbBQK0l24Z0BjCkOdukfYJrnexh4N 5/pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57038-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57038-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXZYERm/9/ChCA0nDOXK8k6jQAiHA8finO4vySYtkxKR94jCQ6PmA1EtBvIqWRNFmEImKmEGxv/xIhattduvPgOdgBggLwTuEvTk1eXVg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id le11-20020a170907170b00b00a3863137fb8si1239506ejc.411.2024.02.07.12.43.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 12:43:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57038-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57038-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57038-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 443FF1F24E81 for ; Wed, 7 Feb 2024 20:43:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D62B81759; Wed, 7 Feb 2024 20:43:29 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D11C1E525; Wed, 7 Feb 2024 20:43:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707338608; cv=none; b=rOBYNyBKtzjDmmjjKatA+NG0t5LrhmFjWxJXUNUlS0BEpJ9Afep33x7h0KK3TC+cAncXbzP8wKarEvUNC1SQccc8DX5ejmCotYTuGpuRT2MlpYWLpn3aR1EGD4pEl8Uob9KfNFLkQ6NfSPbkhZfkqYQWFQgVo8qQDcyMcr8WLMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707338608; c=relaxed/simple; bh=BJhZkmvW+KdW+0d3wfZKlhM8nJh15CtP3k9ZXOVshc8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=e2fzK7SjpitWfTNCqtR6sD1TANvIU04JLRIY35LdeOep3G+HdpX8DWjL+JK9BXLI+n3zZgdx45/nmel3G1yhYV31yTUH4yZ5oBey0OISpOU3HiyhvoGmWufc8wxMtRGlS66JNbtAFW+q0RQUSnL1vGoxLyv4u5MiOrLYKPLARu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e04fd5e05aso193080b3a.0; Wed, 07 Feb 2024 12:43:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707338606; x=1707943406; 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=SR135J3otmhqAafGVl5D5NnoHYrYuXrRvaKntsyJrCo=; b=qzTX7wG9l6+6h6wMmO0vP72hp7XD9e8BbXp/+hACiDUyvGKq2xPRk3OrChwYkF79pm eTRRz1D2bXxtHJcgk27P+TU1HdBIdK3kcmNaMqh61rKlqGpZbfLgao2cLtEhuAtO1zcd 0BGBr2twZxLOiT73334GMaVYUHqw5MN6jVYC+h8PiTwK49zbUCbHHNydF+5ZuU+8Qv1T QK62S0SRaOIrgEw4rDUW1kyubwSTiNy5e1tl4F8l7cUH3tTrjpui9DkSNHW+HEdbSHtX 36BRt4+LlE/PM2oFzjKHuZ8WtIyPVxw3ys1LjYsrd7XpYwUfQzif/LlXmnGSPPtigrXB dWEA== X-Gm-Message-State: AOJu0Yy12MwjcfIxvMQbosdxe/Y8sqsp6w5DeQEdR5fNnLe1xmk2wV5N 41Zft5lAZYTxYDFsGr3QuNSMoOpW4Xu8FYM+wp3YSjhebmNbbnslMpW653fyxgJ6rPqnNZpOZ1u XIvWJw6c6qa8PA/IMGG1zi4fVmdM= X-Received: by 2002:a05:6a00:1e17:b0:6da:bcea:4cd4 with SMTP id gx23-20020a056a001e1700b006dabcea4cd4mr849261pfb.16.1707338606117; Wed, 07 Feb 2024 12:43:26 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240202220459.527138-1-namhyung@kernel.org> <20240202220459.527138-5-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 7 Feb 2024 12:43:14 -0800 Message-ID: Subject: Re: [PATCH 04/14] perf map: Add map__objdump_2rip() To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Linus Torvalds , Stephane Eranian , Masami Hiramatsu , linux-toolchains@vger.kernel.org, linux-trace-devel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 7, 2024 at 11:56=E2=80=AFAM Ian Rogers wro= te: > > On Wed, Feb 7, 2024 at 11:04=E2=80=AFAM Namhyung Kim wrote: > > > > On Tue, Feb 6, 2024 at 3:34=E2=80=AFPM Ian Rogers = wrote: > > > > > > On Tue, Feb 6, 2024 at 3:04=E2=80=AFPM Namhyung Kim wrote: > > > > > > > > Hi Ian, > > > > > > > > On Fri, Feb 2, 2024 at 5:42=E2=80=AFPM Ian Rogers wrote: > > > > > > > > > > On Fri, Feb 2, 2024 at 2:05=E2=80=AFPM Namhyung Kim wrote: > > > > > > > > > > > > Sometimes we want to convert an address in objdump output to > > > > > > map-relative address to match with a sample data. Let's add > > > > > > map__objdump_2rip() for that. > > > > > > > > > > Hi Namhyung, > > > > > > > > > > I think the naming can be better here. Aren't the objdump address= es > > > > > DSO relative offsets? Is the relative IP relative to the map or t= he > > > > > DSO? > > > > > > > > AFAIK the objdump addresses are DSO-relative and rip is to map. > > > > They are mostly the same but sometimes different due to kASLR > > > > for the kernel. > > > > > > Perhaps we need to use names like map_rip for mapping relative and > > > dso_rip to clean this up, or to add a different mapping_type to the > > > enum. For non-kernel maps addresses for map are either the whole > > > virtual address space (identity) or relative to a dso: > > > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.= git/tree/tools/perf/util/map.h?h=3Dperf-tools-next#n115 > > > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.= git/tree/tools/perf/util/map.h?h=3Dperf-tools-next#n20 > > > The dso addresses should work for objdump so perhaps the kernel > > > addresses need map__pgoff fixing? > > > > I'm not sure about the vDSO case. > > > > By the way, I need to take a look if we can make this objdump-rip > > thing simpler as you mentioned. My feeling is that it can be done > > but I'd like to do it in a separate work and to move this forward. > > Makes sense. Could we add a comment to the header file definition to > capture some of this? Perhaps a "to be removed" to avoid later patches > adding dependencies to the function. Sure, will add that in v6. Thanks, Namhyung