From: Huang Shijie <sjhuang@iluvatar.ai>
To: Jason Baron <jbaron@akamai.com>
Cc: <linux-kernel@vger.kernel.org>, <1537577747@qq.com>,
Jim Cromie <jim.cromie@gmail.com>
Subject: Re: [PATCH V2] lib/dynamic_debug: make better dynamic log output
Date: Wed, 11 Dec 2019 09:50:21 +0800 [thread overview]
Message-ID: <20191211015021.GA2693@hsj-Precision-5520> (raw)
In-Reply-To: <f6ec7ce2-278c-4795-6f19-c31592b8868f@akamai.com>
On Tue, Dec 10, 2019 at 01:16:10PM -0500, Jason Baron wrote:
>
>
> On 12/10/19 1:38 AM, Huang Shijie wrote:
> > The driver strings and device name is 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 change.
> >
> > So the patch makes the better dynamic log output.
> >
> > Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> > ---
> > v1 -- >v2
> > Add a whitespace between driver strings and dev name.
> > ---
> > lib/dynamic_debug.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> > index c60409138e13..f6665af6abd4 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);
> > }
> >
> >
>
>
> Hi Huang,
>
> So this is just reversing the order of output. All the other dynamic
> debug calls emit the 'prefix' first, so if we were to change this it
> seems like we'd also want to change the other ones to be consistent.
okay, I will check that.
>
> That said, I'm not sure why reversing things here is better?
I quote the some output log here:
Before this patch:
------------------------------------------------------------
[ 66.159851] [1412] bi_ioctl: iluvatar-bi 0000:00:03.0: ioctl : AIP_MEM_CREATE
[ 66.159855] [1412] bi_ioctl_aip_mem_create: iluvatar-bi 0000:00:03.0: start bi_ioctl_aip_mem_create
[ 66.159874] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: [mem_handle: 0xffff88814ff56000](bi_ioctl_aip_mem_create) vdev:0xffff888157951200:8
[ 66.159877] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: ctx : 0xffff888157950d80
[ 66.159879] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: heap : host
[ 66.159882] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: flags : user ptr:0, fence:1, exe:0
[ 66.159886] [1412] mem_handle_print_submit_refcnt: iluvatar-bi 0000:00:03.0: mem_handle_print_submit_refcnt:532[mem_handle_get_submit_refcnt] mem ffff88814ff56000, ref_cnt 0
[ 66.159888] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: status : free
[ 66.159890] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: location : un set
[ 66.159893] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: size : 0x64, pg num 0x0
[ 66.159895] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: sys va (user) : 0x0
[ 66.159898] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[0] : 0x0
[ 66.159900] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[1] : 0x0
[ 66.159902] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[2] : 0x0
[ 66.159905] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[3] : 0x0
[ 66.159907] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[4] : 0x0
[ 66.159909] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[5] : 0x0
[ 66.159911] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[6] : 0x0
[ 66.159914] [1412] mem_handle_dump_pte: iluvatar-bi 0000:00:03.0: invld_host_ava[7] : 0x0
[ 66.159916] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: dev_va : 0x0
[ 66.159918] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: dev_pa : 0x0
[ 66.159920] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: refcount : 0x0
[ 66.159923] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: destroy delay : false
[ 66.159925] [1412] __mem_handle_dump: iluvatar-bi 0000:00:03.0: pinned pages : 0x0 (0, 0)
------------------------------------------------------------
After this patch, the log looks like this:
------------------------------------------------------------
[ 8523.289844] iluvatar-bi 0000:00:03.0 [1491] bi_ioctl: : ioctl : AIP_MEM_CREATE
[ 8523.290494] iluvatar-bi 0000:00:03.0 [1491] bi_ioctl_aip_mem_create: : start bi_ioctl_aip_mem_create
[ 8523.290646] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : [mem_handle: 0xffff888158b7ec80](bi_ioctl_aip_mem_create) vdev:0xffff8881574d9b00:8
[ 8523.290649] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : ctx : 0xffff888150b3a880
[ 8523.290651] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : heap : device
[ 8523.290654] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : flags : user ptr:0, fence:0, exe:0
[ 8523.290659] iluvatar-bi 0000:00:03.0 [1491] mem_handle_print_submit_refcnt: : mem_handle_print_submit_refcnt:532[mem_handle_get_submit_refcnt] mem ffff888158b7ec80, ref_cnt 0
[ 8523.290661] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : status : free
[ 8523.290664] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : location : un set
[ 8523.290666] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : size : 0x10000, pg num 0x10
[ 8523.290669] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : sys va (user) : 0x0
[ 8523.290671] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[0] : 0x0
[ 8523.290674] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[1] : 0x0
[ 8523.290676] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[2] : 0x0
[ 8523.290678] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[3] : 0x0
[ 8523.290681] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[4] : 0x0
[ 8523.290683] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[5] : 0x0
[ 8523.290685] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[6] : 0x0
[ 8523.290688] iluvatar-bi 0000:00:03.0 [1491] mem_handle_dump_pte: : invld_host_ava[7] : 0x0
[ 8523.290690] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : dev_va : 0x0
[ 8523.290692] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : dev_pa : 0x0
[ 8523.290694] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : refcount : 0x0
[ 8523.290697] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : destroy delay : false
[ 8523.290699] iluvatar-bi 0000:00:03.0 [1491] __mem_handle_dump: : pinned pages : 0x0 (0, 0)
------------------------------------------------------------
IMHO, I think the log become more tidy after the patch.
Thanks
Huang Shijie
next prev parent reply other threads:[~2019-12-11 1:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 9:44 [PATCH] lib/dynamic_debug: make better dynamic log output 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 [this message]
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
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=20191211015021.GA2693@hsj-Precision-5520 \
--to=sjhuang@iluvatar.ai \
--cc=1537577747@qq.com \
--cc=jbaron@akamai.com \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox