Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3047671pxb; Tue, 21 Sep 2021 13:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr4kDcNEUAae3SR0c83ZlH6x1neBNSdc6Xl43lQnYcX3FgHBATEnN4CCFxb9nc6M/GogCr X-Received: by 2002:a17:907:7704:: with SMTP id kw4mr38543255ejc.23.1632255604154; Tue, 21 Sep 2021 13:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632255604; cv=none; d=google.com; s=arc-20160816; b=EYLyP6qVzo7vthBxPvnR99YkbgPxBP4mpqsz8rMEYWMbSJ3CBqRrWox+B0bVWoqam7 60wsRX94oKtDSDJ6aLu1iWg8cTIp0nUGdgYGl8W+SeIzEvr+tb/cXLsXsbY4hgazNrf9 B13v9xXMLbxKrN/0DsD10SQEIYd/2QutzQhoKjp6pJZXU+5V9Txkz2FV2wFQA9COivxA H3flcGmYVyFSwDSWhLgoXV8kIhmQTgBjD/9PwgkrGMjiuMg15pWOoxbbLvfELkvoQ9Cl fbogI1BjfAy1FtipixePH/xy4DXboPvFheQLPulGkgE9MlqgDp6NaMa/JsL5VGwioFcY SRrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VCDewzfHbbVh3g/pRbOQUFxbt5WA/PRKwiZLKfGDQGo=; b=tEus+UNdgz/kUlvm+WYnOHM3puYWxdeTEs+ew07F2ytqwMwhwMabdkam3C3IC1taFy pBdV3Eh+lMsm66EJyU/FDxdTJYAekqH12ez941IlNa0AIeDvt9g6a2T7m20dJcMCu+Ta EFn04yS0odzOfxNzNO1Jh0vpXdpgx6ajQYTXHjNFnsjsHaUhXjso1BVWdVw6ORn60ne/ pCZdjb5fjmYSthHTktStWvSHFA5FANS5dg2ZwybTHkIv7BFQTbLegm0yBD02McVTIGoz wSOo3nYSxS5FLv3sPVVNYyamqbN3Be58KC7Hz3OTQasJ83A7/7lG0rNHU7vSkKnnIbje JeXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BN8N5u5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l1si20222780ejz.748.2021.09.21.13.19.40; Tue, 21 Sep 2021 13:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BN8N5u5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233404AbhIUSmZ (ORCPT + 99 others); Tue, 21 Sep 2021 14:42:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233372AbhIUSmW (ORCPT ); Tue, 21 Sep 2021 14:42:22 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B89C061574; Tue, 21 Sep 2021 11:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VCDewzfHbbVh3g/pRbOQUFxbt5WA/PRKwiZLKfGDQGo=; b=BN8N5u5qh8Fz/U0975RdYo6u27 Cw+dJJlx9MbHYoL8blt8kjhIP9YlJW3Z07zt2ASJc6CKxpub8T6ZfsKGGtYK4F7xt7zcRAojyBKbr /T5JcwQYAYanMTWU3d+V6lrLSWdl0lXAPNyhl1XOwOkJWnnobkZ+ZBxEJuyELDHz2PNYpQaYuMg03 OIcOODNHbkS59B7cp2LcuIUiVlvH20/YZTXEI8Co39N4Z0BjNPfK9URWHk2ZbHJ19ACerCu65//XF tORQkZU1xyGDdjgBNOlf8CyAJtadq8RHf+Qi2hKdCu+/M/7GyVTvm2QNeQgHKajEe+NUugwFVrobi mvOP0VsQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSkhI-005W8J-I5; Tue, 21 Sep 2021 18:40:52 +0000 Date: Tue, 21 Sep 2021 11:40:52 -0700 From: Luis Chamberlain To: Lucas De Marchi Cc: Lucas De Marchi , linux-modules , live-patching@vger.kernel.org, fstests@vger.kernel.org, linux-block@vger.kernel.org, hare@suse.de, dgilbert@interlog.com, Jessica Yu , osandov@fb.com, lkml Subject: Re: [PATCH v2 1/3] libkmod: add a library notice log level print Message-ID: References: <20210810051602.3067384-1-mcgrof@kernel.org> <20210810051602.3067384-2-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 10:53:53PM -0700, Lucas De Marchi wrote: > On Mon, Aug 9, 2021 at 11:56 PM Luis Chamberlain wrote: > > > > When you use pass the -v argument to modprobe we bump > > the log level from the default modprobe log level of > > LOG_WARNING (4) to LOG_NOTICE (5), however the library > > only has avaiable to print: > > > > #define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg) > > #define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg) > > #define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg) > > > > LOG_INFO (6) however is too high of a level for it to be > > effective at printing anything when modprobe -v is passed. > > And so the only way in which modprobe -v can trigger the > > library to print a verbose message is to use ERR() but that > > always prints something and we don't want that in some > > situations. > > > > We need to add a new log level macro which uses LOG_NOTICE (5) > > for a "normal but significant condition" which users and developers > > can use to look underneath the hood to confirm if a situation is > > happening. > > > > Signed-off-by: Luis Chamberlain > > --- > > libkmod/libkmod-internal.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h > > index 398af9c..2e5e1bc 100644 > > --- a/libkmod/libkmod-internal.h > > +++ b/libkmod/libkmod-internal.h > > @@ -25,10 +25,12 @@ static _always_inline_ _printf_format_(2, 3) void > > # else > > # define DBG(ctx, arg...) kmod_log_null(ctx, ## arg) > > # endif > > +# define NOTICE(ctx, arg...) kmod_log_cond(ctx, LOG_NOTICE, ## arg) > > # define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg) > > # define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg) > > #else > > # define DBG(ctx, arg...) kmod_log_null(ctx, ## arg) > > +# define NOTICE(ctx, arg...) kmod_log_cond(ctx, LOG_NOTICE, ## arg) > > did you mean kmod_log_null()? Sure, feel free to change on your end or let me know if you would prefer if I respin. Luis