Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp535172rdh; Wed, 7 Feb 2024 11:56:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEChux3ew3Fppiha7Cv+qm8B4u3jh85zUc7BSC5UXxTyCaq+Shk2Qfe0/v0R9HVIuRw6ALS X-Received: by 2002:a05:620a:214a:b0:785:3e5d:1320 with SMTP id m10-20020a05620a214a00b007853e5d1320mr6219128qkm.59.1707335801324; Wed, 07 Feb 2024 11:56:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707335801; cv=pass; d=google.com; s=arc-20160816; b=SbPsBVBWRIxVaZtAUvnyOqa08AIomfMqtT9Erk4vzUdcnB7TYRS9HWkdrXGI650/de 1nCj9Ad3emNpoH8GLnmG5TlX+fxvGv4oUXTw7ARIgP3ddRVTsk3vJ/ZOZBHGxC0BwWOb KCL8rW7g9/JA+j8H1Eq6Lm8KOEUSjRb4T2bY9s6LqWx2K+WKdsMPfui9jFUA5AZAgs4r Q3tOIm69I7Zzsx5CnM8XckdYG/xfmpAci1NJXidgoeRTwoQ1NBV7x/3GRiY03EqBF7Ca OyXIk6Uk9RNXBCJmZzWVKDsnETHGGwpAPi1tCzD8/v5rsdd/dLWUpanT4OYn5fYybwNg BFcA== 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:dkim-signature; bh=GOFmIdHcVZFpvdlv+SwpSo0Y7EY1nbkZlWlLRqBJt6I=; fh=qW6JW9bQGFv3G7Rz5MX+h2TOy5qN5evp1TTlvl94buU=; b=tgb9MH2jkF644wH+Hxxk2/135dEf0fzjbkNq7GzpRNGPpLQfyQ/zB2X7tttDQzb7b5 aN/OaPpqCivFmGXeyJEXea4cvTqHyYFd6e8D/vKg0QJmK8Jt2hWf5Q4fRHJpgS/XScRW r0EcuJWzkvKIKv0CNipBSdKoEYLg5YPDpXOgsIdyDiMYauH2qCPsZVKZmzRyzU8BLIb/ 7+H6mgHJaXEOK7t0I3kgO3otMMou9nhaDxlkUZJONAiPcIW7dQwZVeXSioC8ahzHANBK KNGgzP926yGXaVP7xFj0xMKDc4rpwzOQH4rO8OJOprWjdstYx0rNNCh8Qh4wIc3f0yG4 LSPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="X/LDMUNl"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-56995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVDrE55/o2pIksDmtexwlZVHp0Jc++K1hITzCydm8L+SSBi3Wz363StiMaXul0UI38Z4Cs0/ozK6/H2BRodIjvNO3s8lp9tbwyZSHphuA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id wg12-20020a05620a568c00b007853f7d0cafsi1788232qkn.1.2024.02.07.11.56.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 11:56:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="X/LDMUNl"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-56995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 14D9D1C24837 for ; Wed, 7 Feb 2024 19:56:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6433985C7A; Wed, 7 Feb 2024 19:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="X/LDMUNl" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 1CA4086AC0 for ; Wed, 7 Feb 2024 19:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707335787; cv=none; b=SUk6bYQQr2WFTVgPUH1TBWaHStZVtc33Isi7OlRDsurehU/EZkOj/uN1BjIThmOgBqu8/3IjdnQM/53Rx0xM+KTrYk7g2SIvD503nwJam77uQX8yYiF5OvZOWPGmTGk3UJczFTBwQmT5TKvQQBgXt/EipTKcvkL+oqOPwvHShsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707335787; c=relaxed/simple; bh=dzgYn4bp7nr3cKM50l3TAoVq8LCXbeNtvvcBhmI+5F4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Nn5btSEkH4hkCNfzilZzrnQgq9yMVypl3F+TptCwJ1RAbgnWgO33494zFO5TXLv/IUAbTPTjlMiJkO4TALKDzzqf55OEAAhgs8UExvkgab42VFrGTKT/mY0i3dWVOkNB83SsjAKkO9FLD1+5zbYV2HH3sUaPfgsykPrOQRjp5E4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=X/LDMUNl; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1d9daf74f41so17645ad.1 for ; Wed, 07 Feb 2024 11:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707335785; x=1707940585; 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=GOFmIdHcVZFpvdlv+SwpSo0Y7EY1nbkZlWlLRqBJt6I=; b=X/LDMUNl7q9r6qduvQQvW4Ck0iiopQjs1f8lsQz4dzB3rd0araf0qa5JvuZ/kNfDFU gviYn784uyuu80WBVvON8JAQm09zLX1op41GCtzyCeOus5dS8dURR/lrLE6eolBcmSYB 49DNlVVXW/ILEwmXVA6z4KHP2ZaisphbBxUJiMLoDCXa5tCfv/G2v46gu6pf8gHaRfKB GIvmH3CzJroIAFEKJchqEUNYfrcaMfL/Yh7OPgZb4Kkc1RrMo7V4DDVzN/L+A46l5BuJ Ed4n6OljKwUvXGR8pW4XTBYxq6fZjLT9Ys6H0QfSxcE4jyHZZJjQIgRj16MD+WLtPHiy /iEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707335785; x=1707940585; 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=GOFmIdHcVZFpvdlv+SwpSo0Y7EY1nbkZlWlLRqBJt6I=; b=dUvEtoY7iHuifNj6rJtPuPqnAf/yeNQgp3+cmPLYcm1iN2GqAO0V0s3Gd7yFIFV5Sh SKRqNPC32AKROGeT3RAJniwN2lCbSP3dt1FRIddR7BHjbG4CosNq3fubVtE7vuGNoB0h fKRL3w/e4GmrjjNOa6ylVTyiclqN3ywHo99ZNioWPvs5f5JJD7xTHl6oOAU6zKVKaeds jOCwCvRqO6JCpOpI8BUh+HR6i6eZW3GBcFhu/Rh8sNTgvq5hxqQcaZiMoou1eQfoLs6v 1BytjG2D8Tph1hTujnEHf+g8VWn3JBo5nrGS4sXMJUaagc53ghDOwLSjL2dW0uo/a5AL s83Q== X-Gm-Message-State: AOJu0YyyPOpinqGq2OIchFCpbKpkn4RCW8ncn5eXeWpujHkJp/XoycFg CMi4fBGezUfMGUR9ZQEQ8mJeUg7AI0vvjAB/hWa7pLiIU7dfmnjSrHSqNZE64Yod1TSobbwipFo swrVGcpEd7EK2X6O25rAiRvpP/Ez8+OOYc0G2 X-Received: by 2002:a17:903:484:b0:1d8:da36:d0ae with SMTP id jj4-20020a170903048400b001d8da36d0aemr215750plb.3.1707335785036; Wed, 07 Feb 2024 11:56:25 -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: Ian Rogers Date: Wed, 7 Feb 2024 11:56:13 -0800 Message-ID: Subject: Re: [PATCH 04/14] perf map: Add map__objdump_2rip() To: Namhyung Kim 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:04=E2=80=AFAM Namhyung Kim = wrote: > > On Tue, Feb 6, 2024 at 3:34=E2=80=AFPM Ian Rogers wr= ote: > > > > 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 addresses > > > > DSO relative offsets? Is the relative IP relative to the map or the > > > > 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.gi= t/tree/tools/perf/util/map.h?h=3Dperf-tools-next#n115 > > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.gi= t/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. Thanks, Ian > Thanks, > Namhyung