[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6286af05b1eda38b103ef1337cd7086d3ea4372.camel@perches.com>
Date: Fri, 24 May 2019 08:19:07 -0700
From: Joe Perches <joe@...ches.com>
To: Jarod Wilson <jarod@...hat.com>, linux-kernel@...r.kernel.org
Cc: Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net] bonding: make debugging output more succinct
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.
Powered by blists - more mailing lists