diff mbox series

[v3] cxl: Remove noisy dev_dbg() outputs

Message ID 169524300432.3077964.4526387988891514104.stgit@djiang5-mobl3
State New, archived
Headers show
Series [v3] cxl: Remove noisy dev_dbg() outputs | expand

Commit Message

Dave Jiang Sept. 20, 2023, 8:50 p.m. UTC
Remove noisy enumeration of commands and CEL opcodes via dev_dbg()
emit. These outputs were useful during early development. However they are
now unnecessary and creates excessive noise in the debug log. On certain
hardware up to 500+ entries have been observed.

Suggested-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

---
https://lore.kernel.org/linux-cxl/b72946f0-31dd-b22a-f2e8-a12eb2f522ae@intel.com/T/#t

v3:
- Drop eventtrace and just remove the dev_dbg(). (Ira & Alison)
v2:
- Add enabling note in commit log (Ira)
---
 drivers/cxl/core/mbox.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Ira Weiny Sept. 21, 2023, 3:53 p.m. UTC | #1
Dave Jiang wrote:
> Remove noisy enumeration of commands and CEL opcodes via dev_dbg()
> emit. These outputs were useful during early development. However they are
> now unnecessary and creates excessive noise in the debug log. On certain
> hardware up to 500+ entries have been observed.
> 
> Suggested-by: Alison Schofield <alison.schofield@intel.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

This looks good to me but it's going to conflict with Dan's rework here:

https://lore.kernel.org/all/6500e8a179440_12747294a3@dwillia2-xfh.jf.intel.com.notmuch/

It would probably be nice to rebase on that for Dan but in case he wants
to merge it.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> 
> ---
> https://lore.kernel.org/linux-cxl/b72946f0-31dd-b22a-f2e8-a12eb2f522ae@intel.com/T/#t
> 
> v3:
> - Drop eventtrace and just remove the dev_dbg(). (Ira & Alison)
> v2:
> - Add enabling note in commit log (Ira)
> ---
>  drivers/cxl/core/mbox.c |   11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index ca60bb8114f2..963c668a4eb4 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -707,7 +707,6 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  {
>  	struct cxl_cel_entry *cel_entry;
>  	const int cel_entries = size / sizeof(*cel_entry);
> -	struct device *dev = mds->cxlds.dev;
>  	int i;
>  
>  	cel_entry = (struct cxl_cel_entry *) cel;
> @@ -717,11 +716,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  		struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
>  
>  		if (!cmd && (!cxl_is_poison_command(opcode) ||
> -			     !cxl_is_security_command(opcode))) {
> -			dev_dbg(dev,
> -				"Opcode 0x%04x unsupported by driver\n", opcode);
> +			     !cxl_is_security_command(opcode)))
>  			continue;
> -		}
>  
>  		if (cmd)
>  			set_bit(cmd->info.id, mds->enabled_cmds);
> @@ -731,8 +727,6 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  
>  		if (cxl_is_security_command(opcode))
>  			cxl_set_security_cmd_enabled(&mds->security, opcode);
> -
> -		dev_dbg(dev, "Opcode 0x%04x enabled\n", opcode);
>  	}
>  }
>  
> @@ -787,7 +781,6 @@ static const uuid_t log_uuid[] = {
>  int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
>  {
>  	struct cxl_mbox_get_supported_logs *gsl;
> -	struct device *dev = mds->cxlds.dev;
>  	struct cxl_mem_command *cmd;
>  	int i, rc;
>  
> @@ -801,8 +794,6 @@ int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
>  		uuid_t uuid = gsl->entry[i].uuid;
>  		u8 *log;
>  
> -		dev_dbg(dev, "Found LOG type %pU of size %d", &uuid, size);
> -
>  		if (!uuid_equal(&uuid, &log_uuid[CEL_UUID]))
>  			continue;
>  
> 
>
Dave Jiang Sept. 21, 2023, 5:24 p.m. UTC | #2
On 9/20/23 13:50, Dave Jiang wrote:
> Remove noisy enumeration of commands and CEL opcodes via dev_dbg()
> emit. These outputs were useful during early development. However they are
> now unnecessary and creates excessive noise in the debug log. On certain
> hardware up to 500+ entries have been observed.
> 
> Suggested-by: Alison Schofield <alison.schofield@intel.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

After discussing with Ira and Dan offline, this patch can be ignored.

To reduce noise, something like this can be done instead:

options cxl_core dyndbg="+fp; func cxl_walk_cel -p"
in /etc/modprobe.d/cxl-debug.conf


> 
> ---
> https://lore.kernel.org/linux-cxl/b72946f0-31dd-b22a-f2e8-a12eb2f522ae@intel.com/T/#t
> 
> v3:
> - Drop eventtrace and just remove the dev_dbg(). (Ira & Alison)
> v2:
> - Add enabling note in commit log (Ira)
> ---
>  drivers/cxl/core/mbox.c |   11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index ca60bb8114f2..963c668a4eb4 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -707,7 +707,6 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  {
>  	struct cxl_cel_entry *cel_entry;
>  	const int cel_entries = size / sizeof(*cel_entry);
> -	struct device *dev = mds->cxlds.dev;
>  	int i;
>  
>  	cel_entry = (struct cxl_cel_entry *) cel;
> @@ -717,11 +716,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  		struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
>  
>  		if (!cmd && (!cxl_is_poison_command(opcode) ||
> -			     !cxl_is_security_command(opcode))) {
> -			dev_dbg(dev,
> -				"Opcode 0x%04x unsupported by driver\n", opcode);
> +			     !cxl_is_security_command(opcode)))
>  			continue;
> -		}
>  
>  		if (cmd)
>  			set_bit(cmd->info.id, mds->enabled_cmds);
> @@ -731,8 +727,6 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
>  
>  		if (cxl_is_security_command(opcode))
>  			cxl_set_security_cmd_enabled(&mds->security, opcode);
> -
> -		dev_dbg(dev, "Opcode 0x%04x enabled\n", opcode);
>  	}
>  }
>  
> @@ -787,7 +781,6 @@ static const uuid_t log_uuid[] = {
>  int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
>  {
>  	struct cxl_mbox_get_supported_logs *gsl;
> -	struct device *dev = mds->cxlds.dev;
>  	struct cxl_mem_command *cmd;
>  	int i, rc;
>  
> @@ -801,8 +794,6 @@ int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
>  		uuid_t uuid = gsl->entry[i].uuid;
>  		u8 *log;
>  
> -		dev_dbg(dev, "Found LOG type %pU of size %d", &uuid, size);
> -
>  		if (!uuid_equal(&uuid, &log_uuid[CEL_UUID]))
>  			continue;
>  
> 
>
diff mbox series

Patch

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index ca60bb8114f2..963c668a4eb4 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -707,7 +707,6 @@  static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
 {
 	struct cxl_cel_entry *cel_entry;
 	const int cel_entries = size / sizeof(*cel_entry);
-	struct device *dev = mds->cxlds.dev;
 	int i;
 
 	cel_entry = (struct cxl_cel_entry *) cel;
@@ -717,11 +716,8 @@  static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
 		struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
 
 		if (!cmd && (!cxl_is_poison_command(opcode) ||
-			     !cxl_is_security_command(opcode))) {
-			dev_dbg(dev,
-				"Opcode 0x%04x unsupported by driver\n", opcode);
+			     !cxl_is_security_command(opcode)))
 			continue;
-		}
 
 		if (cmd)
 			set_bit(cmd->info.id, mds->enabled_cmds);
@@ -731,8 +727,6 @@  static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
 
 		if (cxl_is_security_command(opcode))
 			cxl_set_security_cmd_enabled(&mds->security, opcode);
-
-		dev_dbg(dev, "Opcode 0x%04x enabled\n", opcode);
 	}
 }
 
@@ -787,7 +781,6 @@  static const uuid_t log_uuid[] = {
 int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
 {
 	struct cxl_mbox_get_supported_logs *gsl;
-	struct device *dev = mds->cxlds.dev;
 	struct cxl_mem_command *cmd;
 	int i, rc;
 
@@ -801,8 +794,6 @@  int cxl_enumerate_cmds(struct cxl_memdev_state *mds)
 		uuid_t uuid = gsl->entry[i].uuid;
 		u8 *log;
 
-		dev_dbg(dev, "Found LOG type %pU of size %d", &uuid, size);
-
 		if (!uuid_equal(&uuid, &log_uuid[CEL_UUID]))
 			continue;