From patchwork Wed Aug 28 23:17:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13782083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0F75C7114C for ; Wed, 28 Aug 2024 23:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YigPosKCyA+QVqyfOxzq74WG+dtaoYHC96nYTYgVgG8=; b=WRFu6mb5HlajtVl+CQjy3ls9uC JYIk8bWlskJCK7gCG0T7Go8f/Kl1T6iM+NB5cvQqQ9AELJrmEzXYhgO1LWP9j9fp2pWTpnFyMG/2O ETiFAO/5lILhe07pgSn8/ypxQIHdCMnpODBlaNrfLb1WAOWXw/fGNacyDs7LiywLt/74lrd1S1sWJ fUrQGzUrSO6NE1bQ9MQx0t1g9N+rLO0QwtmOOJ95nHFbIsKR5M/QzABQelziiXrUkUO8ciGViG128 ijfuOLVC2UPtCE4Qq0QmaYUoJng2N5CZxsNoxnAbvn7up+QScGSMsWMLurklc7ZvnAiAxBQuu63d3 dmZamc6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRwT-0000000HJlK-1MeC; Wed, 28 Aug 2024 23:19:09 +0000 Received: from mail-dm6nam11on20708.outbound.protection.outlook.com ([2a01:111:f403:2415::708] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRvd-0000000HJho-01bt for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 23:18:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qS8SyGpc2a/MD+14mZKcNJK7KwrBSLTGefkcWOdM44Y+bhG/Jrp3Vll6dqcm0nNPhVfEFuEpF0Bzy6nWMVzKwvBpgZoTgEHo3YfU3H9osjLeytcFp5MULTKkFOsgzk4v7PQ0T/DesLOGgQeN0Bhm7cLq1DGq/WTA3Er/KLevTbfEeeL5DIybwlE2U3j5uMy6qoJwqq4bsOQdShLDcP5DKd/pqaWQR3Fwv0zY2fTznDO/xoatTV7GehmFTtBvJHwRFWUWLGOQ4krGnSQMEV2YzueeQuDVbyIB7ByireEzLTI6qa7mjT04ZgIQ4Je+u0XeHPxiQ9za52B2TTJf5Wor3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YigPosKCyA+QVqyfOxzq74WG+dtaoYHC96nYTYgVgG8=; b=ru4ET4lPgPT2/SYTT1G6ce5xn0bIwIS4Qxs/eHQL7iA3spyL8LLch3AhSl9BQe29PEWx+gLxjmBZ0bs0BUPuzymjRRWpjGd/NwThX/42pHzeOaTRejA6obrWYs8Y0zJCVJl1gxux3/Ml8fdN4SHbVcnbu+e7gUbU5bbZAh/X9/zfuwBdoajEDBh3byrpxJap8tlZxFMyGYA+XIGSsuwTjekvN2BG6lLNz9mPY6XW/4BD+Gm7Tl+j3KDlkCYkprEIGggbNueVo9JhvOG0EfnCzIUo/4GmPrw6pjY5bldOqeFEnTh6MFUB7/ulUQ5ETOxsxngZl0cVHA5M5WO1TBuubw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YigPosKCyA+QVqyfOxzq74WG+dtaoYHC96nYTYgVgG8=; b=k68RHggu5UCMTLtC5g+VjxrhVe0Pkn9Tnb+AfMoJHeHJcO1D++IvM+x20fV0OX5PYY7Udb8h7r2IDlYBGycslW90e+fwu/eZFN8xazBl5oQjugEQIrnsIsQTiYiG0GVqoud9t6jABmI7OwuKgcIdRjIIwPcuhEXxmvghCiKpodw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by PH0PR01MB7895.prod.exchangelabs.com (2603:10b6:510:28a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Wed, 28 Aug 2024 23:18:12 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%4]) with mapi id 15.20.7897.027; Wed, 28 Aug 2024 23:18:11 +0000 From: Steve Clevenger To: leo.yan@arm.com, james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: PATCH V5 4/4] Adjust objdump start/end range per map pgoff parameter Date: Wed, 28 Aug 2024 17:17:55 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: BL1PR13CA0109.namprd13.prod.outlook.com (2603:10b6:208:2b9::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: 9514fe2f-430a-4bbe-4a47-08dcc7b7af55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?QGfI46XM9WIfDj7oFvnTA/7LonotNfa?= =?utf-8?q?tSo7aHJsCmFoPV9/VW6gYENgURinFewZSUXh9ZpWC7Ws85EunoJNLaKynF85kqOLG?= =?utf-8?q?4nFxQOuAF5rr/Hn5uQZcMU8J5gRxDwlIVhRTJpjaq+HY+ziR91dCjBidMSSwOL4fu?= =?utf-8?q?y94/lcEZ1UUhxGTcWgDdmldU10B623/5+2QknldcFVRZ18Pv7qDc4ktw+gSg8Njd8?= =?utf-8?q?fgJ6vHowAi8yoqZqshwa/whKKIiQkFfK429Zz6uR1E2VQZ/OeWVDMnNVVoHTCemu1?= =?utf-8?q?G8PB8Oz+rhCqQRoDJHM33n3d+Ro7VS9vAua+TwbHaYGJsTBg4kCzzsgOUzuXQ78Un?= =?utf-8?q?paFFskPWhjQXiTZC0uMaHIUMdOaB70AU/ku4n/3rbfDyRKNQxAbBpVsooN80w1/iP?= =?utf-8?q?S6v968pVAGtUqsr9T9WUnAN5I7lzT8+jkc1oyRxhhinmkDgsrHKIdVdkBzxfWoHFi?= =?utf-8?q?RU+NHOsCDMs7ODd4WnnjKVWQ2m4Kh1VQj0usczItow5Ar3MkRjNUCxOrfxybsCZ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.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9lPAFQs27SbfH9M992gravm01eUl?= =?utf-8?q?ldNpn+DmI9QZLNZQi6i22DqC3g0ItQB3iCFVymKKYO4mBTnL4+d2k+lF9dfIEYCjs?= =?utf-8?q?07gmreqqybE3RUoudgw+CwdstaK9eFQwYuGFK0mWwYReIL1y3lRw2Oni5yq8EFR/X?= =?utf-8?q?y/SRYQmPRDHAiAWfCBijHH2o4FveGjb8/fnBtsZnK2DhspDFaHj1We4GQxpsYfQ4O?= =?utf-8?q?cjKoVuDtNwmEQjyjHUVTB1FJ6XO4JMvx5/LNZ+QFkuR4ofEVtvpPgJ6tfaOe0C/Lk?= =?utf-8?q?kqEPwacH6XnQh0xefMjeQMe05KioXnmpG9e0cKlxaegMzvkEHnfsRKCT7h0nEANu1?= =?utf-8?q?kzzvxwXCkgRtTRNSQslRhNvAHccYM0qSk1zPu2GSHa/wTgTl+F+511l+LwTMYI8Qq?= =?utf-8?q?7Quf//pc212rE7lZvJQYRNufO0LNFxICOvncxX7Pz4NyQC6XpJjP0MTbMbwe4Hrfd?= =?utf-8?q?PbSmi3yNrKMV1dBLTyO9hXWkc0wfqB1/UoiD+03hBzLYXuy6rOiGiP9PjseipdpBv?= =?utf-8?q?HXKGiewklpjGlKIwZ99/d8m4gn/+Wi4WrCvAzz0YbRs1tqWjmmhvt1XHxIGxFC5bz?= =?utf-8?q?1QiRPcaSj1/Z/+Xy1v4e6dSgiV3nGZJl+2BPCjc4qGGFYZo2jWeDkPUAwfR2EtHfD?= =?utf-8?q?eMkUr6okgT1ZiW9BpLSDk0VmIJHGQnkKf8fjvO+9ullWLHOATfO0wSdX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3iY?= =?utf-8?q?Z8B+dvxUKOf?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9514fe2f-430a-4bbe-4a47-08dcc7b7af55 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 23:18:11.5787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R5NhCf+aZEO99cWpoTL6TQ3vs3UvrqYT0PBx/9Xpte+0FbgZvV05+fedMzW5lam0tlrzAgTuoUcX9ow/7uLMYurphiiZOcJO6VocxyBy9TQ3VD5nOZL6qix7vhh1/vwH X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7895 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_161817_072277_61AD031D X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Extract map_pgoff parameter from the dictionary, and adjust start/end range passed to objdump based on the value. The start_addr/stop_addr address checks are changed to print a warning only if verbose == True. This script repeatedly sees a zero value passed in for       start_addr = cpu_data[str(cpu) + 'addr'] These zero values are not a new problem. The start_addr/stop_addr warning clutters the instruction trace output, hence this change. Signed-off-by: Steve Clevenger --- tools/perf/scripts/python/arm-cs-trace-disasm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index 7aff02d84ffb..e8cf5d80d850 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -187,6 +187,7 @@ def process_event(param_dict): dso_start = get_optional(param_dict, "dso_map_start") dso_end = get_optional(param_dict, "dso_map_end") symbol = get_optional(param_dict, "symbol") + map_pgoff = get_optional(param_dict, "map_pgoff") cpu = sample["cpu"] ip = sample["ip"] @@ -249,11 +250,13 @@ def process_event(param_dict): return if (start_addr < int(dso_start) or start_addr > int(dso_end)): - print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso)) + if (options.verbose == True): + print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso)) return if (stop_addr < int(dso_start) or stop_addr > int(dso_end)): - print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso)) + if (options.verbose == True): + print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso)) return if (options.objdump_name != None): @@ -267,7 +270,7 @@ def process_event(param_dict): dso_fname = get_dso_file_path(dso, dso_bid) if path.exists(dso_fname): - print_disam(dso_fname, dso_vm_start, start_addr, stop_addr) + print_disam(dso_fname, dso_vm_start, start_addr + map_pgoff, stop_addr + map_pgoff) else: print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr, stop_addr)) From patchwork Wed Aug 28 23:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13782085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50736C71150 for ; Wed, 28 Aug 2024 23:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=46Lnfa419ba6MwoTBOGTytQvW5UJhrJmfl9dt3uEQ2w=; b=l/5cCVBTdhO3+hU/1Del/Xh1zU DCk60AFVVxf6a9MHbv4PCi4J+Wao+mUS4WPf7+crtcMAJgkoBfPwoSFOmRLhhjo2zswt+AIZHca1h yJjUi9IcR9h1beBHe+XX2lvYd4W7S1QFM3hKduxc3jXriSXOqNjQWrxQtXD5nG0CI0S9NP1+AfKvH HP0FxRwL0FVnxJqJKpovXB/xlKCwDzZ6CSVRKRFMrbsplw1AHvE+QQxB06D2vwKrQPqIod28VVwlV J0OQXlhMRkJ7NPZydLsaD/aAqWSasDFmwKSxCM4ymYpDwm5v1tv0HOBnX1mywmCAMJb7L7T5g5QDM lsAmIm3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRy5-0000000HK6J-23Kg; Wed, 28 Aug 2024 23:20:49 +0000 Received: from mail-dm6nam11on20708.outbound.protection.outlook.com ([2a01:111:f403:2415::708] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRvg-0000000HJho-0dKL for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 23:18:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CW2BGvXuc1CrfDhbi04ER1tM7DDJl6zWCqEzWvH1lw/lL2q8U4g4Dh0mKLaJAOgz/CQCtBwWTaVY2XuCYmN019iza4cDF/ERQkcgQyt/Cj63deSxLJ9658IoQP1jyKVd1E3WzdeeGGfv/ZV1yjYjIcIkiFTteGdYx8biYQ4XdJU2xVv4zwExCieEmiauRI9Fbv/qwZYotjQZ6KhdsixVgmmFZ1Bb+2ZlFnLplUWJ/CDEoh4RcKkXdiMC675dLDNYcjyoe3rvHxooCkG4aHD1OKmhgp7aNLPWttOMu2EgyPjg1L0mWf/NwPCxmiF7+QIsRsxI2BLMc6+LJ8Y5uUO6LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=46Lnfa419ba6MwoTBOGTytQvW5UJhrJmfl9dt3uEQ2w=; b=AsuLceaHxyJ2b+4RfgAx4/iSqpUSzeRYBWVaE8KI3PZJ5xw2QOh0K/sCrGrlgLgOZC5sTCCtpY4OddKSPdVPfiYRHAn9DtIObmOHR+Psp3WRLNdaIFhr8TiZP4g+d1J3EhXyLbT3mi6t1+rXgFFAJWYO9Mg8th9lfXJ10YfYbNgNFLd6Zxm7CdcaU7JiDF7qx3cLxT5olFNARDX/GdoRIjLWUGCB5FPT74ceOAYw+uMggncwjReZsW/N8wklSuDMOBh+y4yrjBMzLC5pfO3i6zPaPXZXV3XIMMlgWULLg1sSKHBH2qCO0/ZFQZB5MDXJmV1jyj8cedTiIfrac24CfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=46Lnfa419ba6MwoTBOGTytQvW5UJhrJmfl9dt3uEQ2w=; b=Pmi7G9wmuO6+x1Up3HfWMFoRYjZPBZ/hCcUgfjDcHlYfHt/yOhaFHx4yllqScEk+jpu5nvk3HeQPEXJdor8MhfKfEPIUvX3My8/NPWhZ1tkajUk3kjN7OZ5nYV6iIzN/2gnhIM9ivJq+bMDJSVzlsdL4GSSZRX/c3nu1PsoYQe0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by PH0PR01MB7895.prod.exchangelabs.com (2603:10b6:510:28a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Wed, 28 Aug 2024 23:18:16 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%4]) with mapi id 15.20.7897.027; Wed, 28 Aug 2024 23:18:16 +0000 From: Steve Clevenger To: leo.yan@arm.com, james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V5 2/4] Force MAPPING_TYPE__IDENTIY for PIE Date: Wed, 28 Aug 2024 17:17:57 -0600 Message-Id: <070af7268841ba70678fcd615119b66816f996f3.1724879699.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: BL1PR13CA0109.namprd13.prod.outlook.com (2603:10b6:208:2b9::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a7c0bcc-73e3-4d7f-6d51-08dcc7b7b1f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: MIFv6yqDeHlduLi8s36Bh6sq/zRE0uII/J/ZuR5A7RkPAEt+fO4qpoe99TrgeVrJeiSolhSxDKV/HIbzNLT/2QcVWmyrOnXhXFj2UTlrJfLSX7ibhYCsxXriU6q6D49gyhpSvBdQUNkJHaulUIwgvTkklGVgra77PRWuoDMNkmPF9RWy+N7COw/1BOmDj2OvVeEr9NYLm8s02syUQAUmD+ITzYfsihSaSSKV1cKWD74k8owgiW4zegAxl3tvYd9Rxd8293/rRVzf2TLFMbMh9qxgLpcTMl6ohzqL3daqHNgaV3LgzpSNkvbcPsWYDuqBCvkBBDSgA9qW+fPp/o1p492jQ++ZjriD25OCIz/SVxlHv7ro8rh1zJFkxK6swZsQ1d6kb/XESSB/7a9LJ/UKsmRcVqANUgsLYG+mYMN8+oxZRPQlq9wmKLk53UMACUgCPL9aNShNeXCST749SEs78MsC+zGX5mBK+AfbT1VINlepcFcM4x4J9NAJN9pmFPuZ+jGzyyn8F9isz+b//7RVFKAfpwY4tuPg33DA2241Qe+heJiyc0jwY6vGtIbqSfpcTiyb87jNqpaHSCqfckS0UchYCOtE8UmFiUmo5eiwjmlutrLVlXtXQl8vxdif1OgBkkjXCcCnSqCxWBZw67ZzKlpxxXoQ8QrNH9UsWgGyPcb7p2+5BhRD9PBS15i/GOEsIXsT8h2NLdmZkySZn4bdA491lqb708chQy/AWEHCGnri+sDDgzBqZvP9fyAGF4cvnaXJ07dnt6XCVRlWXlq0LjTkAQLYzo/oDU455aWmCLSKra7XPaauvsqMSxpmmPl9tP6liWCFU7WOsGOSDi3UlKpB+tSXNlshZLO+8O6+QT5BnSuSWAuE29zlx5hWBBjmMJpiSN3IpPf35SbXYUg9IA/GPgwZg6VYGhajuj243ZdzpHhFkQwQcufPu8mtTzY3keD8gdjfInzvY6ovj/ZOU+l/0ngQVaaTmhAw0gPxDJyo4qnBQ6ycGu2x4tYlVkDpUb1jjsTVa9O4R5M5Z5vWyDN5iRwDd9MRkiCF7G6S+4EUhCf/TkWnPshqIeP5LWHCB2Uo8OnRxw0IvuCHp47RNr3xG8BYZVvNDqQEQvDCJtcaAbL9Z5EsQfD1Ia2qxLRo2m1+8kNlk/P/7SzFKDQwSvWZs42gBct6raT78JvA47kzfubJVtz3c9Rzh+8C2zaMhH0zFr2AOvCKucT9pu0aF0P0hdSJN24xpr1dPQkhKFKUlRcLN02PPIIxhjFF/VhPAh5ufVOOK2quelGw1yNiMjNqLShTMGwWGC4hbQN81/q2lQuvNyT1LtwxG+P+96S7BV8ZxAvkEahfz5DfnXcZELLZyrCDe3aqVnJWAlQk91ZB64JQvxiiByyN68tQL6Aal+M1EuEztyWEdRIWyCjcMQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H3fixxKS1rQqQHEc+yVOdPXyKjSjyrt4FG7sjr+UmmLAyKRYWV+nrO0bQk6ReEoQSKA6X5fkBj4yyZG5GpcSwPmH7RuU/+90VF2oCc+MJAnu8ZIkTpL13MiHflef1ICRLx48fbutDbQQ5h45n0YJv0HxH1qaK8r0nqvzOuGhkcnhGuh7vt2ioxyxFWJvVVOQHHIMl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lGts/LRt4ATUqsZcxzA19AQ8gDWH/MHtbWN5cqgUGwZPRL/CPkeYQXz+gRvZQC1FsKrL47gLEqt0muKVDP1QQat4V0EeaRHgyvuJna+ZKrNyGI8oYeRO1VuwsnaQf2uZeCHBrUVz135CyLR9bXxzF54Ai8FTYdlOvqhL3zLJK7YLFVJ2Tt8zAHJf/n9NjSKjTZSP5E+h1IykMoJzEluI8H1kWhAnu4tJC9j37LlhN8VHjdyE9DT5/NRrNvGigoiicmaMS4eU9vkev0bMDNT9IKK3Nh4FW37PQKtqgU0HUFuMfz87vpObxcJgYxnmVT8JUETz7DDk1LptoRIWmDLM6Lggc8iBm+F8NOJHLeGsM2nkl13BMX5vTiWdxHKeB5pylsRRcYb X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a7c0bcc-73e3-4d7f-6d51-08dcc7b7b1f3 X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 23:18:15.9817 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n+6tbmkcwCPsTW0oiKO7mC9luvKo89+VWLjJFkUbDIRY3icqIhkA3smeoKk3NnwPbstLE81pdfWU4UJtBqQN5yqiQWZBlGG6nXyOLiktjnP8ECagjse5U+G8Vdx0EdMV X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7895 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_161820_199627_76EFEA30 X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use dso__is_pie() to check whether the DSO file is a Position Independent Executable (PIE). If PIE, change the MAPPING_TYPE to MAPPING_TYPE__IDENTITY so a zero map pgoff (text offset) is passed into the script. Signed-off-by: Steve Clevenger --- tools/perf/util/map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index e781c8d56a9a..c846faec177b 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -173,8 +173,8 @@ struct map *map__new(struct machine *machine, u64 start, u64 len, assert(!dso__kernel(dso)); map__init(result, start, start + len, pgoff, dso, prot, flags); - if (anon || no_dso) { - map->mapping_type = MAPPING_TYPE__IDENTITY; + if (anon || no_dso || dso__is_pie(dso)) { + map__set_mapping_type(map, MAPPING_TYPE__IDENTITY); /* * Set memory without DSO as loaded. All map__find_* From patchwork Wed Aug 28 23:17:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13782084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC716C7114C for ; Wed, 28 Aug 2024 23:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5TbPovjZNBNXh/GT67apuayFIV+YMHPFXW1udh43QOQ=; b=d5GncGieZI6fRIPc3u0Xu0+cxx osUg4v0PzE1T93VMWDYAgFxyMm2bvCyBQIy8IEHLgmtxBhTIWNev8tAK9N4RbPMhSxE7p/I5xUd2T 5jI82PAM81RVkjEnwXbCCpsMGzoVBm9M7yW7hIbv1+ZihVR+Uz+dCZ7ig5DO25dcmt9OSJfA8V25n FFzupXui9b5Vq0KK14loFw2RxC5hr00R/zoO9TAvu+9rpGjXP0FbNwU+QnHyryC7/QHN/x79yqWKc IVD3Fk61s70FSLCRnUTar4EHMsMzzpGGZ0P2oLOd/uLxIyJseEfg7FJCTnFcAUtNf/V8wSVEyBhV4 Sdd4n5vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRxH-0000000HJtw-16NR; Wed, 28 Aug 2024 23:19:59 +0000 Received: from mail-dm6nam11on20708.outbound.protection.outlook.com ([2a01:111:f403:2415::708] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjRve-0000000HJho-2MFI for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2024 23:18:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N3ysuXwPY45dRCZuqFJzSPFaHxlzl7Fa1gSM3KXTP6Ep3l/Oj7XMNC97qZ9ZdE5SMN1WnHkNEZ75Loh0TvoYX4SBhQWpvwF4w6mTGOAKx9gejMq/svW+wg97jloIGba8+sGGxo65VOm4nGjuPFCfhhAckWvkGoBwuPe0X/5M8TUc2fcrEcrB7Yz5N2DVvDD4t03lkSADq/ub1dpCdxxhkpH0vygFYTRcSIHwTyNQcDL/IDXB2jVpBA1CNutFsxH6snBj8oFVe5NE2a6kjibAPxsaU1L6rStROGVIyeDJrivVhrz+WnkUP4RgCzpzjVrHRZgPooNKbqLii/GI5D0I7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5TbPovjZNBNXh/GT67apuayFIV+YMHPFXW1udh43QOQ=; b=wyfL/K+9kUK1VAc4QHd8tIkHd3BqpFU28/1fwDAKM0XYhOboKX07c9KeQsC82aaRVjl03xRMbjPL4dfxMjUK2QCtChTtKawzlWMPXYWCzpxkR2iWQFAE3MJato3XwQGaetWQiJqR8rKcOXBu0Q7gtcJNtF26M7laDZR/DpQUL0SHBKNZymgPUr1OmRMbOET32GLxWSTVPhHT0XUoChKJpTRq9jQYA+TXAuAvlRWZe6j3oqBDtdEz+2H6RKWvxwFqegwVTcW4T1Y2JCE4aV9hraJIMP5XTWwGXEVfEcYU7JD5mYd+y/IvWnHGHMzG66moyu193Ko3SLRO+sRTohtVPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5TbPovjZNBNXh/GT67apuayFIV+YMHPFXW1udh43QOQ=; b=MScw1ToTtpeJv2pxh+0Gv26dYmYXebxEHuY2gs9olo96ntlzeTDHK1pJKhFxCRx0XysaQmHuoXqIJV1qAH0A/mon5VY2XwP44Hdyz3NHaKndzulUB1AMI7N/cllcbNnFH0lYvs6r+IyNQ0Zm3nLgyTa1naGGHEuikazIwE5IEgc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) by PH0PR01MB7895.prod.exchangelabs.com (2603:10b6:510:28a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Wed, 28 Aug 2024 23:18:13 +0000 Received: from PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4]) by PH7PR01MB8146.prod.exchangelabs.com ([fe80::2972:642:93d1:e9d4%4]) with mapi id 15.20.7897.027; Wed, 28 Aug 2024 23:18:13 +0000 From: Steve Clevenger To: leo.yan@arm.com, james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V5 3/4] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Wed, 28 Aug 2024 17:17:56 -0600 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: BL1PR13CA0109.namprd13.prod.outlook.com (2603:10b6:208:2b9::24) To PH7PR01MB8146.prod.exchangelabs.com (2603:10b6:510:2bd::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR01MB8146:EE_|PH0PR01MB7895:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b97ef2c-bbb6-414c-ef6f-08dcc7b7b0bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: 7GXcZPfE871BtOS+AKRKMV5wkU8PF5j84qPb0CYdMju4iv0OhBfqQhPFfuiwUWMETbp9GfoIHE/3OZs62+5/C0Xc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XPAMw3D5vhHmai2OJDpsjzy1oojFwzKwU0RctQCIkfhaoNR9YGt4ubRPd9e11+qbXccI9nGIjnwtGU8xuBR2V1XHDXfqgpuBqgnh+NECQmjmSP6juBPxN8zSbTt2RRli0hwZrKbXXl5mW+5lcgpJkrxxmt9Yne1yKczrQ8DlCHj1DjgelT37UAAb0nxY0V5i+VW4DRjnTsAwoE71imCk+Nnb4aQvQD9uwhXnbDrDb8ti3lX5XKo/9diOkF5fseDRHjgt0ol9/pA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB8146.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AJ10Sz+fZuUExzdGEQGtQr4+LVGK+2dliJDnR9tpf0rsFyX4symS4VtVSmEzgmq3gjj4H30w9dwM7/fZR6x7r+fK7gNCANbjiJ8WpJ1bIt2bY+Mtu/Y/wHS9ou7RZwDJs8RNh3r01pfPIx6Kw8KqwE1g6UhEwnvod04VeABAGFYyEQb/Bxy9uxij3Zo5eTWxlYxnJDIU6f1EBIAttiI7BJXxLej9iU9SxOJLaQVenPWHhLSxCaBuRlaNs2uBgQ4XhygpHaCi0oBpgcS2Niub8RYpgjHMSu8Y5zV7GwFslzqp2yQHhJuiLBxnpKUkc6PWDVyI6rWuQQwyGYElfBoHOZYRNW5kDtpVdRr8QM+xEIXvGs9yZJ8nWkubaXppuZUjccTFecQLW30rpQqTXDBkKCMK9NQnMrWlA65dEnp4djZPfHUX+aSOG8mZJnyX5QK6/ziAQcaeDh4pbB6+HFMaTLxigIorfyXOvvJtTIbkjZBzt89lsmASz5mz7n/VcxgD0g+owyKsP6DLeNDiyHadc6alHmo0iMxOQpmJVhTBztxOmy1xIzsP/i95gsvyHDMwQ20W+86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WCRl8C X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b97ef2c-bbb6-414c-ef6f-08dcc7b7b0bc X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB8146.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 23:18:13.9008 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iV3wBXs9omSVyzicOPKefhigOuTxuWVCDt/0vxYzk2jmHdXO1PmT7QRf5tGSHfSKWyeP6uxq4wOBf9OQrA+gMXoAPVt/6IF9CeKskYv7g+3QOlt3d974BjEwW1IJEp9p X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7895 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240828_161818_629566_96C12905 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add map_pgoff parameter to python dictionary so it can be seen by the python script, arm-cs-trace-disasm.py. map_pgoff is forced to zero in the dictionary if file type is MAPPING_TYPE__IDENTITY. Otherwise, the map_pgoff value is directly added to the dictionary. Signed-off-by: Steve Clevenger --- .../util/scripting-engines/trace-event-python.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 6971dd6c231f..7b96504d5406 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -798,7 +798,8 @@ static int set_regs_in_dict(PyObject *dict, static void set_sym_in_dict(PyObject *dict, struct addr_location *al, const char *dso_field, const char *dso_bid_field, const char *dso_map_start, const char *dso_map_end, - const char *sym_field, const char *symoff_field) + const char *sym_field, const char *symoff_field, + const char *map_pgoff) { char sbuild_id[SBUILD_ID_SIZE]; @@ -814,6 +815,12 @@ static void set_sym_in_dict(PyObject *dict, struct addr_location *al, PyLong_FromUnsignedLong(map__start(al->map))); pydict_set_item_string_decref(dict, dso_map_end, PyLong_FromUnsignedLong(map__end(al->map))); + if (al->map->mapping_type == MAPPING_TYPE__DSO) + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(al->map->pgoff)); + else + pydict_set_item_string_decref(dict, map_pgoff, + PyLong_FromUnsignedLongLong(0)); } if (al->sym) { pydict_set_item_string_decref(dict, sym_field, @@ -900,7 +907,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, pydict_set_item_string_decref(dict, "comm", _PyUnicode_FromString(thread__comm_str(al->thread))); set_sym_in_dict(dict, al, "dso", "dso_bid", "dso_map_start", "dso_map_end", - "symbol", "symoff"); + "symbol", "symoff", "map_pgoff"); pydict_set_item_string_decref(dict, "callchain", callchain); @@ -925,7 +932,7 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample, PyBool_FromLong(1)); set_sym_in_dict(dict_sample, addr_al, "addr_dso", "addr_dso_bid", "addr_dso_map_start", "addr_dso_map_end", - "addr_symbol", "addr_symoff"); + "addr_symbol", "addr_symoff", "addr_map_pgoff"); } if (sample->flags)