From: Jarod Wilson <jarod@redhat.com>
To: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Cc: Jay Vosburgh <j.vosburgh@gmail.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net] bonding: make debugging output more succinct
Date: Fri, 24 May 2019 12:10:39 -0400 [thread overview]
Message-ID: <c6555d3b-6e78-73b0-4fde-e39189149d18@redhat.com> (raw)
In-Reply-To: <f6286af05b1eda38b103ef1337cd7086d3ea4372.camel@perches.com>
On 5/24/19 11:19 AM, Joe Perches wrote:
> On Fri, 2019-05-24 at 09:56 -0400, Jarod Wilson wrote:
>> Seeing bonding debug log data along the lines of "event: 5" is a bit spartan,
>> and often requires a lookup table if you don't remember what every event is.
>> Make use of netdev_cmd_to_name for an improved debugging experience, so for
>> the prior example, you'll see: "bond_netdev_event received NETDEV_REGISTER"
>> instead (both are prefixed with the device for which the event pertains).
>>
>> There are also quite a few places that the netdev_dbg output could stand to
>> mention exactly which slave the message pertains to (gets messy if you have
>> multiple slaves all spewing at once to know which one they pertain to).
> []
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> []
>> @@ -1515,7 +1515,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>> new_slave->original_mtu = slave_dev->mtu;
>> res = dev_set_mtu(slave_dev, bond->dev->mtu);
>> if (res) {
>> - netdev_dbg(bond_dev, "Error %d calling dev_set_mtu\n", res);
>> + netdev_dbg(bond_dev, "Error %d calling dev_set_mtu for slave %s\n",
>> + res, slave_dev->name);
>
> Perhaps better to add and use helper mechanisms like:
>
> #define slave_dbg(bond_dev, slave_dev, fmt, ...) \
> netdev_dbg(bond_dev, "(slave %s) " fmt, (slave_dev)->name, ##__VA_ARGS__)
>
> So this might be
> slave_dbg(bond_dev, slave_dev, "Error %d calling dev_set_mtu\n",
> res);
> etc...
>
> So there would be a unified style to grep in the logs.
I do kind of like that idea. Might also need slave_info and friends as
well if you really want to get consistent, and eliminate bond_dev as an
arg to it, since you can figure that out from slave_dev. I'd be game to
take that little project on. Might be worth peeling out the
netdev_cmd_to_name() bit from this for consideration right now, since
it's not quite part of that same conversion.
--
Jarod Wilson
jarod@redhat.com
next prev parent reply other threads:[~2019-05-24 16:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 13:56 [PATCH net] bonding: make debugging output more succinct Jarod Wilson
2019-05-24 15:19 ` Joe Perches
2019-05-24 16:10 ` Jarod Wilson [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-06-07 14:59 [PATCH net-next 0/7] bonding: clean up and standarize logging printks Jarod Wilson
2019-06-07 14:59 ` [PATCH net] bonding: make debugging output more succinct Jarod Wilson
2019-06-07 15:02 ` Jarod Wilson
2019-06-09 20:37 ` David Miller
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=c6555d3b-6e78-73b0-4fde-e39189149d18@redhat.com \
--to=jarod@redhat.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=j.vosburgh@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/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.