Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1073529ybt; Tue, 7 Jul 2020 07:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaH7G00QeX5Zul1/NKVARBCv55UcssDgYE9nEE8YUndk+tZHqLhxNfLovaBmfBVFJ9pLK5 X-Received: by 2002:a17:906:8607:: with SMTP id o7mr46977085ejx.142.1594131237178; Tue, 07 Jul 2020 07:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594131237; cv=none; d=google.com; s=arc-20160816; b=TCKQNx6emscS4iALy6UTD7JxC0Pe1Z57WCUK9SMQJQZ89pJuh6d3BSdUu3yvaBembg dF8YGko6AXE1jG8b15BUon31WsccFbeZNSuiIAQOrlUz/NmYgdNZ/xgY3jUMTPXHnj+g u1BfpYdWS0oxjBfIfNA/6tbVTdCYU1LBl8SNvhqoPJkOzf7VlKyBqvEZ7uzsKyb+pRE/ nzTehhX8+F18esJrnn5SsSG0GSx969LQMe2mtHs4d8ZWPucpDSJarU8CgY9EEJeODDGl OMoBQGJlLD5RQncjwcun1MDBHiTTmOHToAwo5YFU3Fu2x/U9e1LFmD/phgLJ62pGWFp/ TuVQ== 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=31YB8C7LlV2ugyqBrHpIc9PFJe4tvb97GRu/M1V5abY=; b=GIr0Kn8LXAs2PhHrT11lRich2cFUR3zQA8nfz33l6eFD1Y7pmem/anTek+WUl3X2Ju IlOATTepgnDWaVnsvV6kRn3ljKS/jBUKu5klf4DT1XTv/3FTn7mA79a6GhvDXmU3EKqj 8gQFqUyoirelxAKAUljuGwG0a/N8SxX9/bHcQDgGqdmMZeG72FZOrXW/VZyvvnJv1yTH nWrcJ4noxqpMFMNoAplwblyURMm8xdtrVB5GdQ9gb4eeIxt9Mp5/zwmVQk9spvRQ/bvz pZQJFnvYBFoHrIrEyFypurwccMLHIag4Z42k5hm1PQDHZtSXhNq74em/tc1kGkrFySF5 kLcA== 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 q24si14731788edw.193.2020.07.07.07.13.29; Tue, 07 Jul 2020 07:13:57 -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 S1727975AbgGGONZ convert rfc822-to-8bit (ORCPT + 99 others); Tue, 7 Jul 2020 10:13:25 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:45755 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbgGGONZ (ORCPT ); Tue, 7 Jul 2020 10:13:25 -0400 Received: from [192.168.1.91] (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id C68AFCECEC; Tue, 7 Jul 2020 16:23:19 +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 v1] Bluetooth: create CONFIG_BT_DEBUG_FUNC_NAME From: Marcel Holtmann In-Reply-To: Date: Tue, 7 Jul 2020 16:12:52 +0200 Cc: Alain Michaud , linux-bluetooth , Abhishek Pandit-Subedi Content-Transfer-Encoding: 8BIT Message-Id: <67720527-0A53-4B5B-A1CB-D53AE162A82C@holtmann.org> References: <20200707003937.187125-1-alainm@chromium.org> <4B0E4627-26D8-4D70-ABE9-6CB7A9E86D35@holtmann.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_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. >> >> can we please limit this to FEATURE_DEBUG since dynamic debug doesn’t need it. It can switch on function name debugging on a per debug statement. And even for FEATURE_DEBUG I would rather have it optional that can be enabled when needed via the experimental feature itself. > I agree on making this dependent on FEATURE_DEBUG as it may simplify > the configuration, but I don't think I like having this enabled via an > experimental feature as it complicates the tracing macros quite a bit > for no good reason. I don't see a scenario where someone would turn > on CONFIG_DEBUG_FUNC_NAME but not want it enabled. I left the Set Experimental Feature command flexible and so you could add an extra flags/settings bitmask additionally to choose how to format the debug strings. Similar to what dynamic debug is doing. An alternative is that you have two debug features, one for with function names and one without. If you turn on both, then the one with function names supersedes. Regards Marcel