Message ID | 20240216005128.1045812-1-stephen.s.brennan@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67911-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp218972dyb; Thu, 15 Feb 2024 16:54:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUXIS79a1pGBU+s4A4neORjO6GxsXQqMvcVdO0lR/1HJ25F2w+M2jpe/UscChOyrnKvEiPVEoIVn9k7YSN/TfJ2lgN9w== X-Google-Smtp-Source: AGHT+IHDjv/H1f5wWAVU/4XjSphTgf2Rw6vNwyYgSzdnGduck9hfsgfM9UCoxiMDqPvsT4MpejQy X-Received: by 2002:ac8:5746:0:b0:42c:5fce:e40d with SMTP id 6-20020ac85746000000b0042c5fcee40dmr3588571qtx.49.1708044887087; Thu, 15 Feb 2024 16:54:47 -0800 (PST) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 9-20020ac85649000000b0042dd5264d2bsi1740880qtt.139.2024.02.15.16.54.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 16:54:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67911-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="dprU1v1/"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xzIbAmox; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-67911-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67911-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ACB351C214D3 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 00:54:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A07512E6A; Fri, 16 Feb 2024 00:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="dprU1v1/"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="xzIbAmox" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 A4C18A50 for <linux-kernel@vger.kernel.org>; Fri, 16 Feb 2024 00:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708044716; cv=fail; b=rgnAvR6uLilSZrz4WGStsq9/DTBvy1HjYhHKVmuif2kVDyRBro43+H/VqY9NPu1cJI7nkeXHsI/QyhBiCB/p7jMmjZPRSypMwPgLWtIXMBoToy79Z7DfuwKXfHtgo9Wpmjqs7xaYinGLNoF0urXx4gEcOKjJ7RFAJ0ODCazRZUA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708044716; c=relaxed/simple; bh=wgE4aGtCguzTCgpprG10QKxkC3WUf8ZMfydzA4WEgwg=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=sTtMSFWWr9ebGRsF+R4I8iUwaP12+LDBwMNhf1Rb9Q5gEb+BWiGwpoEGfdIFN+WCzdL5bjYvETVn7nYeTAgfkkSa9ILQ3L/7qX6PgulCuympuvF8p4Qxn4o5kwnI3fwUNgO3465ZKKKvOpcp6ujbJVg35CzxGGzMSCy9rLlmW6Y= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=dprU1v1/; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=xzIbAmox; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41FLSMnW001613; Fri, 16 Feb 2024 00:51:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=e0hH5Kg91nZVdX48KXIAaDB6PCyCAM06EFMjzKgi9ZA=; b=dprU1v1/it7R5Blk18S+rbBRpdCJ37xO3IRH2Jk+6TLZjg+Z3Zdl65Ig6N5/k/luPczP PXfJ0qVmWabUJZzUob7fGAlt6SDeAT8lIE0W0oTwXb1IraCP0z4T9q6xpBtH+xatJm0i gGDfc95YrE/EqLF+5Jh2Bj2sCKx8xzc1rm3YGnBhYJnKUYdWbhHIqQrLgEvTgpFRAdN6 9gzTth4ayHy3veLrDXN3TGbENFr+EEEoiBeSOQsHxJgA9zhoI8F5ny7ogNbAx7JcK6vw rmnXtmdqyWY64zmEGMZyh2lS2R0ZxNWVSNjBwfudyxJlL+1l3uCvthmNSaHw43UXf5Ei rA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91f040gx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 00:51:47 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41G0Wafe000606; Fri, 16 Feb 2024 00:51:30 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykbdh1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 00:51:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bgc12Z2gsAfjw1sV6sfVB4oIalKED1woVNcDHUKwOwF554+40UNieObah8VsQSrT5qVkFKwtYAgI6pHtdfBAOi9xGeJepZyaEUJH20h8uV87SdWlLNJ9ZeuB4LQRDDNlSMWWLfBrAnY5+XhRIyFiW+Z7Lnfg5n/5FkxmXq/mYHBO2JdPM6lziJwyjKchMkVE1WEWXaqblyAAhwoBxp913WXQeNTzDsUbtoGje0v1vbOMfAg4uVk06hExUvK7fPOfM+GD3M2MpQMewG/wtG7VJDix20kDSji6nz2E6pIkLcn9ksCS/aQ3bevYxxCBMEs9kig83KDA0hQmD245fUOknw== 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=e0hH5Kg91nZVdX48KXIAaDB6PCyCAM06EFMjzKgi9ZA=; b=Ir1CKu2VLyrZQeEYwW6Cot+NJy8vRi56qEd3UQHowgbuYKr5CV4E3EbF6pSOZNIvbt+c4g0LvCMXVuNcdifuvChHp5nS2VjSzHgBG5fMx4i08YjvOh/7XFXHIwUPbdxHOxvrBesJ3Gb1tc9cfH5coSgXDjCa3IU3eK16wjSf1te+S2oarecZhWJHXP96DztKNfiC7/X57nXQABLaMrQFOOLlIAC4PXeKsOFVoPp8I9oJPo4zbyS1Lxmb2V9Nqf/y6z4vLuTtwpah9sKM7cW0XsCRfZK4pTu6FiwXhedKqGasbb4YIU4DGXWuLydv5zy0VhTfGkwhh4zSaZ89W/zQPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e0hH5Kg91nZVdX48KXIAaDB6PCyCAM06EFMjzKgi9ZA=; b=xzIbAmoxgGu4YOaW8Wp6D5MJoa75XTzptH4DjJRWkKO21O3NUA0v/6MpyaSnJxrN+a9eJpFa4l5yuiWQ11y0+fT/LGfQ29/Wzq2oK0hZzGJfzkhrYj9VaR6USKOOqqaHwixjcB3Nfp63PnlDr7Zm3Mct1vhMFhKu19xRaM2dXxY= Received: from PH8PR10MB6597.namprd10.prod.outlook.com (2603:10b6:510:226::20) by CY8PR10MB6905.namprd10.prod.outlook.com (2603:10b6:930:84::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Fri, 16 Feb 2024 00:51:29 +0000 Received: from PH8PR10MB6597.namprd10.prod.outlook.com ([fe80::212c:c0ad:d364:3883]) by PH8PR10MB6597.namprd10.prod.outlook.com ([fe80::212c:c0ad:d364:3883%4]) with mapi id 15.20.7270.036; Fri, 16 Feb 2024 00:51:29 +0000 From: Stephen Brennan <stephen.s.brennan@oracle.com> To: linux-kernel@vger.kernel.org Cc: Petr Mladek <pmladek@suse.com>, Steven Rostedt <rostedt@goodmis.org>, John Ogness <john.ogness@linutronix.de>, Sergey Senozhatsky <senozhatsky@chromium.org>, Stephen Brennan <stephen.s.brennan@oracle.com> Subject: [PATCH] printk: save loglevel before console_verbose() Date: Thu, 15 Feb 2024 16:51:28 -0800 Message-Id: <20240216005128.1045812-1-stephen.s.brennan@oracle.com> X-Mailer: git-send-email 2.39.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BY5PR20CA0001.namprd20.prod.outlook.com (2603:10b6:a03:1f4::14) To PH8PR10MB6597.namprd10.prod.outlook.com (2603:10b6:510:226::20) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR10MB6597:EE_|CY8PR10MB6905:EE_ X-MS-Office365-Filtering-Correlation-Id: da5b571e-f39a-43a2-ce71-08dc2e896919 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pc2P0KrduSg19xnvyQjTX35uMgKC/tpsgH/czksHOpL2V4e5eL/ucEMDAMkZj2i8USBxkEX0nqF3QxKw5yieZnD88hwUBo+qLHEKOmLo9o1NserbciHgVZIfW/eSsHxTJtIq4pPP4Q/T3Qa3mGwb+lxUhUH4kEzkzZik/NFS6e9JuAA9smYu1UmQMaBRGIdfFUmz78iQ+TSAb6d1wARmUBDFE+YZ5dnPVXjQNZ3xpFCpOHsLSthtqqFpB7pfLzeTkSW+kHKRaW4hod4nGtYLRnQ1WUBU5J4K2gGlT5Tq/QiijHM6CjRwHIPwUiGvjR7AcnUUN9Q5aAuM9Yx6KFN2bL/7MYtiYCiMqllEYV+Lo50rEcUk36+xrU8U40AV8fa5qc/GZmzri8Vu3bgA84thfEoG/1+sGgpz9ooVul6UBI85y9h4uVxQByH945nHz/5kCSOJ7+wG3I1V8LfJNI41E/9S+U7EC1WoTkUntggZnN7DZaSS8ByPUWvPupAu3r0NV/aS3ilzy86KQ0kEMotH7AEz14nlQ7pHHQl4jUKLh6DtYKRj6IXDsEYaZW6NLhzu X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR10MB6597.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(396003)(376002)(346002)(136003)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(4326008)(8936002)(2906002)(8676002)(5660300002)(83380400001)(2616005)(36756003)(38100700002)(103116003)(107886003)(1076003)(86362001)(6506007)(54906003)(6916009)(66946007)(66556008)(316002)(66476007)(6512007)(6486002)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5bTanKj88XHNudLN7rZI5WZn3ErjK78qVgtcWkLdUvaGKPWY+tL4g/D/pwaI5fTObyBRpEDsXqMgTV57l4FBEvjaPORVSucnnh0FDT5rOzrPnfhRU1UJm6eyDrmmJGuVHXJWHb74F8Hp9jtgIS46GvvdWYw5sbW4NBBClJbF+Ayoq301efl783wFIuUyMLN439MZyM5ledlx2+TswjllHveVc+WyAJ5D75u/KELesEdrr6WV5zDZYq1YshyDS03G4+bjy+q38zbYBD+ZWSYGTDJ7DyS2pTQAb1fQmJ5x/aY+oksXvLC207BcAzJwWd35yYMMweiC/hv50dFwtrjPq0NpVknL/9e4+m1CsFpPpBfmeMBn14AtOmyc6Cyg92JeeHKlO96LWuWWw6eLQKyYOyVaIC6eX19HEyil0PChK2EVtiF6iBIH/Y+/CFsFTUd+brpd0mJsp9mMAaK0MTCbJhOOv10ODm08v9cjWVyMu4wSc0m8Rv9n+Mw2vykaFPDYwSrm1OM0kipgfcD0/jqFumajxqUkNd77Xd2x/1ulp7BLYnEbnt56cVSYOIIkiND9bm5ca48WeFIX9xYdeML5+NvPZciVvjiVhjm69EvpZb4Ch2tMwgKDZRuvvK8mZXKXguDNshDN31YHWImJSur8jLztfSJCz2vm6dnqcc/hPzJkL+AGhXWvdkQRXruCuUacBEak166k5sqAvsY3j3U0ZKGk+VUX7G+lh+bfwoeyoXzlXE/xLB38UeETjNu6k4xkrZkiMZRaSoyi8ZPgUNT7/I5M+Nq4/winTgtFWyO5nbsJ6GcbRHXOQmuoe2e4xcOFFeSRqFVlWg8QKUp8AhhC4UJe3SlaPM2pZmEQ06PD1lEqRQoi7WXJ42fqYAIHWMptT5lTAk0BxIDuRleAg1YYL7VpH1r4vzp3y7osp5JS04Fk7nCtJ00AipVqBKzH6GhaJkpgUeRRs0fE7mkq0KNu+DRV13s/+TXLtENAdlFnJL1aZjytVHgekgCsuOr/izwG2StB+DIQg8pQgsbEkGgQLT7Q4pAgi//stj6Tcr3uUvZebzN4+nRYW9V2BTOPckfq+Yef8i+UezQehxoRrJ8rbfOllGn9mbxyVsJl6TRTVKiSuMcD/tnwFs7t/D+IY0+aLnlt/elKNraqCECRv07fYYKgQRObFFH7b78jxfl0c7/lls0/QtBdvfoT/7S50a5xP41FGS1iR2DOTwyOW0/4VomeccyPo2Os82S8Tjx3vGTlOdgHYzBM9z2aWitBAo+whaj3H/RjEfEwWeWgfJMaf+o90Caz2e+0xP2VlNAYJ+OeVCmPdVOgEohQ6R/gsJucp5pJxImOC03dHn981IOFHLjrAu4JEmN5ftQsw22xlMwVnzWkQFllV7R4hJ0oApP204bRMjC1nGztqfZg2F4FKTo91q1HbUyAI0u173hYJHsIuaG1XfVixI0ES/Ah8DRBWSGa2NbyfgCtKoarHE/ZbDroNSMgwYPIToyJN9uWraemeUSCWpkABj1TyOAc4vdZ/HO2yeZ2T6QXwP0L/ijikJU4gYpfdIh1jnqKriGPpJuEn8GkoUyNEL48FcrvMI1UD9OYkpilaszqmaBzcwhn/yMuNFjjO4OdK1YskEdleac= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xgvEXo3UO4jP4TK9S6sPF6/lGPiKiCVnaG/fx2B4ynvqJ2xUMl+C9FFIwoPTIsjvHBPZ1JWRVC2lOwL6LNcqIdACQRRD9hzXZOIlfhWRrjVSvTkrLF0yd6KEJELXo/5TvdtquSKigVjYGI8XSz6FM3ILjNEedQWhab1BtCl3kw9DzBcb4v4IqJBvJVEbdweUZFJ5Jum5PxCrHA5BAEfguq2urm/qDYr3qsNgCxAG1+i0yQA7/A8IiNh/p9ZIPlGPrxCBW9WWaZ74BxQBGpnQbi/uYPI8Kc6FKud/2dmViW5X/GnBBlruPr+dNiPlIham/sJBmrdMgaSjFE4xsa3RfWmQIJOOY00eDZCRWtvkvW2Yla17/OWmY89R3hpxyPwXOdowQSvkBALSwIEBZS+zVZpuREVZVi5cdfwDeT1+/6+SBORKNu6xAPFWJMOYoRPUvrupAi15ORRS6stFJUeYhM7dRlIn1KMRkikkEFnLXsUJZqs5Fm2sFP6GWR3/IKPH5GW0hgYdv6eig+KDQAQfAEWAb6l/mNFsZzr2oxutlUuSh+xVkucEz/fS9ge+H7AqRGS7wUU98YK5xhuGN0JvUknFRA7fbytZ8K7013tb/Ik= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: da5b571e-f39a-43a2-ce71-08dc2e896919 X-MS-Exchange-CrossTenant-AuthSource: PH8PR10MB6597.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 00:51:29.0393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1cQpAcx2ap9+lqPO0M60Ymuvjb5ddO6+v4+sza3pCf1vwqNARBDWaTUvNP8i01TbHrykKFjw5F7z6ZY6Oa9EuIc6PnfSSZy0F14spxbenFg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6905 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_24,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402160005 X-Proofpoint-ORIG-GUID: t5ShvSU3ErPIYz0XwPinNdQpBHlMvK2A X-Proofpoint-GUID: t5ShvSU3ErPIYz0XwPinNdQpBHlMvK2A X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791014875792378024 X-GMAIL-MSGID: 1791014875792378024 |
Series |
printk: save loglevel before console_verbose()
|
|
Commit Message
Stephen Brennan
Feb. 16, 2024, 12:51 a.m. UTC
In panic() cases, console_verbose() is called, clobbering the
console_loglevel value. If the bug which led to the panic related to
printk, it can be useful to know the log level prior to the
console_verbose() call. Save it to allow debugging these cases.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
---
kernel/printk/printk.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
Comments
On 2024-02-15, Stephen Brennan <stephen.s.brennan@oracle.com> wrote: > In panic() cases, console_verbose() is called, clobbering the > console_loglevel value. If the bug which led to the panic related to > printk, it can be useful to know the log level prior to the > console_verbose() call. I've done a *lot* of printk debugging over the past 6 years and have never had a case where this would be useful (or even interesting). I assume there is some rare and particular scenario you are trying to debug. And once you've debugged it, it is no longer useful for you either. IMHO this does not warrant adding an extra global variable for all Linux users. When Petr gets back from vacation, maybe he will have a different opinion. John Ogness
On 2/16/24 01:22, John Ogness wrote: > On 2024-02-15, Stephen Brennan <stephen.s.brennan@oracle.com> wrote: >> In panic() cases, console_verbose() is called, clobbering the >> console_loglevel value. If the bug which led to the panic related to >> printk, it can be useful to know the log level prior to the >> console_verbose() call. > > I've done a *lot* of printk debugging over the past 6 years and have > never had a case where this would be useful (or even interesting). Hi John, That's fair! The point of sending it upstream is seeing if anybody else uses this information or if I'm the only one :) > I assume there is some rare and particular scenario you are trying to > debug. And once you've debugged it, it is no longer useful for you > either. >> IMHO this does not warrant adding an extra global variable for all Linux > users. I've been seeing bugs (to be fair, on older kernels without the latest printk/nbcon work, which resolves much of this) caused by excessive printk logging & slow serial consoles. In some of these cases, the loglevel was set low at boot but modified by an application, so it has been nice to know what the _actual_ loglevel was at the time of the crash, which I can use with the console baud rates and the log buffer to get an idea for how backlogged the console was at a point in time. But of course, the console sequence numbers can tell us how backlogged a console is at the time of crash, and you can infer the log level to some extent from that. So I can see this not being as valuable generally as it is for my use case. Thanks, Stephen > When Petr gets back from vacation, maybe he will have a different > opinion. > > John Ogness
On Fri 2024-02-16 08:02:20, Stephen Brennan wrote: > On 2/16/24 01:22, John Ogness wrote: > > On 2024-02-15, Stephen Brennan <stephen.s.brennan@oracle.com> wrote: > >> In panic() cases, console_verbose() is called, clobbering the > >> console_loglevel value. If the bug which led to the panic related to > >> printk, it can be useful to know the log level prior to the > >> console_verbose() call. > > > > I've done a *lot* of printk debugging over the past 6 years and have > > never had a case where this would be useful (or even interesting). > > Hi John, > > That's fair! The point of sending it upstream is seeing if anybody else > uses this information or if I'm the only one :) > > > I assume there is some rare and particular scenario you are trying to > > debug. And once you've debugged it, it is no longer useful for you > > either. > >> IMHO this does not warrant adding an extra global variable for all Linux > > users. > > I've been seeing bugs (to be fair, on older kernels without the latest > printk/nbcon work, which resolves much of this) caused by excessive > printk logging & slow serial consoles. Yeah, printk() might block a non-preemptive context for a long time. The current owner is responsible for flushing all messages which might be added by other CPUs in parallel. There is some logic to handover the console_lock() but it is not reliable. And yes, these problems should be solved by the printk kthreads. Even though, they would not help in panic() when the messages must be flushed directly. Well, there is a patch in linux-next which would block printk() on non-panic CPUs. It would help with some problems as well. > In some of these cases, the > loglevel was set low at boot but modified by an application, so it has > been nice to know what the _actual_ loglevel was at the time of the > crash, which I can use with the console baud rates and the log buffer to > get an idea for how backlogged the console was at a point in time. I think that systemd or an log daemon might be configured to modify the console_loglevel set by the kernel during boot. They do so during boot when the userspace services are being started. The value might be read at runtime either by: $> cat /proc/sys/kernel/printk 4 4 1 7 or by: $> sysctl kernel.printk kernel.printk = 4 4 1 7 It is a quite confusing interface. The console_loglevel is the first number. I doubt that any userspace application changes the loglevel later when the system is up and running. > But of course, the console sequence numbers can tell us how backlogged a > console is at the time of crash, and you can infer the log level to some > extent from that. So I can see this not being as valuable generally as > it is for my use case. Setting the right console_loglevel is problematic. It helps to remove problems with too many "normal" messages, for example, during boot. But people usually want to see warnings, errors, for example, from rcu or softlockup watchdogs. The sad thing is when printk() and slow consoles make the stall situation even worse. Let's see how the printk kthreads would help. Finally, I agree with John that this patch is not worth adding. It does not add much value for most users. Best Regards, Petr
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index f2444b581e16..97bd9427f118 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2521,11 +2521,19 @@ MODULE_PARM_DESC(console_suspend, "suspend console during suspend" " and hibernate operations"); static bool printk_console_no_auto_verbose; +int saved_console_loglevel; void console_verbose(void) { - if (console_loglevel && !printk_console_no_auto_verbose) + if (console_loglevel && !printk_console_no_auto_verbose) { + /* + * Save the prior log level for later debugging. Avoid + * clobbering in case of multiple console_verbose() calls. + */ + if (console_loglevel != CONSOLE_LOGLEVEL_MOTORMOUTH) + saved_console_loglevel = console_loglevel; console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; + } } EXPORT_SYMBOL_GPL(console_verbose);