linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	linux-modules <linux-modules@vger.kernel.org>,
	live-patching@vger.kernel.org, fstests@vger.kernel.org,
	linux-block@vger.kernel.org, hare@suse.de, dgilbert@interlog.com,
	Jessica Yu <jeyu@kernel.org>,
	osandov@fb.com, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] libkmod: add a library notice log level print
Date: Tue, 21 Sep 2021 11:40:52 -0700	[thread overview]
Message-ID: <YUonNDxy+8zU9B52@bombadil.infradead.org> (raw)
In-Reply-To: <CAKi4VAKa7LKXdRmA7epgbkUZw2wpUz19JYYdZ35mPCxSL_W_kw@mail.gmail.com>

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 <mcgrof@kernel.org> 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 <mcgrof@kernel.org>
> > ---
> >  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

  reply	other threads:[~2021-09-21 18:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  5:15 [PATCH v2 0/3] kmod: add patient module removal support Luis Chamberlain
2021-08-10  5:16 ` [PATCH v2 1/3] libkmod: add a library notice log level print Luis Chamberlain
2021-09-21  5:53   ` Lucas De Marchi
2021-09-21 18:40     ` Luis Chamberlain [this message]
2021-09-23  8:02       ` Lucas De Marchi
2021-08-10  5:16 ` [PATCH v2 2/3] libkmod/libkmod-module: add refcnt fd helper Luis Chamberlain
2021-08-10  5:16 ` [PATCH v2 3/3] libkmod-module: add support for a patient module removal option Luis Chamberlain
2021-09-23  8:51   ` Lucas De Marchi
2021-09-28  1:38     ` Luis Chamberlain
2021-09-29 18:48       ` Lucas De Marchi
2021-11-15 20:21         ` Luis Chamberlain
2021-09-15 17:40 ` [PATCH v2 0/3] kmod: add patient module removal support Luis Chamberlain
2021-09-21  5:51   ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUonNDxy+8zU9B52@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=dgilbert@interlog.com \
    --cc=fstests@vger.kernel.org \
    --cc=hare@suse.de \
    --cc=jeyu@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --cc=lucas.demarchi@intel.com \
    --cc=osandov@fb.com \
    --subject='Re: [PATCH v2 1/3] libkmod: add a library notice log level print' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).