From: Tejun Heo <htejun@gmail.com>
To: Borislav Petkov <bbpetkov@yahoo.de>
Cc: linux IDE ML <linux-ide@vger.kernel.org>,
Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH] libata-core.c: restore configuration boot messages in ata_dev_configure()
Date: Tue, 27 Jun 2006 22:29:58 +0900 [thread overview]
Message-ID: <44A132D6.9010408@gmail.com> (raw)
In-Reply-To: <20060627131259.GA24191@gollum.tnic>
Borislav Petkov wrote:
> On Tue, Jun 27, 2006 at 09:25:26PM +0900, Tejun Heo wrote:
>
> Hi,
>> IMHO, this should be done in the following steps.
>>
>> * define ATA_MSG_* and ata_msg_* macros which map 1:1 to the current
>> message levels.
>
> How about we pin down these final dbg levels to the following (both proposals
> merged):
>
> ATA_MSG_ERR
> ATA_MSG_WARNING
> ATA_MSG_DRV ("standard" driver info, initial cfg messages)
>
> ATA_MSG_INFO maybe) /* revalidation messages, EH progress, more verbose msgs,
> feats */
> ATA_MSG_VDEBUG /* verbose hot path */, by the way, which are those hotpaths?
I don't know but left VDEBUG()s after CMD/SG/TRACE conversion should be
a good start.
> ATA_MSG_CMD /* issue / completion */
> ATA_MSG_SG /* SG map/unmap handling */
> ATA_MGS_TRACE /* function enter/exit */
Looks okay to me.
>> * make ata_*_prink()s use ATA_MSG_* instead of KERN_* and embed
>> ata_msg_enable() into ata_*_printk()s. Convert ALL ata_*_printk()s and
>> convertible DEBUG/VDEBUG()s in single sweep - it doesn't have to be a
>> single patch but post them together. These conversions touch a lot of
>> places and other patches have to be regenerated afterward.
>
> then do something like
>
> #define ata_(ap|dev)_printk((ap|dev), lv, fmt, args...) \
> if (ata_msg_err(ap)) \
> printk(KERN_ERR"ata%u: "fmt, ...); \
> else if (ata_msg_warn(ap)) \
> printk(KERN_WARNING"ata%u: "fmt, ...); \
> .
Actually, how about...
enum {
ATA_MSG_ERR,
ATA_MSG_WARNING,
...
};
const char *__ata_msg_lvs[] = {
[ATA_MSG_ERR] = KERN_ERR,
[ATA_MSG_WARNING] = KERN_WARNING,
...
};
#define ata_port_printk(ap, lv, fmt, args...) do { \
if (unlikely((ap)->msg_enable & (1 << (lv))))
printk(__ata_msg_lvs[lv]"ata%u: "fmt, (ap)->id , #args);
} while (0)
Note that regardless of message level, the msg_enable is unlikely to hit
in hot patch, so the 'unlikely()' hint.
> and then call them like so:
>
> ata_dev_printk(dev, ATA_MSG_ERR, "Error!%d", i);
>
> and so on. This looks pretty compact to me, no?
Yeap, the call looks good.
Thanks.
--
tejun
next prev parent reply other threads:[~2006-06-27 13:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-27 7:33 [PATCH] libata-core.c: restore configuration boot messages in ata_dev_configure() Borislav Petkov
2006-06-27 12:25 ` Tejun Heo
2006-06-27 13:13 ` Borislav Petkov
2006-06-27 13:29 ` Tejun Heo [this message]
2006-06-27 13:33 ` Tejun Heo
2006-06-28 6:36 ` Borislav Petkov
2006-06-28 6:45 ` Borislav Petkov
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=44A132D6.9010408@gmail.com \
--to=htejun@gmail.com \
--cc=bbpetkov@yahoo.de \
--cc=jgarzik@pobox.com \
--cc=linux-ide@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.