mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@akamai.com>
To: Huang Shijie <sjhuang@iluvatar.ai>
Cc: linux-kernel@vger.kernel.org, 1537577747@qq.com,
	Joe Perches <joe@perches.com>
Subject: Re: [PATCH v5] lib/dynamic_debug: make better dynamic log output
Date: Thu, 19 Dec 2019 17:10:49 -0500	[thread overview]
Message-ID: <ec04aa8b-5c2a-28be-a32b-6d85a17d2f21@akamai.com> (raw)
In-Reply-To: <20191219074735.31640-1-sjhuang@iluvatar.ai>



On 12/19/19 2:47 AM, Huang Shijie wrote:
> The driver strings, device name and net device name are not changed for
> the driver's dynamic log output. But the dynamic_emit_prefix() which contains
> the function names may change when the function names are changed.
> 
> So the patch makes the better dynamic log output.

Another point here is that currently the output precisely matches the
non-dynamic debug counterpart strings if not prefix is emitted. So that
changes with this patch. I think its nice to say that the output is the
same as the non dynamic debug output except it may have an optional
prefix....


> 
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> ---
> v4 --> v5:
> 	remove the redundant whitespce in the tail.
> ---
>  lib/dynamic_debug.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index c60409138e13..bfc3b386d603 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -589,9 +589,9 @@ void __dynamic_dev_dbg(struct _ddebug *descriptor,
>  	} else {
>  		char buf[PREFIX_SIZE];
>  
> -		dev_printk_emit(LOGLEVEL_DEBUG, dev, "%s%s %s: %pV",
> -				dynamic_emit_prefix(descriptor, buf),
> +		dev_printk_emit(LOGLEVEL_DEBUG, dev, "%s %s %s%pV",
>  				dev_driver_string(dev), dev_name(dev),
> +				dynamic_emit_prefix(descriptor, buf),
>  				&vaf);
>  	}
>  
> @@ -619,11 +619,11 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor,
>  		char buf[PREFIX_SIZE];
>  
>  		dev_printk_emit(LOGLEVEL_DEBUG, dev->dev.parent,
> -				"%s%s %s %s%s: %pV",
> -				dynamic_emit_prefix(descriptor, buf),
> +				"%s %s %s %s %s%pV",
>  				dev_driver_string(dev->dev.parent),
>  				dev_name(dev->dev.parent),
>  				netdev_name(dev), netdev_reg_state(dev),
> +				dynamic_emit_prefix(descriptor, buf),
>  				&vaf);
>  	} else if (dev) {
>  		printk(KERN_DEBUG "%s%s: %pV", netdev_name(dev),
> @@ -655,11 +655,11 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
>  		char buf[PREFIX_SIZE];
>  
>  		dev_printk_emit(LOGLEVEL_DEBUG, ibdev->dev.parent,
> -				"%s%s %s %s: %pV",
> -				dynamic_emit_prefix(descriptor, buf),
> +				"%s %s %s %s%pV",
>  				dev_driver_string(ibdev->dev.parent),
>  				dev_name(ibdev->dev.parent),
>  				dev_name(&ibdev->dev),
> +				dynamic_emit_prefix(descriptor, buf),
>  				&vaf);
>  	} else if (ibdev) {
>  		printk(KERN_DEBUG "%s: %pV", dev_name(&ibdev->dev), &vaf);
> 

  reply	other threads:[~2019-12-19 22:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  9:44 [PATCH] " Huang Shijie
2019-12-10  6:38 ` [PATCH V2] " Huang Shijie
2019-12-10 18:16   ` Jason Baron
2019-12-11  1:50     ` Huang Shijie
2019-12-11  3:17 ` [PATCH v3] " Huang Shijie
2019-12-12  6:35 ` [PATCH v4] " Huang Shijie
2019-12-19  7:47 ` [PATCH v5] " Huang Shijie
2019-12-19 22:10   ` Jason Baron [this message]
2019-12-20  5:45     ` Huang Shijie
2019-12-20  6:02 ` [PATCH v6] " Huang Shijie

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=ec04aa8b-5c2a-28be-a32b-6d85a17d2f21@akamai.com \
    --to=jbaron@akamai.com \
    --cc=1537577747@qq.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sjhuang@iluvatar.ai \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®