Hi Martin,
> Below is the patch that can add the time information( tv_sec) into debug
> info. It is useful when track the response time of dhclient or wpa_supplicant.
> Not sure whether it can be added into upstream.
> diff --git a/include/log.h b/include/log.h
> index e9ee8e4..a1fb141 100644
> --- a/include/log.h
> +++ b/include/log.h
> @@ -44,7 +44,11 @@ extern void connman_debug(const char *format, ...);
> * Simple macro around connman_debug() which also include the function
> * name it is called in.
> */
> -#define DBG(fmt, arg...) connman_debug("%s:%s() " fmt, __FILE__,
> __FUNCTION__ , ## arg)
> +#define DBG(fmt, arg...) do { \
> + GTimeVal time_val; \
> + g_get_current_time(&time_val);\
> + connman_debug("[%lu] %s:%s() " fmt, time_val.tv_sec, __FILE__,
> __FUNCTION__ ,## arg);\
> +} while(0)
at least not in this form. We would need to add it directly into
connman_debug and that is more complicated.
The reason why not adding it here is that it will cause too much CPU
load in case we start the daemon without debugging enabled. It would
still call g_get_current_time all the time.
Regards
Marcel
_______________________________________________
connman mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/connman