All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Borislav Petkov <bbpetkov@yahoo.de>
Cc: Jeff Garzik <jeff@garzik.org>, linux-ide@vger.kernel.org
Subject: Re: [PATCH 1/n] libata-core.c conversion to new debugging scheme, part 1 (25% done)
Date: Thu, 01 Jun 2006 15:09:31 +0900	[thread overview]
Message-ID: <447E849B.8020208@gmail.com> (raw)
In-Reply-To: <20060601053849.GB8523@gollum.tnic>

Borislav Petkov wrote:
> On Wed, May 31, 2006 at 02:39:57AM -0400, Jeff Garzik wrote:
>> On Wed, May 31, 2006 at 07:46:33AM +0200, Borislav Petkov wrote:
>>> This patch converts the first 25% of libata-core.c to the new debugging scheme.
>>>
>>> Signed-off-by: <petkov@uni-muenster.de>
>> Looks good at first glance, though I'll hold off on apply until I return
>> from the Red Hat Summit in Nashville.
>>
>> It made me remember another point, though:  in order to avoid
>> regressions, after applying your patch, I would think that you would
>> want to create a patch which did something like
>>
>> #ifndef ATA_VERBOSE_DEBUG
>> 	ap->msg_enable = xxx
>> #else ATA_DEBUG
>> 	ap->msg_enable = yyy
>> #else
>> 	ap->msg_enable = ...
>> #endif
> 
> Ok, i was thinking something along the lines of the following; for better
> granularity we might add more ATA_XXX defines or let the user subsequently
> adjust dbg level through sysfs...? (The patch applies on top of the one i sent you
> before.)
> 
> Adjust initial debugging levels through preprocessor defines.
> 
> Signed-off-by: <petkov@uni-muenster.de>
> 
>  
> --- libata-dev/drivers/scsi/libata-core.c.orig1	2006-06-01 07:02:42.000000000 +0200
> +++ libata-dev/drivers/scsi/libata-core.c	2006-06-01 07:32:44.000000000 +0200
> @@ -5200,7 +5200,15 @@ static void ata_host_init(struct ata_por
>  	ap->sata_spd_limit = UINT_MAX;
>  	ap->active_tag = ATA_TAG_POISON;
>  	ap->last_ctl = 0xFF;
> -	ap->msg_enable = ATA_MSG_DRV;
> +
> +#if defined(ATA_VERBOSE_DEBUG)
> +	/* turn on all debugging levels */
> +	ap->msg_enable = 0x00FF;
> +#elif defined(ATA_DEBUG)
> +	ap->msg_enable = ATA_MSG_DRV | ATA_MSG_INFO | ATA_MSG_CTL | ATA_MSG_WARN | ATA_MSG_ERR;
> +#else 
> +	ap->msg_enable = ATA_MSG_DRV | ATA_MSG_ERR;
> +#endif
>  
>  	INIT_WORK(&ap->port_task, NULL, NULL);
>  	INIT_LIST_HEAD(&ap->eh_done_q);

Hello,

Those ATA_MSG_* constants designates two things..

* message level (debug, info, warning...)
* message origin (probe, intr...)

although above distinction isn't clear for some constants.  libata now 
uses ata_port/dev_printk() macros to print messages and the second 
argument is message level (KERN_INFO, KERN_WARNING...), which carries 
duplicate information as above ATA_* constants.  IMHO, it would be 
better to fold the two into one.  e.g.

   ata_port_printk(ap, ATA_MSG_INFO, "blah blah\n");

instead of

   if (ata_msg_info(ap))
	ata_port_printk(ap, KERN_INFO, "blah blah\n");

Some constants probably need to be adjusted a bit though.

Thanks.

-- 
tejun

  reply	other threads:[~2006-06-01  6:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31  5:46 [PATCH 1/n] libata-core.c conversion to new debugging scheme, part 1 (25% done) Borislav Petkov
2006-05-31  6:39 ` Jeff Garzik
2006-06-01  5:38   ` Borislav Petkov
2006-06-01  6:09     ` Tejun Heo [this message]
2006-06-01  6:14       ` Jeff Garzik
2006-06-02  7:32         ` Borislav Petkov
2006-06-01  6:44       ` Borislav Petkov
2006-06-12  3:11     ` Jeff Garzik
2006-06-12  3:48 ` Jeff Garzik

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=447E849B.8020208@gmail.com \
    --to=htejun@gmail.com \
    --cc=bbpetkov@yahoo.de \
    --cc=jeff@garzik.org \
    --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.