All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ v2 1/9] log: Introduce DBG_IS_ENABLED
Date: Wed, 23 Mar 2022 11:35:53 +0100	[thread overview]
Message-ID: <7C167E0B-0DCB-405E-B2D2-65FE655BA522@holtmann.org> (raw)
In-Reply-To: <20220323000654.3157833-1-luiz.dentz@gmail.com>

Hi Luiz,

> This introduces DBG_IS_ENABLE macro which can be used to check if
> BTD_DEBUG_FLAG_PRINT has been enabled for the current file.
> ---
> src/log.c | 12 ++++++++++++
> src/log.h | 11 +++++++++++
> 2 files changed, 23 insertions(+)
> 
> diff --git a/src/log.c b/src/log.c
> index 0155a6bba..1157859ef 100644
> --- a/src/log.c
> +++ b/src/log.c
> @@ -179,6 +179,18 @@ void __btd_log_init(const char *debug, int detach)
> 	info("Bluetooth daemon %s", VERSION);
> }
> 
> +bool __btd_log_is_enabled(const char *file)
> +{
> +	struct btd_debug_desc *desc;
> +
> +	for (desc = __start___debug; desc < __stop___debug; desc++) {
> +		if (desc->file && g_pattern_match_simple(file, desc->file))
> +			return desc->flags & BTD_DEBUG_FLAG_PRINT;
> +	}
> +
> +	return false;
> +}
> +

this is an expensive operation. What do you need this for?

Regards

Marcel


  parent reply	other threads:[~2022-03-23 10:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  0:06 [PATCH BlueZ v2 1/9] log: Introduce DBG_IS_ENABLED Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 2/9] mgmt: Add DBG macro Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 3/9] mgmt: Introduce mgmt_set_verbose Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 4/9] adapter: Don't use DBG in mgmt_debug Luiz Augusto von Dentz
2022-03-23 10:37   ` Marcel Holtmann
2022-03-23 19:58     ` Luiz Augusto von Dentz
2022-03-25 14:52       ` Marcel Holtmann
2022-03-23  0:06 ` [PATCH BlueZ v2 5/9] att: Log file and function names Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 6/9] gatt-client: Add DBG macro Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 7/9] gatt-server: " Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 8/9] att: Rename att_debug and att_verbose to DBG and VERBOSE Luiz Augusto von Dentz
2022-03-23  0:06 ` [PATCH BlueZ v2 9/9] device: Don't use DBG in gatt_debug Luiz Augusto von Dentz
2022-03-23  6:02 ` [BlueZ,v2,1/9] log: Introduce DBG_IS_ENABLED bluez.test.bot
2022-03-23 10:35 ` Marcel Holtmann [this message]
2022-03-23 20:13 [PATCH BlueZ v3 1/9] log: Don't log __FILE__ and __func__ with DBG_IDX Luiz Augusto von Dentz
2022-03-23 20:13 ` [PATCH BlueZ v2 1/9] log: Introduce DBG_IS_ENABLED Luiz Augusto von Dentz
2022-03-24 19:50   ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7C167E0B-0DCB-405E-B2D2-65FE655BA522@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.