All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Joe Perches <joe@perches.com>,
	ivtv-devel@ivtvdriver.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jean-Francois Moine <moinejf@free.fr>
Subject: Re: [PATCH 06/14] [media] cx18: Use current logging styles
Date: Sat, 03 Sep 2011 21:21:28 -0300	[thread overview]
Message-ID: <4E62C488.6040209@infradead.org> (raw)
In-Reply-To: <40a27a5f-f4ec-4304-88a1-a254c7bc6c68@email.android.com>

Em 27-08-2011 14:23, Andy Walls escreveu:
> Joe Perches <joe@perches.com> wrote:
> 
>> On Sat, 2011-08-27 at 09:28 -0400, Andy Walls wrote:
>>> On Wed, 2011-08-24 at 14:42 -0700, Joe Perches wrote:
>>>> On Wed, 2011-08-24 at 06:34 -0400, Andy Walls wrote:
>>>>> On Sun, 2011-08-21 at 15:56 -0700, Joe Perches wrote:
>>>>>> Add pr_fmt.
>>>>>> Convert printks to pr_<level>.
>>>>>> Convert printks without KERN_<level> to appropriate pr_<level>.
>>>>>> Removed embedded prefixes when pr_fmt was added.
>>>>>> Use ##__VA_ARGS__ for variadic macros.
>>>>>> Coalesce format strings.
>>>>> 1. It is important to preserve the per-card prefixes emitted by
>> the
>>>>> driver: cx18-0, cx18-1, cx18-2, etc.  With a quick skim, I think
>> your
>>>>> change preserves the format of all output messages (except
>> removing
>>>>> periods).  Can you confirm this?
>>>> Here's the output diff of
>>>> strings built-in.o | grep "^<.>" | sort
>>>> new and old
>> []
>>> Yuck.
>>>>> 2. PLease don't add a pr_fmt() #define to exevry file.  Just put
>> one
>>>>> where all the other CX18_*() macros are defined.  Every file
>> picks those
>>>>> up.
>>>> It's not the first #include of every file.
>>>> printk.h has a default #define pr_fmt(fmt) fmt
>>> Well then don't use "pr_fmt(fmt)" in cx18, if it overloads a define
>>> somewhere else in the kernel and has a dependency on its order
>> relative
>>> to #include statements.  That sort of thing just ups maintenance
>> hours
>>> later.  That's not a good trade off for subjectively better log
>>> messages.
>>> Won't redifining the 'pr_fmt(fmt)' generate preprocessor warnings
>>> anyway?
>>
>> No.
>>
>> Andy, I fully understand how this stuff works.
>> You apparently don't (yet).
>>
>> Look at include/linux/printk.h
>>
>> #ifndef pr_fmt
>> #define pr_fmt(fmt) fmt
>> #endif
>>
>> A default empty define is used when one
>> is not specified before printk.h is
>> included.  kernel.h includes printk.h
>>
>> v4l2_<level> uses the "name" of the video
>> device in its output.  That name may not
>> be the same name as the module.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> Hi Joe,
> 
> I don't need to fully understand it.
> 
> This is a happy to glad change with no functional nor performance benefit.  It adds unneeded lines of code to the driver and mangles some of the log messages.
> 
> I see no benefit from my perspective.

Hi Andy and Jean-Francois,

>From my perspective, the advantage of using the standard macros for
errors are:

1) Consistency. Except for patches 06 and 14, the other patches were
acked by the maintainers or by me, for the drivers that I maintain
or whose maintainer didn't nack. Also, the same sort of macros are
being used on other places at the Kernel;

2) One of the proposed themes for discussion at the KS/2011 is how to
improve the error reporting. While printk works, there are better
ways of doing it than just printing the error at the console. I'm
working on something like that with regards to hardware errors,
reported via MCE and EDAC subsystems. The idea there is to convert
the printk reports into structured trace events, making easier for
userspace to deal with the errors.

Making all places to use the same macros for it using a similar format
seems to be the first step for replacing the current way for a better
one.

Regards,
Mauro

  reply	other threads:[~2011-09-04  0:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-21 22:56 [PATCH 00/14] [media] Logging cleanups Joe Perches
2011-08-21 22:56 ` [PATCH 01/14] [media] saa7146: Use current logging styles Joe Perches
2011-08-22  6:18   ` Michael Hunold
2011-08-21 22:56 ` [PATCH 02/14] [media] rc-core.h: Surround macro with do {} while (0) Joe Perches
2011-08-21 22:56 ` [PATCH 03/14] [media] ene_ir: Use current logging styles Joe Perches
2011-08-21 22:56 ` [PATCH 04/14] [media] winbond-cir: " Joe Perches
2011-08-25 11:52   ` David Härdeman
2011-08-21 22:56 ` [PATCH 05/14] [media] bt8xx: " Joe Perches
2011-08-21 22:56 ` [PATCH 06/14] [media] cx18: " Joe Perches
2011-08-24 10:34   ` Andy Walls
2011-08-24 21:42     ` Joe Perches
2011-08-27 13:28       ` Andy Walls
2011-08-27 16:42         ` Joe Perches
2011-08-27 17:05           ` Jean-Francois Moine
2011-08-27 17:31             ` Joe Perches
2011-08-27 17:23           ` Andy Walls
2011-09-04  0:21             ` Mauro Carvalho Chehab [this message]
2011-09-04  0:52               ` Joe Perches
2011-08-21 22:56 ` [PATCH 07/14] [media] et61x251: " Joe Perches
2011-08-21 22:56 ` [PATCH 08/14] [media] gl860: " Joe Perches
2011-08-21 22:56 ` [PATCH 09/14] [media] m5602: " Joe Perches
2011-08-22  6:28   ` Erik Andrén
2011-08-21 22:56 ` [PATCH 10/14] [media] finepix: " Joe Perches
2011-08-21 22:56 ` [PATCH 11/14] [media] pac207: " Joe Perches
2011-08-21 22:56 ` [PATCH 12/14] [media] sn9c20x: " Joe Perches
2011-08-21 22:56 ` [PATCH 13/14] [media] t613: " Joe Perches
2011-08-21 22:56 ` [PATCH 14/14] [media] gspca: " Joe Perches
2011-08-22  8:50   ` Jean-Francois Moine
2011-08-22 15:20     ` Joe Perches
2011-08-22 18:36       ` Jean-Francois Moine

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=4E62C488.6040209@infradead.org \
    --to=mchehab@infradead.org \
    --cc=awalls@md.metrocast.net \
    --cc=ivtv-devel@ivtvdriver.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=moinejf@free.fr \
    /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.