From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220Ab1IWRmU (ORCPT ); Fri, 23 Sep 2011 13:42:20 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:35223 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750724Ab1IWRmS (ORCPT ); Fri, 23 Sep 2011 13:42:18 -0400 Subject: Re: [PATCH 25/26] dynamic_debug: add pr_fmt_dbg() for dynamic_pr_debug From: Joe Perches To: Bart Van Assche Cc: jim.cromie@gmail.com, jbaron@redhat.com, greg@kroah.com, linux-kernel@vger.kernel.org Date: Fri, 23 Sep 2011 10:42:13 -0700 In-Reply-To: References: <1316642115-20029-1-git-send-email-jim.cromie@gmail.com> <1316642115-20029-26-git-send-email-jim.cromie@gmail.com> <1316725066.29447.16.camel@Joe-Laptop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.1.91- Content-Transfer-Encoding: 7bit Message-ID: <1316799737.5266.32.camel@Joe-Laptop> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (resending with minor additions, first email hasn't shown up in 4+ hours) On Fri, 2011-09-23 at 12:31 +0200, Bart Van Assche wrote: > On Thu, Sep 22, 2011 at 10:57 PM, Joe Perches wrote: > > Maybe add all the pr_ variants too because > > some like to prefix __func__ to pr_err but not pr_info > > etc. > Hi Joe, Hi Bart. > Are you sure it makes sense to introduce all these new macros ? > Introducing pr_fmt_dbg() makes sense to me, but the usefulness of the > macros proposed above is not clear to me. Probably the most useful application of pr_fmt_debug would be to prefix __func__ to debug output but not to other pr_ uses. dynamic_debug would not be able to detect that __func__ duplication except by using vscnprintf to a buffer and checking the initial output. Perhaps a simpler way to avoid duplication of KBUILD_MODNAME ":" in dynamic_debugging is to scan the fmt string and move the fmt pointer past any leading KBUILD_MODNAME ": " when appropriate. I think these pr_fmt_ macros have a relatively low overall value but I prefer comprehensive implementations rather than partial ones. There are a couple of modules where people prefix __func__ to pr_err but not pr_info. e.g.: drivers/net/ethernet/broadcom/cnic.c Adding all the #define pr_fmt_s could simplify that. cheers, Joe