Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp144605rwb; Thu, 6 Oct 2022 16:02:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5O2Mikh3RzVSMG/cNm5eOi7RQi9zZ2vkHt+4D8gWa2dOSdzUQPZx69mae8UDIjelPUc6cI X-Received: by 2002:a17:907:d8e:b0:783:a4f0:1052 with SMTP id go14-20020a1709070d8e00b00783a4f01052mr1737536ejc.41.1665097361017; Thu, 06 Oct 2022 16:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665097361; cv=none; d=google.com; s=arc-20160816; b=VFOO6migYn2FP0uCCDYCReeVzeZvkl0t57lbjmOwIiuUzvdEWOTDrKOXSBFLv7QSTo Su7GoIjRztHPmMXre7RkwoKb/FBaDdGn7F5rEBLmnCIiHLJsPZQThtQrzTJDACDcr/52 i7nWLo+EfR3OGFvIfvWA1lPKOGbhpfwgwA/Q67qyxBrytqjm39+6198ybzqb1edbYH4Y gHdrclcrs/vAorEzYYBVAGqYZU0o2XBISg57TtCtu6NJr4kdGP6vC1bVSMulqxkmXm96 smUZr9ATYU7dqKJLHnhEsZSgbkTlHDXJ+t/11ipWrca4SQWmkU3wLJl/PNZ1O0OC2u5T Xo+w== 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:from :dkim-signature; bh=ROxU9ZPvDJlhMxlhvGBHee4urUu69sraTMRl63LvHNo=; b=Wi8uNZCKaU3jl6iNnkdpsm/hujjZkztGYG64I8q/wjDe/bXcaI8CZP9HUhrPFnvxHP 3wc1N0XkAS7cheZBjgc6j2/h1W9LBoYvxPLLv6Pa6ojdDfRxD//UnFxffm2wQPoQnekk 4kO7GVkOfqliMCTcB8krz2j8iHY2pHExDaA9xe2qcZ2Ejf+m3V2TYtol5ljxsogyqSMu NfdPBYq8YAoRwJVnmknEsDN0iZnhSlHhCyeU0Ilx03AD4abCQCE0fvad9bNn8wZ2F5l+ JzR14TNg3FYuRZB76H3QMjmgaO9AoGSmC3gJbLwKsTkCFBLpGCbMFBDPOHIb1dUEBzhR HRAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=oebQFFy8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy26-20020a170906b7da00b0077ab738911fsi577010ejb.140.2022.10.06.16.02.14; Thu, 06 Oct 2022 16:02:41 -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=fail header.i=@igalia.com header.s=20170329 header.b=oebQFFy8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232234AbiJFWnW (ORCPT + 99 others); Thu, 6 Oct 2022 18:43:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232294AbiJFWnO (ORCPT ); Thu, 6 Oct 2022 18:43:14 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80819142C9A; Thu, 6 Oct 2022 15:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ROxU9ZPvDJlhMxlhvGBHee4urUu69sraTMRl63LvHNo=; b=oebQFFy873qnFMejWs0yByUCJu qZOVtCliWUehonJMF4AVEmd6/c4MT+TrOtlHrP6Hbp1qjgWtsmf2iJLrTIz1PNpx0pmyFl/xtWoks JvNfIiFfEWFHeQwfcY31fVm2MI0gyL0FSecRBMfOW9TR4K45Ih2wVTsx0hZhdBZdBfDCpi6wRPxVf y89SLESrHPvtOFEvtKHyrr742UaWHpTOwsxM68Zc+BKYJ75s6asrQTvMuv3WoXZJe2EmLWW5i0iP6 /XIlY3Ex1qGehh4xHwCLUZodMi97dYlZpaL2iiXzpfnlScxgtGcEabm5B2jxoM1JuPrrQiAKbZtHs Musmo8gg==; Received: from 201-43-120-40.dsl.telesp.net.br ([201.43.120.40] helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1ogZaA-00C4JQ-GL; Fri, 07 Oct 2022 00:43:11 +0200 From: "Guilherme G. Piccoli" To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: kernel-dev@igalia.com, kernel@gpiccoli.net, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, "Guilherme G. Piccoli" Subject: [PATCH 2/8] pstore: Expose kmsg_bytes as a module parameter Date: Thu, 6 Oct 2022 19:42:06 -0300 Message-Id: <20221006224212.569555-3-gpiccoli@igalia.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221006224212.569555-1-gpiccoli@igalia.com> References: <20221006224212.569555-1-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: X-Mailing-List: linux-kernel@vger.kernel.org Currently this tuning is only exposed as a filesystem option, but most Linux distros automatically mount pstore, hence changing this setting requires remounting it. Also, if that mount option wasn't explicitly set it doesn't show up in mount information, so users cannot check what is the current value of kmsg_bytes. Let's then expose it as a module parameter, allowing both user visibility at all times (even if not manually set) and also the possibility of setting that as a boot/module parameter. Signed-off-by: Guilherme G. Piccoli --- fs/pstore/platform.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index c32957e4b256..be05090076ce 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -89,6 +89,11 @@ static char *compress = module_param(compress, charp, 0444); MODULE_PARM_DESC(compress, "compression to use"); +/* How much of the kernel log to snapshot */ +unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES; +module_param(kmsg_bytes, ulong, 0444); +MODULE_PARM_DESC(kmsg_bytes, "amount of kernel log to snapshot (in bytes)"); + /* Compression parameters */ static struct crypto_comp *tfm; @@ -100,9 +105,6 @@ struct pstore_zbackend { static char *big_oops_buf; static size_t big_oops_buf_sz; -/* How much of the console log to snapshot */ -unsigned long kmsg_bytes = CONFIG_PSTORE_DEFAULT_KMSG_BYTES; - void pstore_set_kmsg_bytes(int bytes) { kmsg_bytes = bytes; -- 2.38.0