From patchwork Mon Apr 1 17:14:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avadhut Naik X-Patchwork-Id: 13612888 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2041.outbound.protection.outlook.com [40.107.96.41]) (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 6140948781; Mon, 1 Apr 2024 17:15:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711991720; cv=fail; b=tlBfpmZ1CjM7TKHyKwmF1z99SeDX8LqWW04vgwp8XGLB4rNy7TK4gEW8G7Cit1NuVvssP+4fGrRQy5QiiCYYP9p5u1LjCZMAsYFvIUYLNiA/1QxduXWJgmM5nQ9kn7CKJRTmvgremljvxKcCW9C8WsWJ/N8n2kzQm0mpVP9Jb28= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711991720; c=relaxed/simple; bh=YnWoJicTFm+PI6G81czHDbozd/m9I0uQ8xiClJACEWg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vCS9Sf9kZxtC24QqfTJt3Xra2v7bzz0ZXEug/feRHgvEq2gWDQk9ftLYbuWs9DGt7DEN38zR3Shjealqpnbaan2dTWkNY7Niu4/i3mxNHqelsBKuUInFCnCmSoe+RVSkHsBKpmWJPeC3GJDHOw149f5PDxebevlcbQpCQZM/rCM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Cz71dSQ3; arc=fail smtp.client-ip=40.107.96.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Cz71dSQ3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHeOtUdgAdhZBKsgwue0aa6PPVB3IW4lzFqDMLGwAuE5o4yhdVvWZBkCigsTXf2Cwf5z9zX5fQXruXIEDVnkAmXI0fWPrH4aZp0h0A27wUDIYjF1s/J4IPcy2mJn93PK/741KNj+DdcNGY2AL72tE4PPDuEbC4iw2VpvG6LK8ZvxnyIm6807/xVvBCTatDquY+fzuduEMrbYKffcv84veTYJSFDl2975JX3PpAImF5wh9cC1+BhXmRL11nmGNbJvzJu6vaKbWxo1cz3TF0IUTfO8yrTcYqp22+0MqMkPxvUITCU0WQEtVUmk289nVA1RIgjqoX289CJdw25+5+aH0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=YOQWYGyLCjG9hkBQcr0XLruHlRsI8C/CsN5RXQzv5Vc=; b=BCTlaFXkSyzHUMrcPu/l3vnU/v2s94FK9CHo0carwJ7eKocWRjDLhO38kXCtUnsyQulQmvMjQ0C1zNtChCXVI0BHDfrWFlvRYcotyPhlb9HuL0CeWdDQVX9XB1JU7gQfeVOzJqhzoDM4QqWDBCBJAVw62Ha7YM+VGLEqjK/vH4odZGu5o5ESAirpiH4/3Z6mqkpMc/Cx6NtRmQYCwccYrBp2iGhrwFVbFbPuGm6w1zqjVvV/dV8ud9xdIhdfLrQAH1MH6B5VoQ1zWUYTaN6nmajM6W79woG2SqQAWHMLjsxIWU1F5fxEaCqVnM6W68Ob8VOYqnhHyJjxWnofjo7W/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YOQWYGyLCjG9hkBQcr0XLruHlRsI8C/CsN5RXQzv5Vc=; b=Cz71dSQ3Hab0B4Gr13YvMz8gt7vpFe6IV0XN/dBryeiXDB5eIs2coqpKcT+ymJ/YoV5e1KWEMLXg1LtXIBKcNxVYNxGocyW0g6VQGMng6SH7P/9cj00MVgey0w5tEwndijAdfzLxGlQL+H5Qd1bjTjY9ytcv3iTn9mFWyl4WxKg= Received: from BYAPR06CA0012.namprd06.prod.outlook.com (2603:10b6:a03:d4::25) by MN2PR12MB4063.namprd12.prod.outlook.com (2603:10b6:208:1dc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Mon, 1 Apr 2024 17:15:14 +0000 Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com (2603:10b6:a03:d4:cafe::95) by BYAPR06CA0012.outlook.office365.com (2603:10b6:a03:d4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Mon, 1 Apr 2024 17:15:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Mon, 1 Apr 2024 17:15:14 +0000 Received: from titanite-d354host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 1 Apr 2024 12:15:11 -0500 From: Avadhut Naik To: , CC: , , , , , , , Subject: [PATCH v6 1/2] tracing: Include PPIN in mce_record tracepoint Date: Mon, 1 Apr 2024 12:14:54 -0500 Message-ID: <20240401171455.1737976-2-avadhut.naik@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240401171455.1737976-1-avadhut.naik@amd.com> References: <20240401171455.1737976-1-avadhut.naik@amd.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|MN2PR12MB4063:EE_ X-MS-Office365-Filtering-Correlation-Id: aa098e71-2cf2-4115-a1a1-08dc526f4bbf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u0cmVv5WN8IfM2I/lClLSm3/Cz2O2bRBM/9TbF9w5Dpa++iTALyt97lKyVXeGs4Ys27QCVgfXfsZZ2aMcveQo48Bw/jyEJtvizplfcn8s5Y9mLTvqCmKUsDXd8/CczO82znwktLfI0pi6M6T3HAxSPlmRFQLmOBPdGRKwOBKAyx+dQnqRaMWimjg4gQfXJ27g52lDyjK4QtHRL3TfRJ6tu1GyWqvIg9Qq7TlNsKRH2SBcCXdUHRIy0+A+BdUazo8i4QY7rlTJbDSyuqElOtYJWAkWJrZIk5ohkz4isnlPnoZHHNqzSovfu7SW9zhZvuHuTTzGThuShZxqtl5jtIisywbMyggbfrdvdbXhGvP3DnqJZJOZkfk03uU7UeaCsHF+E2f3h1c/YPktIVbUOvXI51cbOEc5BT4mJCJ6HaXYw1LqWDJ6Hv3Q/0uMR+nUCNfzwYW82MuAuXpUJ2B7pmJnFQToSiLKloxuvAjclQiTmmIspiX6ppm42ghdr9Lh9zremLXVHq4xZE0unjx1HNO7eT8W9CbyMkTSSH86OC3oa7nxx2Zt5BLeF58c02X6wSCJlW+wXv7lQicaYflcx7gSLhSzfYzWoYHtPe+qlZBHpQTOTjt4RCwzgocgYyz8EokVV7W4o632Mk56yNBVHhXeBeHyoQs9VkTWfJGu4U2W23vQQ6AThu9iXyG2FlJ10JTVpqVuanBFT+JtqmNSxGI1ohzi2xVZO5uHZ1dXYZwNjRkrQowWW+NM+a9rLnIG+de X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(82310400014)(376005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 17:15:14.2808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa098e71-2cf2-4115-a1a1-08dc526f4bbf X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4063 Machine Check Error information from struct mce is exported to userspace through the mce_record tracepoint. Currently, however, the PPIN (Protected Processor Inventory Number) field of struct mce is not exported through the tracepoint. Export PPIN through the tracepoint as it provides a unique identifier for the system (or socket in case of multi-socket systems) on which the MCE has been received. Also, add a comment explaining the kind of information that can be and should be added to the tracepoint. Signed-off-by: Avadhut Naik Reviewed-by: Sohil Mehta Reviewed-by: Steven Rostedt (Google) Reviewed-by: Tony Luck --- include/trace/events/mce.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h index 9c4e12163996..294fccc329c1 100644 --- a/include/trace/events/mce.h +++ b/include/trace/events/mce.h @@ -9,6 +9,14 @@ #include #include +/* + * MCE Event Record. + * + * Only very relevant and transient information which cannot be + * gathered from a system by any other means or which can only be + * acquired arduously should be added to this record. + */ + TRACE_EVENT(mce_record, TP_PROTO(struct mce *m), @@ -25,6 +33,7 @@ TRACE_EVENT(mce_record, __field( u64, ipid ) __field( u64, ip ) __field( u64, tsc ) + __field( u64, ppin ) __field( u64, walltime ) __field( u32, cpu ) __field( u32, cpuid ) @@ -45,6 +54,7 @@ TRACE_EVENT(mce_record, __entry->ipid = m->ipid; __entry->ip = m->ip; __entry->tsc = m->tsc; + __entry->ppin = m->ppin; __entry->walltime = m->time; __entry->cpu = m->extcpu; __entry->cpuid = m->cpuid; @@ -55,7 +65,7 @@ TRACE_EVENT(mce_record, __entry->cpuvendor = m->cpuvendor; ), - TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x", + TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x", __entry->cpu, __entry->mcgcap, __entry->mcgstatus, __entry->bank, __entry->status, @@ -65,6 +75,7 @@ TRACE_EVENT(mce_record, __entry->synd, __entry->cs, __entry->ip, __entry->tsc, + __entry->ppin, __entry->cpuvendor, __entry->cpuid, __entry->walltime, From patchwork Mon Apr 1 17:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avadhut Naik X-Patchwork-Id: 13612889 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2087.outbound.protection.outlook.com [40.107.212.87]) (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 2ADEB4AEC3; Mon, 1 Apr 2024 17:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711991730; cv=fail; b=P8kRVHQjCCZYSQ1pGy5I8EMPPMpDkQPz37jG9AyfoePEtNeQj80K9c45i8h0nOpSSt4xyTdIEpjaiDGI0L9/xilWkyWMsVJDtGLkEh4lNqbfJ5P2nKKw9PKgKb0dkFJmHwO2cmr+Wv38fUPgmJDTTFNUpfJox1OZ9olkhnewpcU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711991730; c=relaxed/simple; bh=or1j55GHxNjuMRt5VuMlfBagzt+a+svU8lwBWj0jjZM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YAAXP48MKuh5G1tHf8GUiw7Tw1rjO/Xp+L9GL0ku8+8Z+rafPJzAiOsTSewNwzQp6US9U6hO6iykJuH5FURtlCZd0sYmUTyqLWOhbCeHITzunURUhHumJZIyXXbZKpNbf3IkQZaYqER42SP5Tx700ufRA8aOChkUgbBlMi7He40= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=JdtLx6E6; arc=fail smtp.client-ip=40.107.212.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="JdtLx6E6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8tEG8n+dUwMITN6oEMvWW0NdMo6CpFnzmRIN03FBJuWsJSUdiIpHdgFFmHxZw0L29r747u9oLJxaEFpZ8258VvYMF3Ck/7183bWl7T5ts3F73XWngKhHmI+I1n4CdRDKGbCZInCURvSmAJBz5XHjNbF/5hgW1US+uL56KXLc33N+vqMFBmvnTND8W+deno6D1SwLLQXnPSdGnZcca7URrjPAGGx2/vzWOd74oeOzm9CBOL7ZIILU0w8yEtGFkxSASIhcynuq4ciEuwWQ0Ef+b65iMQxxqKXJ842SJG3KJGBvugksvscYLIepGff5NLds0e5AE1ExgKk389L9N9J6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=HyuuF8lB40MkrPXDywaOJZPd11HbnYFg4yLe0qegb+E=; b=fNN1IaV6qcaqasjIl97Yh5qUPv6p3q8Ry0n3i+AkeQFxl4RDzdzfRtJPYPvs70bVyGww4Ek9ZppqNjbqAUCmsbNS92GtvLb8ZA9lzBXFZ1rOOhPpMuycZjMtwqlSTEvu48YS93pFX5+GpuunIdS6ecfek/7YLxT8bf9YzKfrn7YMJx5PMZA4VD5tqwETKSjNiGVdzqAtYk/7ODUP8DeVyrQMTlMGbwBw8xvLWKt4hoqeCrv8cLrdKVOFAsrtImD6czP/StqbycrbkkLgW+qzP33QzMHR5gXOQvXvSl7cnwT6fHHMJLTclyFDrwoBKcUNaRQZbGcCB3yJusRuhFB33A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HyuuF8lB40MkrPXDywaOJZPd11HbnYFg4yLe0qegb+E=; b=JdtLx6E6eMZvOKRZd0WrN7nDOnFKdpmnYxNXYZV9xRprgoBc6SV/ABENkUvVO7mo+zwEjWUOMmjjy1jsdFqbE8sDOrg1RmmDFrfoENJJuvpWQaNXEtAx0ulyxc5rXc+x9HZdNX+9VFpMTlJ9eLqzw8WYGH2A6bFcFEcaRel0itc= Received: from BY3PR05CA0043.namprd05.prod.outlook.com (2603:10b6:a03:39b::18) by PH8PR12MB8432.namprd12.prod.outlook.com (2603:10b6:510:25b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 1 Apr 2024 17:15:24 +0000 Received: from SJ1PEPF00001CE9.namprd03.prod.outlook.com (2603:10b6:a03:39b:cafe::f8) by BY3PR05CA0043.outlook.office365.com (2603:10b6:a03:39b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.25 via Frontend Transport; Mon, 1 Apr 2024 17:15:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00001CE9.mail.protection.outlook.com (10.167.242.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Mon, 1 Apr 2024 17:15:24 +0000 Received: from titanite-d354host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 1 Apr 2024 12:15:22 -0500 From: Avadhut Naik To: , CC: , , , , , , , Subject: [PATCH v6 2/2] tracing: Include Microcode Revision in mce_record tracepoint Date: Mon, 1 Apr 2024 12:14:55 -0500 Message-ID: <20240401171455.1737976-3-avadhut.naik@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240401171455.1737976-1-avadhut.naik@amd.com> References: <20240401171455.1737976-1-avadhut.naik@amd.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE9:EE_|PH8PR12MB8432:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cdf76a5-418f-4f5a-ad4e-08dc526f51cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kusQZYfEcMtzc9zOjYe05OW4buPE4wk3XGpxYzTXQzQbqyv9M/97SSGcxfu9V2thWN9XT1xnOokYu4Nn6OdVEFeA8kGsjOcSQsYc6pWpOXMh+5/a6c1+WqYO4ZVDid9JT2+WVy/2khQImMGhnMbUme7KCHXDAagQgJkHd9U3q0IwFGV5gZ4X1sAiqH7eGzvsq1ZsDkqh4ClJDzkOlxsV3yas8tldXxkXvRItoE7wsUJB4hvk3Aj7xEibEJrO5LP98FGSG4wpF+epCBczGsz7rx//Eh86XwG7XuThA48nZh+OagDouUreax1J12CUs5H18BL4kBoWK7s3PlyNzBwXcOEkxGJLmH5VGiYgHKrheSVfRWbdQQPTHSLjFF3YIOK9XFf6rK1yWDjEw4NMlxBaPzu7ezOa9M2K8XK1K2XEJjpnSlnO8KpBUJyreJil4an3wRbTTkisjMpJUD3BObZA8xmrKbLr6m1l6fzteHhr3dz9nywUmQkaO1BsY4NxqDxU/b1Bcz/5DKCEsm4Ez/YJ9QDQqNhlVkjq375WtfL8q4JJCQ/HdO/D7gXCjWyO4UtL2N5J8/8pO5P+ZTfA9FpShDk2W2s6varvZd+7uiWGDDp81W1+GO6W7C03paZPZkgpymmBiZYOeepBn0fsTcuEQWFwbAqilxqA2YfkEQwmXz0t7NgZ9XFetbOEhLeqXoo9FgG/his0DnpbBj2ioA9Np+j7eZa+nQRe5rqzoIQApB5bBfeZGsxcdLsYA6sJ1OM7 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(82310400014)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 17:15:24.4523 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cdf76a5-418f-4f5a-ad4e-08dc526f51cf X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8432 Currently, the microcode field (Microcode Revision) of struct mce is not exported to userspace through the mce_record tracepoint. Knowing the microcode version on which the MCE was received is critical information for debugging. If the version is not recorded, later attempts to acquire the version might result in discrepancies since it can be changed at runtime. Export microcode version through the tracepoint to prevent ambiguity over the active version on the system when the MCE was received. Signed-off-by: Avadhut Naik Reviewed-by: Sohil Mehta Reviewed-by: Steven Rostedt (Google) Reviewed-by: Tony Luck --- include/trace/events/mce.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h index 294fccc329c1..f0f7b3cb2041 100644 --- a/include/trace/events/mce.h +++ b/include/trace/events/mce.h @@ -42,6 +42,7 @@ TRACE_EVENT(mce_record, __field( u8, cs ) __field( u8, bank ) __field( u8, cpuvendor ) + __field( u32, microcode ) ), TP_fast_assign( @@ -63,9 +64,10 @@ TRACE_EVENT(mce_record, __entry->cs = m->cs; __entry->bank = m->bank; __entry->cpuvendor = m->cpuvendor; + __entry->microcode = m->microcode; ), - TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x", + TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR: %016Lx, MISC: %016Lx, SYND: %016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, vendor: %u, CPUID: %x, time: %llu, socket: %u, APIC: %x, microcode: %x", __entry->cpu, __entry->mcgcap, __entry->mcgstatus, __entry->bank, __entry->status, @@ -80,7 +82,8 @@ TRACE_EVENT(mce_record, __entry->cpuid, __entry->walltime, __entry->socketid, - __entry->apicid) + __entry->apicid, + __entry->microcode) ); #endif /* _TRACE_MCE_H */