Re: [PATCH BlueZ v2 1/9] log: Introduce DBG_IS_ENABLED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux