From db6189d79c399bb7d89e3167da8aedfe1e47cbf3 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 13 Nov 2015 18:55:17 +0900 Subject: [PATCH] add apis to enable/disable wayland debug at runtime both for server/client Change-Id: Ibcb9da8db2185d0d2a9f225e0f6d80e5a30e9cd4 --- src/wayland-client.c | 2 -- src/wayland-private.h | 9 +++++++++ src/wayland-server.c | 2 -- src/wayland-util.c | 15 +++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/wayland-client.c b/src/wayland-client.c index 90fb9c7..38e7694 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -111,8 +111,6 @@ struct wl_display { /** \endcond */ -static int debug_client = 0; - /** * This helper function wakes up all threads that are * waiting for display->reader_cond (i. e. when reading is done, diff --git a/src/wayland-private.h b/src/wayland-private.h index 9274f1b..c58d0bf 100644 --- a/src/wayland-private.h +++ b/src/wayland-private.h @@ -218,6 +218,15 @@ wl_closure_print(struct wl_closure *closure, void wl_closure_destroy(struct wl_closure *closure); +extern int debug_client; +extern int debug_server; + +void +wl_debug_client_enable(int enable); + +void +wl_debug_server_enable(int enable); + extern wl_log_func_t wl_log_handler; void wl_log(const char *fmt, ...); diff --git a/src/wayland-server.c b/src/wayland-server.c index 8e24b41..69360d5 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -144,8 +144,6 @@ struct wl_protocol_logger { void *user_data; }; -static int debug_server = 0; - static void log_closure(struct wl_resource *resource, struct wl_closure *closure, int send) diff --git a/src/wayland-util.c b/src/wayland-util.c index bb2a183..e596105 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -34,6 +34,9 @@ #include "wayland-util.h" #include "wayland-private.h" +int debug_client = 0; +int debug_server = 0; + WL_EXPORT void wl_list_init(struct wl_list *list) { @@ -432,6 +435,18 @@ wl_map_for_each(struct wl_map *map, wl_iterator_func_t func, void *data) for_each_helper(&map->server_entries, func, data); } +WL_EXPORT void +wl_debug_client_enable(int enable) +{ + debug_client = !!enable; +} + +WL_EXPORT void +wl_debug_server_enable(int enable) +{ + debug_server = !!enable; +} + static void wl_log_stderr_handler(const char *fmt, va_list arg) { -- 2.7.4