Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6935710rwr; Tue, 25 Apr 2023 06:07:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwS+7hbbSXstOjyzLCRZDzTFy4QWq38I3twhHLT5ftdHcxJU4M2rIJAyHzhyF5x5Exy9vr X-Received: by 2002:a81:8415:0:b0:54f:64d8:9c9 with SMTP id u21-20020a818415000000b0054f64d809c9mr10723797ywf.21.1682428077757; Tue, 25 Apr 2023 06:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682428077; cv=none; d=google.com; s=arc-20160816; b=ZcPNMvM3it02C/V+bnqCO37kVeUJ1yJGTTfzioEH6nmiZsofHXAYKXElLS15F2DWbt T3K7UfVMrv4UxYLEDVugAzYIgifJzP+87CpfPFFkHltR52uDDMFjmOuDcmnWFceh9hY8 zFBirfn+i6oF2KRqzQ9UNqYgFiekY6QxmGamSflWTGDzBnIC7pR7NBLn2z6BqrgVOC6X C0c/f/7MZZbmalFyMtNiIjFZtgZYIPNqbbB5zwOG7j7huTd1legUIv+qp4zOsDMnHku/ Ds+cTjWYr/GcnHY1NLIS0ENLqGChHm0yT7PlmBR++OTNlBkOlMeBIrfWN3ue73WbfjSZ 9Yqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=f4JUO4YXA0ma7919A++Kq/CnoiX6aejq3rVfiMJYAPE=; b=NeqaSOTeH+0P6eaIHSU1gyd57IM9UbiV+E0HuKO9gnxxcvDeyb45FIr+n0x+V/9jvb wnaK7y0MUdpEBy4o2dKDM649WSV0L35McWen3zrnnIg9C2n8dz36n4RbzHXeQ3Fza5tr 3F6D9IzEwHCeQgFL48yD3U/OpxFXy60dmxzjSwbGWbNaegqMUOOyvwWULE2TgwIFfItq PXqnMmzlokw1Sd15XQ4fuhzKMlVqLawEli9tWNo+eEQXktBOdVVQYOkrTAJwy7LCvkjC ZLKDieQc68SzAU7dRKgYnUJLjDdWp4nr+5MwWL/cc20rKLU59n9t9Bw6x4LHCEzm/tQn FbZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=k+V1dAuY; 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=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p65-20020a0dff44000000b0054c0ac48f4esi8855912ywf.197.2023.04.25.06.07.36; Tue, 25 Apr 2023 06:07:57 -0700 (PDT) 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=@chrisdown.name header.s=google header.b=k+V1dAuY; 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=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233368AbjDYNGZ (ORCPT + 99 others); Tue, 25 Apr 2023 09:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjDYNGY (ORCPT ); Tue, 25 Apr 2023 09:06:24 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2233610C for ; Tue, 25 Apr 2023 06:06:22 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-508418b6d59so10577349a12.3 for ; Tue, 25 Apr 2023 06:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1682427980; x=1685019980; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=f4JUO4YXA0ma7919A++Kq/CnoiX6aejq3rVfiMJYAPE=; b=k+V1dAuYJtRQmXzzYwXOGWcKJxHf7YFbQy/kvJA5BLUAHxbnonVk0BednrBNc17sut hQq8inKO3JogWNEVXNm0Ynw3RzNMVDw0H34r0vJRkP5Z87VwVXQFZ6cC5io8AFy3XJZf qeOsBjfVKorCY/UbV8MrTyimOiztmpzMqYCxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682427980; x=1685019980; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f4JUO4YXA0ma7919A++Kq/CnoiX6aejq3rVfiMJYAPE=; b=aI2sJxKMdqrw+MYGmX4WtaXmH6WpEUtS0CAnX1bjplFC+UoyCYUAYJhlF+d5YAwFYy k/EM1b5Y+sv53yM+hdSNGONVuJeZtlw2AalTqtmeqIo1HoI7znB6HVVg9e3Pg2wdizu8 NDy59m427eZgIz1Tfh9ZJhELVSVCSJQrvSLaTxCRI8XBWm+crw2JgiEl7K5Qp/p2xIyI 42dHTMX+01wFux27aZP6Sf4OODtdLJJ2umZcnr3UFE3sSFfsC0hOHHTQASy5ydRR79xd +LA0EM/oLbEpFNhyD5pnEFOtKfKu1utQr09QvDef3wxuRDKOdG2Cn8QVVNmo5m7raYlw ZBGg== X-Gm-Message-State: AAQBX9e2ePrulujhIIpEFXeS+tcdxV+0PLM+calRb9wl7+MEthLREP2U Lqt9LFBwDQgQL+iWu5RN2FsAH1EcaLP1f+oUVTw= X-Received: by 2002:aa7:d88c:0:b0:506:be07:3473 with SMTP id u12-20020aa7d88c000000b00506be073473mr15901744edq.4.1682427979973; Tue, 25 Apr 2023 06:06:19 -0700 (PDT) Received: from localhost ([2620:10d:c092:500::5:530d]) by smtp.gmail.com with ESMTPSA id k2-20020a056402048200b00501c96564b5sm5425186edv.93.2023.04.25.06.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 06:06:19 -0700 (PDT) Date: Tue, 25 Apr 2023 14:06:19 +0100 From: Chris Down To: linux-kernel@vger.kernel.org Cc: Petr Mladek , Greg Kroah-Hartman , Sergey Senozhatsky , Steven Rostedt , John Ogness , Geert Uytterhoeven , kernel-team@fb.com Subject: [PATCH v5 0/2] printk: console: Per-console loglevels Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.2.10 (2023-03-25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org v5: - Fix syntax in boot_delay v4: - Change base to Linus' master - Use SRCU iterators for console walks - Override per-console loglevels on magic sysrq - Fix htmldocs - Fix mistaken __user annotation in sysctl callbacks - Consistently use indexed names (eg. ttyS0 instead of ttyS) - Remove "The loglevel for a console can be set in many places" comment - Remove CON_LOGLEVEL flag and infer based on >0 - Open code our dev_get_drvdata console stashing - Split out console_effective_loglevel functions per Petr's suggestion - Make boot_delay_msec/printk_delay check if it would be emitted - Simplify warning on SYSLOG_ACTION_CONSOLE_LEVEL - Save/restore ignore_per_console_loglevel on SYSLOG_ACTION_CONSOLE_{ON,OFF} - Unify min/max level checks across sysfs/proc/syslog - Add find_and_remove_console_option to avoid affecting io/mmio options v3: - Update to work with John's kthread patches - Remove force_console_loglevel, now we only have global and local levels - Remove minimum_console_loglevel control and document how to change it - The minimum loglevel is now only honoured on setting global/local level - Add ignore_per_console_loglevel - Return -EINVAL if trying to set below minimum console level - Add parser for named console= options - Fix docs around ignore_loglevel: it can be changed at runtime - Fix ordering in "in order of authority" docs - Remove duplicated default_console_loglevel doc - Only warn once on syslog() use v2: - Dynamically allocate struct device* - Document sysfs attributes in Documentation/ABI/ - Use sysfs_emit() instead of sprintf() in dev sysfs files - Remove WARN_ON() for device_add/IS_ERR(console_class) - Remove "soon" comment for kernel.printk - Fix !CONFIG_PRINTK build - Fix device_unregister() NULL dereference if called before class setup - Add new documentation to MAINTAINERS Chris Down (2): printk: Do not delay messages which aren't solicited by any console printk: console: Support console-specific loglevels Documentation/ABI/testing/sysfs-class-console | 47 ++ Documentation/admin-guide/index.rst | 1 + .../admin-guide/kernel-parameters.txt | 28 +- .../admin-guide/per-console-loglevel.rst | 92 ++++ Documentation/admin-guide/serial-console.rst | 17 +- Documentation/core-api/printk-basics.rst | 35 +- Documentation/networking/netconsole.rst | 17 + MAINTAINERS | 3 + drivers/tty/sysrq.c | 15 + include/linux/console.h | 3 + include/linux/printk.h | 9 + kernel/printk/console_cmdline.h | 2 + kernel/printk/printk.c | 417 +++++++++++++++++- kernel/printk/sysctl.c | 57 ++- 14 files changed, 692 insertions(+), 51 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-console create mode 100644 Documentation/admin-guide/per-console-loglevel.rst base-commit: 61d325dcbc05d8fef88110d35ef7776f3ac3f68b -- 2.40.0