From patchwork Thu Feb 8 08:53:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 20093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp32463dyd; Thu, 8 Feb 2024 00:57:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCfFN484Xje+DHvCaQJNj6hUbFOzsAzXD2otdq6OS6HTTktV0Wc5odIm5k+/wDxUlggv0fV/S8jjFep2pjL+ahdaRR4w== X-Google-Smtp-Source: AGHT+IG/Yc1+5GFqWNZk+9UuqTUY5vJ2yGTgafLxOc5vNEULUqNSXWDicxPfROI6mvDuOnS0cvG+ X-Received: by 2002:aa7:84d4:0:b0:6e0:3f77:ddcd with SMTP id x20-20020aa784d4000000b006e03f77ddcdmr5266658pfn.25.1707382655629; Thu, 08 Feb 2024 00:57:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707382655; cv=pass; d=google.com; s=arc-20160816; b=lxFCxyIdc6rejZpuV5bCW9p0A4TImR/nBg51cZ30U77avgSU1sRwwAXV8dgELcbHxs A2o4rHuOfuJYlH3XFnMYhJsMxXmno8xi/B++xahbXPHU9Q14qafrRxEJ05to8XzUbS94 q+MogOcokINAH35Wvdeb4dXb7kQ+SKDXCArYTGHuZTAaX+13CxG0cmTT6WAY2VCWND5T +zTpWT0nmiccdQ3nCztsYq6a+Xf0BTRPzoQMV47hmaBFXYutAbc3yoZD68BXFKjH+8T8 leeJptxtkUEFSl7NiK9Sh4aNzKwaFDvVLRzZ+h+zLbbFD8HH3A0F9N85x6w1G6rSbqg7 xTng== 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=A1mezk88hI/2cRTlfuowm8N00MFQSwY+wfmNQav7q8U=; b=vyRqLCu07PCRhaNoVdKSGfGi4Kg4m73GlOmax/g6ky3ROQQZ9Cd7JpffjZBDZoc3j8 5zQD4UIy9wfCLWvxEe36Ec2zqmtjWHFUk6j08ltkfX6fQ7B4PMnInGaW94YVlyucwbU1 v6/zTbqZiSg6onVxxPFjKpzqLVF6dYd6lxcI+3Sp7NQXu2DsQ4ZnNaYPmaU11cHMXgmo KGDz7DleSWc1Q7QrLtCghJLzz9nAOL5FNIlnpSCa47TtS2zAjqC3TIHxTJHOn9kqsD8H QuKPIB9fknFKdX4JZojBJa3KkbfhpKqZ3F2eHwCFVh+9Q8i30yWXawqVEt7hNVWI9zhO hMMA==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57675-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWa8mIx8Yg4+FxmCZ3164VhedDGqCPRRzt5q29owLR5RyK1UVWfNSLKKNqq09QJtVzmsvsnPg+gE89f13o5TkkNbg6NNw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q21-20020a638c55000000b005d8bf0a91besi3391049pgn.276.2024.02.08.00.57.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 00:57:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57675-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57675-ouuuleilei=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 7CDAD286E7B for ; Thu, 8 Feb 2024 08:56:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 334B26D1C4; Thu, 8 Feb 2024 08:53:45 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790320475429709443 X-GMAIL-MSGID: 1790320475429709443 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