From: Greg KH <gregkh@linuxfoundation.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kernel Janitors <kernel-janitors@vger.kernel.org>
Subject: Re: Question: dev_err_probe() vs Printk Index
Date: Sun, 7 Aug 2022 08:57:59 +0200 [thread overview]
Message-ID: <Yu9id1O98e6or1qm@kroah.com> (raw)
In-Reply-To: <3eacc364-90b7-7a5d-c936-1ed993428ef6@wanadoo.fr>
On Sat, Aug 06, 2022 at 10:53:16AM +0200, Christophe JAILLET wrote:
> Hi,
>
> When a driver is using dev_err(), part of it is inlined and it:
> - takes advantage of dev_fmt() [1]
> - implements Printk Index [2]
>
> Printk Index works with some __builtin_constant_p() magic in it.
> In case of a use in a probe, 99.99% of the time the log level and the format
> will be constant and the logic for Printk Index will be put in place.
>
>
> In case dev_err_probe(), the format will be an argument passed to the
> function and will not be constant, so nothing will be generated in the
> 'printk'_index section.
>
>
> In case dev_err_probe(), a potential dev_fmt() defined in the drivers' file
> can't be taken into consideration.
> (trusting my grep, we never use in files that define dev_fmt() in the .c
> file. I've not checked if it is true via #include "<something.h>")
>
>
> Even if I've read [3], I don't fully understand the real need of this Printk
> Index mechanism (at least for my own needs :))
>
>
> My questions are:
> - is my analysis right?
> - is the lack of these 2 functionalities (dev_fmt and Printk Index)
> expected, when dev_err_probe() is used?
> - if not, is it a issue?
> - should it be at least documented?
The printk index stuff is odd, and always seemed like a "check box"
option that some people wanted for a niche enterprise market. It's up
to them to keep that working well if they really need it, driver authors
should not worry about this.
thanks,
greg k-h
prev parent reply other threads:[~2022-08-07 6:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 8:53 Question: dev_err_probe() vs Printk Index Christophe JAILLET
2022-08-07 6:57 ` Greg KH [this message]
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=Yu9id1O98e6or1qm@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.