All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libata-core: set debug logging via module param
@ 2008-04-17 23:04 David Milburn
  2008-04-18 12:18 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: David Milburn @ 2008-04-17 23:04 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide

Set debug level using ata_logging_level module parameter.

Signed-off-by David Milburn <dmilburn@redhat.com>
---
 libata-core.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 733eb94..3fac7f7 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -158,6 +158,10 @@ int libata_allow_tpm = 0;
 module_param_named(allow_tpm, libata_allow_tpm, int, 0444);
 MODULE_PARM_DESC(allow_tpm, "Permit the use of TPM commands");
 
+unsigned int ata_logging_level;
+module_param(ata_logging_level, int, 0444);
+MODULE_PARM_DESC(ata_logging_level, "Bit mask of logging levels");
+
 MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
 MODULE_LICENSE("GPL");
@@ -5190,14 +5194,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
 	ap->dev = host->dev;
 	ap->last_ctl = 0xFF;
 
-#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 | ATA_MSG_WARN;
-#endif
+	/* set debugging level */
+	ap->msg_enable = ata_logging_level;
 
 #ifdef CONFIG_ATA_SFF
 	INIT_DELAYED_WORK(&ap->port_task, ata_pio_task);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libata-core: set debug logging via module param
  2008-04-17 23:04 [PATCH] libata-core: set debug logging via module param David Milburn
@ 2008-04-18 12:18 ` Sergei Shtylyov
  2008-04-18 15:32   ` David Milburn
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2008-04-18 12:18 UTC (permalink / raw)
  To: David Milburn; +Cc: jeff, linux-ide

Hello.

David Milburn wrote:

> Set debug level using ata_logging_level module parameter.

> Signed-off-by David Milburn <dmilburn@redhat.com>

> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 733eb94..3fac7f7 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -158,6 +158,10 @@ int libata_allow_tpm = 0;
>  module_param_named(allow_tpm, libata_allow_tpm, int, 0444);
>  MODULE_PARM_DESC(allow_tpm, "Permit the use of TPM commands");
>  
> +unsigned int ata_logging_level;
> +module_param(ata_logging_level, int, 0444);
> +MODULE_PARM_DESC(ata_logging_level, "Bit mask of logging levels");
> +
>  MODULE_AUTHOR("Jeff Garzik");
>  MODULE_DESCRIPTION("Library module for ATA devices");
>  MODULE_LICENSE("GPL");
> @@ -5190,14 +5194,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
>  	ap->dev = host->dev;
>  	ap->last_ctl = 0xFF;
>  
> -#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 | ATA_MSG_WARN;
> -#endif
> +	/* set debugging level */
> +	ap->msg_enable = ata_logging_level;

    This sets the default mask to show no log messages instead of ATA_MSG_DRV 
| ATA_MSG_ERR | ATA_MSG_WARN as it was before the patch.

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libata-core: set debug logging via module param
  2008-04-18 12:18 ` Sergei Shtylyov
@ 2008-04-18 15:32   ` David Milburn
  0 siblings, 0 replies; 3+ messages in thread
From: David Milburn @ 2008-04-18 15:32 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: jeff, linux-ide

On Fri, Apr 18, 2008 at 04:18:01PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> 
>    This sets the default mask to show no log messages instead of 
>    ATA_MSG_DRV | ATA_MSG_ERR | ATA_MSG_WARN as it was before the patch.
> 
> WBR, Sergei

Thanks Sergei, I will repost.

David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-18 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17 23:04 [PATCH] libata-core: set debug logging via module param David Milburn
2008-04-18 12:18 ` Sergei Shtylyov
2008-04-18 15:32   ` David Milburn

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.