From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCA21C072B5 for ; Fri, 24 May 2019 16:10:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FA6B20675 for ; Fri, 24 May 2019 16:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390443AbfEXQKr (ORCPT ); Fri, 24 May 2019 12:10:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46994 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389588AbfEXQKq (ORCPT ); Fri, 24 May 2019 12:10:46 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39D2ADF26; Fri, 24 May 2019 16:10:41 +0000 (UTC) Received: from Hades.local (dhcp-17-185.bos.redhat.com [10.18.17.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAB7310027B9; Fri, 24 May 2019 16:10:39 +0000 (UTC) Subject: Re: [PATCH net] bonding: make debugging output more succinct To: Joe Perches , linux-kernel@vger.kernel.org Cc: Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , netdev@vger.kernel.org References: <20190524135623.17326-1-jarod@redhat.com> From: Jarod Wilson Message-ID: Date: Fri, 24 May 2019 12:10:39 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 24 May 2019 16:10:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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