From patchwork Mon Aug 26 21:35:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Clevenger X-Patchwork-Id: 13778519 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 53B7DC5321D for ; Mon, 26 Aug 2024 21:38:11 +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=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=VwQaMT+226WjiBIHhjEiRIJTvK wPIofx8fUWTIOhufEG3Vrfrx502daxtMdd4SE0Kg1HneSTl50UiNs6jzof4BI47NldWfJUb4GSIc4 qiV3Ub+dIYehyaQT970peKGFwraDowU/+0gKkZoYHSMK4xI43p+nC8MKzlYIeqB5CG64N4f1xPIr4 rmmY4ct+eiYcyvar712iZjp3yKyN2YcBawN7GqroQ/+BTxNAbFW0JXsF6bgRiBrbI2pgjgJvn01TC zQfjGYd9o6aCsdKAe3/bHiM2ApADQRqx9XZ+oE/VkALg+/iaWdk0zha9/z/FlpVEuJtFmmSxIBzh7 xKqAF7Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihPT-00000008q9J-1fPi; Mon, 26 Aug 2024 21:37:59 +0000 Received: from mail-eastus2azlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c110::2] helo=BN8PR05CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sihNw-00000008prN-27n7 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 21:36:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JQTEQ2EeyFoXtVOl2JM6DcSqpk+e/6/Ht/CcJP09gz5/Z05QkGEkK1PHlAeVxThQFNqCEu6E26cQtZvF5cA83n4V2E6ivbGjCKmEHO6PrzGRHaETVKuHa+tzJzIUS0PWrLSCyGXOGZlpjqc2d97b1+CbDL4lUo1wD7TJL1VLbDPsaNxVw/pYag0Qa2PR4lllnRBrmzZZSXd4G982zpX1FAjSBTMugVQTTobtiDgT9E9UFGHmE5x0G6ynM3rBKq1RzUgDgh8ZFZycC17ZRbUjSCLYwTAi8NebUZ9PbLai86OSJYUh771JjOplCUfEHHl0uLt/PJgLXwVHfdQ2QOFD2A== 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=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=HYt/yiDX+NYM/xvZs4giOMSiDkKuyn+zEuUqGZCJI1kDFPEibZvZZPYL4XnW852cZ2DcANrr/fi/kGVkjOeOx4Cz3I6kPPE0QJkFTsbCmrdEJkQmWK0iOF/lgqYKAyTZbbhU4SVh6G42WFnBWvAbqDXD1VFpPkC9t9hmXzC0m4fMG5aYjqzebI03piJEcl5weIrbJZbVWnZk2Zwlin0Tx6jz9CNdZirDolU/+QDp4F9/5kp5wicCCeZX+D7dU8CkvVTnC/917kFtlu1hO5NgQn4cAYGZvXtZ8/vtaXt2uUUVvFkjpKf6/zkV7bsBKDwbIQW52JVqoH6tKb1Cc1GpiQ== 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=dyJOIoAT/e8kDozGR4O15DBCTLg01XAPpAw7eBjWNjo=; b=fvDGWXbB2y0jdRnabe/tUoS1AaejR+TzmespaF17huT1JfuSIaImviFAnlfxLZccR5p27nQzlWP5N7BR0mP/C9U/9GJ0ODMxAGZaCyfLoBrf2cfFo3hbC+bA34zh7Bj70MLg9ii8RmtFXz3Sf109EL5VPziNSNQOD4vPJ2HgtxE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) by CYYPR01MB8410.prod.exchangelabs.com (2603:10b6:930:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 21:36:17 +0000 Received: from SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea]) by SJ2PR01MB8150.prod.exchangelabs.com ([fe80::72ca:29db:7676:9fea%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 21:36:17 +0000 From: Steve Clevenger To: james.clark@linaro.org, mike.leach@linaro.org Cc: suzuki.poulose@arm.com, leo.yan@arm.com, ilkka@os.amperecomputing.com, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 4/5] Add map pgoff to python dictionary based on MAPPING_TYPE Date: Mon, 26 Aug 2024 15:35:53 -0600 Message-Id: <2c0276834838dd444ad11fbbe670eca9c17f6ece.1724698250.git.scclevenger@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: YQ1P288CA0024.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:9e::7) To SJ2PR01MB8150.prod.exchangelabs.com (2603:10b6:a03:4ff::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR01MB8150:EE_|CYYPR01MB8410:EE_ X-MS-Office365-Filtering-Correlation-Id: cfbdd500-02f2-4bb7-e2a2-08dcc6171e2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: hdsGdBcpIrkMC4B4j8rr1fassa5IXFXeWqJqcVvZUwYRo38pVqv0x6Pbv9V2RCoC4LNcIJqyK0RXTSK61ug1RNChMFhb0fbp9fBIxOmJE9hvf+xt8uB7R+bx61kKQUQCWwK64naI1Qty7ahk/5PfnB3cbF0HQiZAYk9/WUfwwbKL7BWObxh1+oqSGr2MuQbbyMGxGRd21tT9NctRhi1cLT0shXEw52tWeP0RDoIYCzCz2z3CH7ajsNJNZggEoch73mUdENWuXdmfZic8KmT+MT+kLoLtMiaHRjsna+Kv6QbXxiiCU+kRlg+Xtcq6q8UNzZj1IMH8ZcO4VEoM/5WWfwh+7/S0yKd1IQgegRq3LPIye2g5T/KlxiFFUb63Mlqwx9Wu3Fbo7R3I20KrzeprZZFKPkOprEcL4zLNzz/R/zRdVi9fS7S1r67GFVU+xPxH64Ij9StfL4AY9ALB1e7eTm63KT9z2+K7V9iwqqr3bRlqqdmI0SqHJYnpICx2m8R1yVxs5KXuvOWMKcVF4wgFr6jyynGjlmg9Fk+eUN9bNf1DTFrn8BXGpFH6asBi7yVgm3eFguWDmvsE267Eh4u3YGqZaqWR15F2YK78+qyZUCm6XKJhcSananTHxrcBjwQ2U9h8gW95Q/PknzKOcek5g3gVrXs7XRkBxPE5kLvdsga2YaulwQ4FxjtCVB02di3e30+gSxLq2syo4S7/Bis+KZcRSK8Hit+JwTHljJU5cU/QlVGfan0c4rHFCQcwL3dPgo1MJuYwOo5+pE2ZMgvaHzjCXCgVFyKnFbWtoSe9n8jRDWdy0s0/GQpteiud0k+wGHj2ygWHxiFd6s7G9M20mrRO4RIuS5H7PrrnqrnQmfnkGxRD1uBXZcfZmFLbnpziJhzbus3wJR5j+vyHy7zrhBgJJjmT5T+tJ6cZYnJa8EMZ2y48lcjbuw6/XdVi23TYJLeN69oZCiiFIoRYkhr2pR6tvTFtBdTvZQ4DD1PFnAdfvQOM/RKmjAbrB0ShoeAonZoSh/SkPB7mHtEL2edH/UTiwLp2EJ5ERVxj1qZJcH6AjLog685MeyH7Taa+eWbHDTtETtYq39zkldoSyv3zTPx0Ml6Y/DYfLHY/QFRtDWPDVYzZ74RNoe8npQ1mCHsZDflbDhSoR8VI5WS2II5VI4ebIkAF9Je7DMvsV3wC5WnapnGsYPrZIHvvgiObFsyAw1/mWm9LPLwOJbE7O2G1guE3shpyKO84UP5OWe73C2MoQBZEi73B8EZsCW3/lrTr8iRs0qGxSWgiss3bimrmo1LDTNxmK+qFNXkiKZZqO3lRIVyRr2jOHW2hZMiwFVgqacuBDnhveSIiUugkAKi5XxsENurjjZoc1lsRg2Ssh/Kd5T+Brt/Du/DARjerjj99w+dPIdcd/vXQadR+HMvhOw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR01MB8150.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: up1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Tqu2d32C+SCksI5h9XkZTR32YVp8wrKnxMzsCTrE7wRTEWfAGdgxwYRv23u1X7LM4XuFPtuBOKfKhcoFIxdi+raoIRHc/t3CQUTyF5w32NjEDBIm/YTqJJKAz1XyalKbDi6vUQNRmDYKePlF0wVugNuWphhOgZ6oz0It5/RfkLx8allEqZXwnH3FveyIuC5rSj6q7/M32VXnna064s13AxRO1y4BmKT9lEplACGVe0ryCQsbiy9oQ7vWm7/RDe+3cu6W0j/rEUdWKd6Drt/eBq4ms//fxBi1lv49B5kTtnUO0FoUUg9udqoTwcaxIVICEq4Z8fHccRHDd/kmN8QWobkK8EOQkq3504JcvQAuSwub13gPLyUuklmg7/y11uTCnrLMHkuNyJbvrG1qaPZUnkuD5iVGFalSq0fwEHtfUrWkjgUdtuO5i5tvwHrB7yvAXfr9jJZFfii+m5UJ2Q2hwXXHoZJ2Mf9FAHIDlBoRmA68laG6l4WgOxVQPdXYAWyufvOWPb37aGxTBEzWliiqNNYlm7pyGBHOh8BpaO22/uOrvP4kF66aR2P/9Z9wY X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfbdd500-02f2-4bb7-e2a2-08dcc6171e2d X-MS-Exchange-CrossTenant-AuthSource: SJ2PR01MB8150.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 21:36:17.3676 (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: yfpZi6S+EfDOEIz2DaQ7inkcg7RZqbXOhyHjeSWYeD49gp7Zf+RDzOD1VmonQc4UoL9HI4N+ha9CrJOER2v9eM3AGDGKTvXg/xQZZvie9EF4xAjlVxuDHXYpVnHpRsn4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR01MB8410 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_143624_573275_C382287A X-CRM114-Status: GOOD ( 10.92 ) 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 Changes in V2: - Updated mailing list distribution 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 fb00f3ad6815..8a056c3574ec 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, @@ -898,7 +905,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); @@ -923,7 +930,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", "map_pgoff"); } if (sample->flags)