Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1220031ybt; Tue, 7 Jul 2020 10:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSAkEudgMlUxVWWAvvmCfFisR6XeCZ1vxzyQAVLXAbUvUII7ECYSOjyNBV/Yr8PbBTRaNW X-Received: by 2002:aa7:d446:: with SMTP id q6mr62982603edr.218.1594142235051; Tue, 07 Jul 2020 10:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594142235; cv=none; d=google.com; s=arc-20160816; b=JxFoYvqH1ciL3weAZcD8vcoB/kk9yRkcTqvEaXyWxHjd7zpOeeEJBQ5XRub3cgv01y A0VO7Z+v+IcJr97WHRAGsUlf8DhVTDKtwPBl880ovhYnal59/zR5M5FgRcflhjOwrf1P 7+nsEERpQ8ggzUkBgbzNUPZHfQBCsEXoRxrH4/wAKcqR5Eum24LP0WolhTrwVYaJJr9+ jrWskgOo7mLPaDMEsVZY6XlHFZ9J0eveNaB81FWC+8TLwLUfAg3GVElsBJFUyoHktGHE e0Nk8ilnlRbwciGNyziyufbNoJ9aITlEnew1hLIHm1cwCNVGOQwo4nCGE6EI9pPYhs55 d4RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sJDZPklgLSz+bMRCtm1xi8y9hsWb4olH788+hzSKmpc=; b=HLQTpAd5HAIRdp3JMmgSKKDTuq3U7lQr/VeCoSSnip/YvduGUQa8ovELmjSltWY+6O /3h3Z+KvLpKTNGKbqSiFAEIVLTc0QlkTWSwSKRUIGU+5+Oa+OIgOLj8gtI6AlMKdwSVr +s6Qlew9/Sf7m9h5T8vD0YDa6GMImerzo3hCilcOfJQQzvxLm4KXfXQHEVqchFsGYWN5 NcD7jRROwezSroXN7KGsk0vvPTlq7XjSQOxuQ1WWxlMF6wC7SHmiVgf/srDSMVJyjTU2 Tnc0WJbwX/Mbs5JXfmJ25z+3pxnmpVGWivgkNUKds/EmIO139L/n+ZE8pjkzGL8ijUvN uHfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WU2bb6Pf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c43si15900841edf.293.2020.07.07.10.16.34; Tue, 07 Jul 2020 10:17:15 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=WU2bb6Pf; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728517AbgGGRPs (ORCPT + 99 others); Tue, 7 Jul 2020 13:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728208AbgGGRPq (ORCPT ); Tue, 7 Jul 2020 13:15:46 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C990DC061755 for ; Tue, 7 Jul 2020 10:15:45 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id m26so25194093lfo.13 for ; Tue, 07 Jul 2020 10:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sJDZPklgLSz+bMRCtm1xi8y9hsWb4olH788+hzSKmpc=; b=WU2bb6PfdBoznpT00kQbPfsp33gzKy0a5KqENwSsU/gVoWIvE49o5u2I+6Sez81hbH w5fYuOus/0PYiDWA+RkRzY9ezg1OhuCGxVUfNf85Cv4g/29s/FhS8WbIKh4jDMEbOp1p B5+ZVSvp2WtzIfDvCw5QXs9NwbWsSKpo7YNPIf2U5Zy+yrNV6y4Q+NNmp3SotlKVaNUH r5QFHef5Xni4w6CsBCC3IXFE0lAPQQcnVZ4ocsC06VpM0PTLBNMCU7NeKu79Pdg/JpXg wDr/Ihr7cZ17ygR3kCgN0P1uAdg2sltX4LAirT86NQdzYfI+ZhbKAymYDj/OGLHeqn7n 1LZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sJDZPklgLSz+bMRCtm1xi8y9hsWb4olH788+hzSKmpc=; b=uMavb3GhOSRaQ5M9fyEEHAxkxCF4cieza5NFukAZ540TQZbTwalqDYRpmOOFGKZVfz coIiSt2/G0oTPkbe+B7HBNomsL9WCml8+VkVz7NAWLCWL/nSd8YoOtt8toRkctwb8lUS 42394t4CcEImyQ/ObIoPjQNXwEtgGXde9q6vkL/qyD7dVNOL2hvc0uFqIsws0BJjwzxn 8KkzxYxPFu90pyCXQzwn7IPBLgkqErHgid0KA936uu3y8ZVQd/LGdUkCTvmyFkcUYIdc aIbD+FNxpbamyqaRLy8SJM+nn4rG8VknJTp8nDkEsEge3eZiR3cjfJGgP8G8ikF1p+py YDAg== X-Gm-Message-State: AOAM531++kN+P9l7IaoEKoLu6/aYBBkAEn9Q0kLOH6eA3Yzam7bnzbVU SacybgqufV3exFqQ6O5+OyUvmxHYjdjMoWHE0xtyiw== X-Received: by 2002:a19:ad41:: with SMTP id s1mr17609418lfd.191.1594142143948; Tue, 07 Jul 2020 10:15:43 -0700 (PDT) MIME-Version: 1.0 References: <20200707141628.368748-1-alainm@chromium.org> <67268C4E-674E-4DE9-B642-E1CAE8748E28@holtmann.org> In-Reply-To: <67268C4E-674E-4DE9-B642-E1CAE8748E28@holtmann.org> From: Alain Michaud Date: Tue, 7 Jul 2020 13:15:32 -0400 Message-ID: Subject: Re: [PATCH v2] Bluetooth: create CONFIG_BT_DEBUG_FEATURE_FUNC_NAME To: Marcel Holtmann Cc: Alain Michaud , BlueZ , Archie Pusaka Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Tue, Jul 7, 2020 at 11:53 AM Marcel Holtmann wrote= : > > 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_PA= RAM > > 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? This was tested on chromeos using this patch chain which also sets the configuration and revert our original patch: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/= 2279613 > > > And frankly I don=E2=80=99t get the point for the new Kconfig option. It = is rather useless in this patch. Tell me one thing, do you prefer that FEAT= URE_DEBUG prints the function names or not. Because if dynamic debug is use= d, we don=E2=80=99t need it since that is all configurable via dynamic debu= g itself and we don=E2=80=99t need it there (and I also don=E2=80=99t want = it in the dynamic debug case). I'd be ok if we unconditionally print function names if CONFIG_BT_FEATURE_DEBUG is set. what I want to avoid is to overly complicate the debug macros to have the function names configurable at runtime. > > Regards > > Marcel >