Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp514207rdh; Wed, 7 Feb 2024 11:10:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFx/7su1Qvtp3Rx2dga4q/TcoluuN6ZysDdv/y15xosHCYYTWq4kxp9KxjWjOXfjyI1gDJ8 X-Received: by 2002:a17:90b:33c5:b0:296:a288:4e17 with SMTP id lk5-20020a17090b33c500b00296a2884e17mr4054198pjb.2.1707333048125; Wed, 07 Feb 2024 11:10:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707333048; cv=pass; d=google.com; s=arc-20160816; b=Ah/44t9QhEUQTQwYvLhQcLy9dvo5xFxXlrHoyof8zOiZcs0cbVMAZTAAxY4kCTGp+I 5yxVKQuiTFhRQ7NQ1gVL61wGI4mHUKNaThnVy11+7iDOxWLdSDo/PyuiG8BzZCJCeJbz /YV+7dadnQMfKHrAV2dwAkrtyW0/6LnmjYIcp8gvJs3/tbotV/bQZ5UQNjAbwrGfFnb5 ef3XW22MZW7M8QggIEdqhx+9Tc39bsoS/xFImvqYIpYNMyIhLG4vzGQ74VGCLwF3Lvvt Fd7VLC4LGz/02jmB2xEJMaghsGuVhVPLKy/RHh44Ex0QTdR8cfx4D4UckOg+b4ktmD3o j0jQ== 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=8perGIw/BuKpMeus4TL5BLo9dzJJHqJwC6cZICjUEZI=; fh=OphwCTrF6c09NXnIN9NYf4mb2dFTMgcE0nGWeUrgvHY=; b=bm/o8k27hQkQ+bELlk6Et3lxy/hqWVsicLRExwk5Ywn6Zdp9bzDrrrktZjRCi1ZBT4 WhOAxQa1zi9Zl/A/voSnfJ6DvWA2tj5h3vUuGVDVQNJ8dwrEhu26rfiYhPUD23efD1M0 KqWh+B/4vTVc8wj9r7CA0okq61d42zrKnhksMFzcQGy/DQg7pa7TF7poNLntBZfDezyN 5yXwDh++F/VbswpQfyWMbp+KbjnLzt/Q+ny92RGxDD0fuDGuuZMHcHejBy3ujzv3IZG7 hYeABQypOwFpTAGH7PfwHuS2t4yTwVc0dieplljq9RJIj2f3gPbJDYXhBcE/8Bkxxcb5 JLqg==; 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-56969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56969-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; AJvYcCVSKEPF4uG9OVgg9Qu1A5Xd9m8zjjJUnmPDgG73fCDiL7h6AChcrm1/4Rf33EhqgFyovVObOgxKJIkdchwK2VgfDG1A7txeAhJdCvcK3Q== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id lr17-20020a17090b4b9100b00296c2bf8a6fsi2506074pjb.147.2024.02.07.11.10.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 11:10:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-56969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56969-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5D040B273A1 for ; Wed, 7 Feb 2024 19:05:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A95F86149; Wed, 7 Feb 2024 19:04:35 +0000 (UTC) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 BD5FE85C49; Wed, 7 Feb 2024 19:04:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707332674; cv=none; b=vEiaIw9raCKp6MKUq5xAGWGaRYx1wsgyHPQejDRRjfZJDvgQRzAzCoQYn9iQ6h7WRn8klIPRnZXgidbtln/GF3WCbQxJpJ1JScFK1jjdeXpE1mGMb+2wriUkvVQaIQS2o0FMGa38l/PgA6MerpJr3ZrAo8O7bMT3LWT0ZJ44EzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707332674; c=relaxed/simple; bh=eSR8JlMnD37e2fdYBa8LzrVXfMjhsrYROPi+JXssO10=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YZW35AGDosvNZFCRWqgCuQscBlza7Y44KwWCUoPzpqmG/2DfwopO4Naxdz9TRBAOeHgzV0O9RS8pBig4naRNBs3hqHx7LlK38oZZDxM2yHr0JZIKi3ZA3UUtroffF8iLU+wxpVy9jT8IuSFRU0jo9vzWxvgoRwo7TnEPsDD0IFc= 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.215.174 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-pg1-f174.google.com with SMTP id 41be03b00d2f7-5c6bd3100fcso760448a12.3; Wed, 07 Feb 2024 11:04:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707332672; x=1707937472; 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=8perGIw/BuKpMeus4TL5BLo9dzJJHqJwC6cZICjUEZI=; b=aK7RsnYnSqV7O05ss6/mVNjs0PMuw9A559f4e/v5HVFBNWlQX1F2Bd8ElutVN7rdvo 1Obfv52Bpon6m7nTCDYmaaKF0xQ5zA7kwRUam2WvNJAZJfx/RrbR8RSQ8u5gOAr2Xltu FRGQwpiO1MCY45ILnSPplcTYap0bo6CSIfZxyduL5gj0O+nAOLuMAXKvUmf8j06dcG66 LCOOB/Buf7cHYIunposKsUhFiv8Oi2d+huL35TYdTVc6wwT0+0GIGwZpWZvi8YyO0ror pYb6dZKMlM1XO85a77+EhTbcQLtLY+Qa7DBPbYkF3W1MKjaM1MUzWVOxPFvwKmEwYDHk smUA== X-Gm-Message-State: AOJu0Yyy4l5RhVZ3PxnL6pG+aLKhby1IBke9COwcQa2D+QpNCgcOtPpb iHS14GRmqYo29wfAOBRm/8RUXjloyp54zNQODyc7b1C8esGCwv0pDDjNpmCTdGIKpP7JhZ3cwVV +AFUzelkFZKPd0E+xpsKamg3idwBmY8QVvio= X-Received: by 2002:a05:6a20:d49a:b0:19c:888b:b74e with SMTP id im26-20020a056a20d49a00b0019c888bb74emr7978073pzb.61.1707332671888; Wed, 07 Feb 2024 11:04:31 -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 11:04:21 -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 Tue, Feb 6, 2024 at 3:34=E2=80=AFPM Ian Rogers wrot= e: > > 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.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. Thanks, Namhyung