Message ID | 20221123231400.614679-5-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3081363wrr; Wed, 23 Nov 2022 15:18:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf54a14ytBAANfgfPn+D7cAZwOk+ovL1Uq/4ZF7hI0sbMIsCI+SkGIW4TZzeIKcD+nw0mCGa X-Received: by 2002:a05:6402:2070:b0:467:5e4f:591 with SMTP id bd16-20020a056402207000b004675e4f0591mr13202880edb.414.1669245524936; Wed, 23 Nov 2022 15:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669245524; cv=none; d=google.com; s=arc-20160816; b=qCeGmGJbjwrDaROtL42OZm/Xc3lRwU8nYZR6U4wGP2DHV0Ja4eR7cdLPG/wKu+UuSR tbX0VpI+s88uPkJt2FLbYnItfTwP0/4DgInA944wDU+S1+58JJuM2IUGmHCIvhxsPlzQ 7sf1WItYrBKYC661PnDjed8n7+0p1rvr0MhG3SqRTNaA2jQoWLTmjnbyM+efDeCNGcrt bcHo0Mfzbwq/f1u3C21rwlOWHNe6l7+LlWYL5x0AQKl3J14Bf0AyL+a+OIde8GgCis7J wWJ+aEntqmAsPHiYyd4DJykHHYOQs5BfyGQfuiYAIxZpXFTUmM8y8CHlAQVcdgmoc33k 5G7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=aHekk7rHrVj5L5T/94RT0HyGLRna0DzwZs8ha+Ccyvw=; b=hejo9BOiV+tYa8RPTS8F55yY7rYy/auh3AwEInuA4+Ixv1cr/TXHtbYL3kQtyBhnuW nirS0imgALS4KJw8w34m+xuikr41qq/7IJh4+Igo9JlJtjl3M/P46U4c8U0nLeYtefh0 kGj4MZGoqvISFMeY5jTPY4R7IYqNEVzVMuQpcDyFO8A5FNgSjLb2qfvUhsDnXiEx9DXn l7gn39Qj2dbhBixJDbqvG/FLukoa5NfmmFi2Hjsr6JsdZ6rWj17dctQbCBRF0VQYJvWt gxePOGHGg8yamuexEo46n8fybblnUrcf0UxQHoWxpEWAw7Bn3UBh7oBYWqGxFS+6HxEP AcnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rUgi9ajh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2GHZKoSr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a056402274600b004488842d88esi16425108edd.13.2022.11.23.15.18.21; Wed, 23 Nov 2022 15:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rUgi9ajh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=2GHZKoSr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbiKWXOb (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Wed, 23 Nov 2022 18:14:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229732AbiKWXOQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 18:14:16 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B7136BDEE for <linux-kernel@vger.kernel.org>; Wed, 23 Nov 2022 15:14:15 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669245253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aHekk7rHrVj5L5T/94RT0HyGLRna0DzwZs8ha+Ccyvw=; b=rUgi9ajh583f3DafswGx6DnJgtX1nVcRAI0OyvdmARANW4/vl6t1tWVQkHydEMakuWWC11 USYMG+Gs8LFd4tcL6UReH+pZX4mBlHObcxMHf+AKL9UvcdGeq2e4uRKAyK3le2jXCfAyts n+ppQ+9SW7jvNmqXyvoh7/2iWz/RAsfVn06Qu+ag4MlIBbVKOFMMx4XUWSPL24cMJhemaG KDXxrR6MbH+huS7Ii4ul3e2XVCASSvMolb6UQO103ehl3MO+mKu5qQCgzzgM2anf/BKsWW YlLxKESOAulXbigFgHDL6LRpLI/6nlI5QTGHxhVtPG9bqEfXBWEvBZnAfNkWtg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669245253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aHekk7rHrVj5L5T/94RT0HyGLRna0DzwZs8ha+Ccyvw=; b=2GHZKoSrpfphmj+qCrBjg2+U05bc9CFtPkG0ZSPQaa+D8zKrUOuD28SZDr66qVARIhuUIb dM9dzZOLn74ztsCw== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [PATCH printk v2 4/7] printk: Add struct console_buffers Date: Thu, 24 Nov 2022 00:19:57 +0106 Message-Id: <20221123231400.614679-5-john.ogness@linutronix.de> In-Reply-To: <20221123231400.614679-1-john.ogness@linutronix.de> References: <20221123231400.614679-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750330795516747388?= X-GMAIL-MSGID: =?utf-8?q?1750330795516747388?= |
Series |
printk: cleanup buffer handling
|
|
Commit Message
John Ogness
Nov. 23, 2022, 11:13 p.m. UTC
From: Thomas Gleixner <tglx@linutronix.de> Create a data structure to replace the open coded separate buffers for regular, extended, and dropped message formatting. A separate @ext_text buffer is needed because info_print_ext_header() and msg_print_ext_body() are not able to add the needed extra information in-place. @ext_text can be used for dropped text because they are never used at the same time. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Ogness <john.ogness@linutronix.de> --- include/linux/console.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
Comments
On Thu 2022-11-24 00:19:57, John Ogness wrote: > From: Thomas Gleixner <tglx@linutronix.de> > > Create a data structure to replace the open coded separate buffers for > regular, extended, and dropped message formatting. > > A separate @ext_text buffer is needed because info_print_ext_header() > and msg_print_ext_body() are not able to add the needed extra > information in-place. > > @ext_text can be used for dropped text because they are never used at > the same time. > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de> > Signed-off-by: John Ogness <john.ogness@linutronix.de> If we agree to use the static buffers in struct console, feel free to use: Reviewed-by: Petr Mladek <pmladek@suse.com> Otherwise, it should get moved into some internal header. Best Regards, Petr
On 2022-11-24, Petr Mladek <pmladek@suse.com> wrote: > If we agree to use the static buffers in struct console, feel free to use: > > Reviewed-by: Petr Mladek <pmladek@suse.com> I will move the struct definition and size defines into printk.c for v3. John
diff --git a/include/linux/console.h b/include/linux/console.h index b2cf256c23b6..641c1ca7fb67 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -178,6 +178,16 @@ enum cons_flags { CON_EXTENDED = BIT(6), }; +/** + * struct console_buffers - console output text buffers + * @ext_text: Buffer for extended log format or dropped text + * @text: Buffer for ringbuffer text + */ +struct console_buffers { + char ext_text[CONSOLE_EXT_LOG_MAX]; + char text[CONSOLE_LOG_MAX]; +}; + /** * struct console - The console descriptor structure * @name: The name of the console driver