Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp132357rdb; Thu, 8 Feb 2024 00:57:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfJtqMV0IITwtDcyqLkBj1LbknsEOWROwq7sFt7Hc5wzzusTFUuApd1w1hmMfvo6vzGbSE6QdAQa45FQVvy7912KX2+Z0rQs18EsRsSA== X-Google-Smtp-Source: AGHT+IHxo858E4dWKuvXtMGIB/rDXOVuOTRjTrR0dXnMRCj4e1Pbre2IfxPJTTXhZeXKMei5hE2b X-Received: by 2002:a05:6a20:5604:b0:19c:88c1:1878 with SMTP id ir4-20020a056a20560400b0019c88c11878mr7037258pzc.23.1707382649822; Thu, 08 Feb 2024 00:57:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707382649; cv=pass; d=google.com; s=arc-20160816; b=nzgqc3aa3LwmSUU0HII9PfUy/mIzGFuN5mpnUZXoLjaUUbX9Jqr1zbv80nKcZlUCVu TaUdGw0lVzinSTzHn5Z8KTx1EoNDHRTLQsl+UZirrTSw6RnzP39J/6l4fyGBbK8CXF2a HgLIRBjjjgX3gX+uSFGrO0usgAuGj3BjmgMtYj7OiUIBl6xfoXCCeJKdtkCT738QWX8x /W37Gt4wJPmTjQIX4q2SXkh3lOjTY4HURquQ44iuQcLVNV73UlQeAZ0IUGjP6bjbNPCb DHmd6qxUczXZVRMJRcSuA+g5xlUlSnKqTklX2GEbWyy0SaDWWfpR1ZNP+IvseXB3JoUr DPIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=lcvBMIAYya30uMQOZzhKdPWdW74RaE8EqOL17/y4OjU=; fh=5+XDZ+Ec6/VtZNNkkVJMeqEH5Jh1GhQRiyhXKUZ+xsU=; b=Q1jAFyBRLOSKPC8MhMsoMtN24fMEvt5oupXxvgGD9vMYW4qTLaIH6kaBQ0NfT5RzVp sFeYI9ouogD4Oziq3giF+zXkPgJwbJftcONZDPaKUvv53jiIZqc73+fRYZEiCdQVJQMy eJQfISbqOGFkF6hmIOTUo/U+WNqBpV0pygUC9/DK+iHh/rCAthhAm/AcNgMCMF8vLPJj NZI2J5elOANMQs0clftLI2QzFcUerk0ZSWGpayc5KnICftPsWtMHIgZ2a+ksTd72v0C6 WvDaflKYeYgnORHFNTjtRYJeMMK/MtUQ3dsoiaLXsagkZpRO6cekRTEmGD1Urbi8e2PN Ke/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MoaB5s/c"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCU5nXuMiQqFs8nVPQ0zsUWJuVmmQiQ1ab8VUpxWMzc+DiMgoE7vPZskhgW5lJRnjMfRgVGqFEuV7aC6y5vfTLvqcGDGFvo/zAuYFb79OQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p20-20020a170902ead400b001d936b772c2si3582652pld.560.2024.02.08.00.57.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 00:57:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MoaB5s/c"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BA49D285502 for ; Thu, 8 Feb 2024 08:56:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44E606BFDE; Thu, 8 Feb 2024 08:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MoaB5s/c" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADA36535DC; Thu, 8 Feb 2024 08:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707382422; cv=none; b=X5Yq3IRvUYGAF3t4l8QIsxn93gKGLUTEYXWu/qNgLbud0AreM5F88WKkK3YfqgBmbaEJSpJBX5Z8iqvXXUxPWB04Pt93nvTyDinobDOL9Oxc+4qpiCy3iBPT+v+APeRxUtlDUz/++natbKcGerIrv/uLMvQ65tFEl9CTjNhOQvw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707382422; c=relaxed/simple; bh=UQNJ3qjwLz7Jv4K3EqKF8D67gnCfaH98/kcXiVcl2Tg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=m/1LmOcCI1GB8MbSzIkmM56RL4HYigdOGvAk4vpfMGS/l65USqNVNpJDr9UdzCBjC78yrjqSvLQQtXEAwqdCr+HIdaqO8QV39WEphb7sehJ72JPqSr+OpYO2RVGMCwM4S3pp3j2YHZWeXH5x8YrhrlUY5FEy8QbOQxlc7RyWYsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MoaB5s/c; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707382420; x=1738918420; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UQNJ3qjwLz7Jv4K3EqKF8D67gnCfaH98/kcXiVcl2Tg=; b=MoaB5s/clY7z6IwuIvDxOyZQXqTmw16ot7UqXjxwIFNrv2zP/cvkwojH omygfNmHfCiH3XEQQFIi1eJVK5STqKw+CQWOUF3fcKUuu4EYdZlQD/RYV t734rrDF4Ur4bXfKrmTJ4sVdzfl9uZrsEENxQhZS+Boi1/ea/uBLbSeLJ 9yyi5Ufr0gVo3OAHc0TOr6gcgOzJ7XVrooSbNvi0e6w2WyRRUTnU09ktz Os92Qogrr1r+mdnuR78t7L/hMJxzWPCTN1A4mxhAaAWcAY8kqYYXxiSKs tbou+t/rEUypwHyq1xfq2S5S3+AQ6eAqQkt6L/XqQCcuCdg7hy3kgcsvB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1329186" X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1329186" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 00:53:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1589475" Received: from lnielsex-mobl.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.219.88]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 00:53:37 -0800 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , Like Xu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V3 0/2] perf symbols: Slightly improve module file executable section mappings Date: Thu, 8 Feb 2024 10:53:24 +0200 Message-Id: <20240208085326.13432-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit Hi Currently perf does not record module section addresses except for the .text section. In general that means perf cannot get module section mappings correct (except for .text) when loading symbols from a kernel module file. (Note using --kcore does not have this issue) Here are a couple of patches to help shed light upon and slightly improve the situation. Changes in V3: Re-base Changes in V2: perf tools: Make it possible to see perf's kernel and module memory mappings - add dump to perf report (if no browser) as well as perf script - add 'perf --debug kmaps' option also to dump kmaps Adrian Hunter (2): perf tools: Make it possible to see perf's kernel and module memory mappings perf symbols: Slightly improve module file executable section mappings tools/perf/Documentation/perf.txt | 2 ++ tools/perf/builtin-report.c | 2 ++ tools/perf/builtin-script.c | 3 ++ tools/perf/util/debug.c | 3 ++ tools/perf/util/debug.h | 1 + tools/perf/util/python.c | 1 + tools/perf/util/session.c | 11 ++++++ tools/perf/util/session.h | 2 ++ tools/perf/util/symbol-elf.c | 75 +++++++++++++++++++++++++++++++++++++-- 9 files changed, 98 insertions(+), 2 deletions(-) Regards Adrian