Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1151680ybt; Tue, 7 Jul 2020 08:54:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0AUOX8YIuSceiMVXIoe9YmM3eDrtDDJ9UQv70NKKZQzP1/ZKr7z1o1/MjG8GKf991RbYE X-Received: by 2002:a17:906:364e:: with SMTP id r14mr36630886ejb.258.1594137244116; Tue, 07 Jul 2020 08:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594137244; cv=none; d=google.com; s=arc-20160816; b=skG4Y2zE6JFrGfhVsuPiZJAwAAAMzxmi4P9kuQS7v2hWGkNb02G9VV+49TU/eNfS++ icC5o7GMsUIgxNmB7vwiPEMFAM5OPVEjhvR70GZiooFv9iK7ypw5N5dIXQvg0xAN5pbi IJ643/54O8o8REzJqywnD6yGChAMT+OfSG+5cYwiizDnxUzzxsBz5LGsIS7cVeDzIBvV 5Y6fIiNmluHqT1G/8c3yRB/N3LWKjMStBZCLcfr/l2Z7eWnmYfSWWTdnMlVsTyKKOZrA 1TFMaEN5XX7pOqMaJMOR5wScWQLNXBxyVI+LI7pOLoUrqg+0flq/I+QTtMFhuMPRh8vT z3kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=5YMsFu0uce+adYWyd/pp5uGD76NDn3pQrLcHcqb5iGE=; b=hnEE+ZSQhnPq57XgMted896qOvQo4bO9RjgiM96iY9iYvYL4xs3icpioOzFFItF/bO mV9VPGZK7wAm+B2oSWlADZw9g0R74WAlBYJIyWIhKuIqQy68nWIuJiocCOrRThtXCFWk 3REicVssfdDJXldKT7J1FYsQRQKxjYX5JOoN4ZysSoxO2eOL5roQm0lJ0LQ9+1WhA/Oi XFyEbnkguEhbyTu8MKiDj12jsbzIwyP46E2/UPR7GxVoNa9IZI4i2+vBxevASktmM6oG QDSZPLgUQCPv0505TpFIFsv9h0uzh4TKX3OfhAYsoEL+8zj4243h2Zb/7YlU1fD6+2gF X1Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc11si15184922edb.259.2020.07.07.08.53.40; Tue, 07 Jul 2020 08:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbgGGPxh convert rfc822-to-8bit (ORCPT + 99 others); Tue, 7 Jul 2020 11:53:37 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:51195 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728029AbgGGPxg (ORCPT ); Tue, 7 Jul 2020 11:53:36 -0400 Received: from marcel-macbook.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id 1B700CECED; Tue, 7 Jul 2020 18:03:31 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v2] Bluetooth: create CONFIG_BT_DEBUG_FEATURE_FUNC_NAME From: Marcel Holtmann In-Reply-To: <20200707141628.368748-1-alainm@chromium.org> Date: Tue, 7 Jul 2020 17:53:33 +0200 Cc: linux-bluetooth@vger.kernel.org, Archie Pusaka Content-Transfer-Encoding: 8BIT Message-Id: <67268C4E-674E-4DE9-B642-E1CAE8748E28@holtmann.org> References: <20200707141628.368748-1-alainm@chromium.org> To: Alain Michaud X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, > Creates a CONFIG_BT_DEBUG_FEATURE_FUNC_NAME option to include function names in > debug statements. > > Unlike other platforms __func__ isn't a string literal so it cannot be > automatically concatenated by the pre-processor. As a result, the > function name is passed as a parameter to the tracing function. Since > pr_debug is a function like macro, the normal expansion of BT_PREFIX_PARAM > does not work as it gets processed within the first parameter as well, > for this reason, BT_DBG is split into two versions. > > This patch was built tested with all 4 possible combinations of > CONFIG_BT_DEBUG_FUNC_NAME and CONFIG_BT_FEATURE_DEBUG configurations. > > Signed-off-by: Alain Michaud > Reviewed-by: Archie Pusaka > --- > > Changes in v2: > - Making CONFIG_BT_DEBUG_FEATURE_FUNC_NAME dependent on > CONFIG_BT_DEBUG_FEATURE > > include/net/bluetooth/bluetooth.h | 32 +++++++++++++++++++++++-------- > net/bluetooth/Kconfig | 11 +++++++++++ > 2 files changed, 35 insertions(+), 8 deletions(-) > > diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h > index 7ee8041af803..8506dd268d4b 100644 > --- a/include/net/bluetooth/bluetooth.h > +++ b/include/net/bluetooth/bluetooth.h > @@ -162,22 +162,37 @@ void bt_dbg_set(bool enable); > bool bt_dbg_get(void); > __printf(1, 2) > void bt_dbg(const char *fmt, ...); > +#define BT_DBG_INT bt_dbg > +#else > +#define BT_DBG_INT pr_debug > #endif > __printf(1, 2) > void bt_warn_ratelimited(const char *fmt, ...); > __printf(1, 2) > void bt_err_ratelimited(const char *fmt, ...); > > -#define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__) > -#define BT_WARN(fmt, ...) bt_warn(fmt "\n", ##__VA_ARGS__) > -#define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__) > - > -#if IS_ENABLED(CONFIG_BT_FEATURE_DEBUG) > -#define BT_DBG(fmt, ...) bt_dbg(fmt "\n", ##__VA_ARGS__) > +#if IS_ENABLED(BT_FEATURE_DEBUG_FUNC_NAMES) are you sure you tested this? And frankly I don’t get the point for the new Kconfig option. It is rather useless in this patch. Tell me one thing, do you prefer that FEATURE_DEBUG prints the function names or not. Because if dynamic debug is used, we don’t need it since that is all configurable via dynamic debug itself and we don’t need it there (and I also don’t want it in the dynamic debug case). Regards Marcel