From 5976dbbbb5bbdbae44880b5467b055a0a3aa83f1 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Wed, 18 Dec 2019 15:21:03 -0300 Subject: [PATCH] weston-log: rename the confusing function name weston_compositor_add_log_scope() There's a function named weston_compositor_add_log_scope() but it doesn't take a struct weston_compositor argument. Rename it to weston_log_ctx_add_log_scope(), as the log_scope is being added to a log_context. Also, bump libweston_major to 9. Signed-off-by: Leandro Ribeiro --- compositor/main.c | 9 ++++----- doc/sphinx/toc/libweston/log.rst | 2 +- include/libweston/weston-log.h | 14 +++++++------- libweston/backend-drm/drm.c | 8 ++++---- libweston/compositor.c | 18 +++++++++--------- libweston/content-protection.c | 8 ++++---- libweston/weston-log.c | 20 ++++++++++---------- meson.build | 2 +- pipewire/pipewire-plugin.c | 10 +++++----- xwayland/launcher.c | 8 ++++---- 10 files changed, 49 insertions(+), 50 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index 8eb8a470..309904c9 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -3162,7 +3162,7 @@ wet_main(int argc, char *argv[]) return EXIT_FAILURE; } - log_scope = weston_compositor_add_log_scope(log_ctx, "log", + log_scope = weston_log_ctx_add_log_scope(log_ctx, "log", "Weston and Wayland log\n", NULL, NULL, NULL); weston_log_file_open(log); @@ -3248,10 +3248,9 @@ wet_main(int argc, char *argv[]) segv_compositor = wet.compositor; protocol_scope = - weston_compositor_add_log_scope(log_ctx, - "proto", - "Wayland protocol dump for all clients.\n", - NULL, NULL, NULL); + weston_log_ctx_add_log_scope(log_ctx, "proto", + "Wayland protocol dump for all clients.\n", + NULL, NULL, NULL); protologger = wl_display_add_protocol_logger(display, protocol_log_fn, diff --git a/doc/sphinx/toc/libweston/log.rst b/doc/sphinx/toc/libweston/log.rst index fd68385f..e1b03337 100644 --- a/doc/sphinx/toc/libweston/log.rst +++ b/doc/sphinx/toc/libweston/log.rst @@ -28,7 +28,7 @@ Log scopes A scope represents a source for a data stream (i.e., a producer). You'll require one as a way to generate data. Creating a log scope is done using -:func:`weston_compositor_add_log_scope()`. You can customize the scope +:func:`weston_log_ctx_add_log_scope()`. You can customize the scope behaviour and you'll require at least a name and a description for the scope. diff --git a/include/libweston/weston-log.h b/include/libweston/weston-log.h index 8ef2a467..40b88571 100644 --- a/include/libweston/weston-log.h +++ b/include/libweston/weston-log.h @@ -55,7 +55,7 @@ struct weston_debug_stream; * * @param sub The subscription. * @param user_data The \c user_data argument given to - * weston_compositor_add_log_scope() + * weston_log_ctx_add_log_scope() * * @memberof weston_log_scope */ @@ -63,12 +63,12 @@ typedef void (*weston_log_scope_cb)(struct weston_log_subscription *sub, void *user_data); struct weston_log_scope * -weston_compositor_add_log_scope(struct weston_log_context *log_ctx, - const char *name, - const char *description, - weston_log_scope_cb new_subscription, - weston_log_scope_cb destroy_subscription, - void *user_data); +weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx, + const char *name, + const char *description, + weston_log_scope_cb new_subscription, + weston_log_scope_cb destroy_subscription, + void *user_data); void weston_compositor_log_scope_destroy(struct weston_log_scope *scope); diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index e0b1cbd7..8780bebe 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -2825,10 +2825,10 @@ drm_backend_create(struct weston_compositor *compositor, b->pageflip_timeout = config->pageflip_timeout; b->use_pixman_shadow = config->use_pixman_shadow; - b->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx, - "drm-backend", - "Debug messages from DRM/KMS backend\n", - NULL, NULL, NULL); + b->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx, + "drm-backend", + "Debug messages from DRM/KMS backend\n", + NULL, NULL, NULL); compositor->backend = &b->base; diff --git a/libweston/compositor.c b/libweston/compositor.c index dbc64927..0a70c273 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -7321,17 +7321,17 @@ weston_compositor_create(struct wl_display *display, WESTON_LAYER_POSITION_CURSOR); ec->debug_scene = - weston_compositor_add_log_scope(ec->weston_log_ctx, "scene-graph", - "Scene graph details\n", - debug_scene_graph_cb, NULL, - ec); + weston_log_ctx_add_log_scope(ec->weston_log_ctx, "scene-graph", + "Scene graph details\n", + debug_scene_graph_cb, NULL, + ec); ec->timeline = - weston_compositor_add_log_scope(ec->weston_log_ctx, "timeline", - "Timeline event points\n", - weston_timeline_create_subscription, - weston_timeline_destroy_subscription, - ec); + weston_log_ctx_add_log_scope(ec->weston_log_ctx, "timeline", + "Timeline event points\n", + weston_timeline_create_subscription, + weston_timeline_destroy_subscription, + ec); return ec; fail: diff --git a/libweston/content-protection.c b/libweston/content-protection.c index 23661453..0d9c4788 100644 --- a/libweston/content-protection.c +++ b/libweston/content-protection.c @@ -339,9 +339,9 @@ weston_compositor_enable_content_protection(struct weston_compositor *compositor cp->destroy_listener.notify = cp_destroy_listener; wl_signal_add(&compositor->destroy_signal, &cp->destroy_listener); - cp->debug = weston_compositor_add_log_scope(compositor->weston_log_ctx, - "content-protection-debug", - "debug-logs for content-protection", - NULL, NULL, NULL); + cp->debug = weston_log_ctx_add_log_scope(compositor->weston_log_ctx, + "content-protection-debug", + "debug-logs for content-protection", + NULL, NULL, NULL); return 0; } diff --git a/libweston/weston-log.c b/libweston/weston-log.c index b2c4597c..57ad07be 100644 --- a/libweston/weston-log.c +++ b/libweston/weston-log.c @@ -355,7 +355,7 @@ weston_log_subscription_remove(struct weston_log_subscription *sub) * matching against the \c name. * * @param log_ctx - * @param name the scope name, see weston_compositor_add_log_scope() + * @param name the scope name, see weston_log_ctx_add_log_scope() * @returns NULL if none found, or a pointer to a weston_log_scope * * @ingroup internal-log @@ -580,12 +580,12 @@ weston_compositor_is_debug_protocol_enabled(struct weston_compositor *wc) * @sa weston_log_scope_cb, weston_log_subscribe */ WL_EXPORT struct weston_log_scope * -weston_compositor_add_log_scope(struct weston_log_context *log_ctx, - const char *name, - const char *description, - weston_log_scope_cb new_subscription, - weston_log_scope_cb destroy_subscription, - void *user_data) +weston_log_ctx_add_log_scope(struct weston_log_context *log_ctx, + const char *name, + const char *description, + weston_log_scope_cb new_subscription, + weston_log_scope_cb destroy_subscription, + void *user_data) { struct weston_log_scope *scope; struct weston_log_subscription *pending_sub = NULL; @@ -726,7 +726,7 @@ weston_log_subscription_complete(struct weston_log_subscription *sub) * stream. Particularly useful for the weston-debug protocol. * * @memberof weston_log_scope - * @sa weston_compositor_add_log_scope, weston_compositor_log_scope_destroy + * @sa weston_log_ctx_add_log_scope, weston_compositor_log_scope_destroy */ WL_EXPORT void weston_log_scope_complete(struct weston_log_scope *scope) @@ -895,9 +895,9 @@ weston_log_scope_timestamp(struct weston_log_scope *scope, * to the scope \c scope_name. * * If \c scope_name has already been created (using - * weston_compositor_add_log_scope) the subscription will take place + * weston_log_ctx_add_log_scope) the subscription will take place * immediately, otherwise we store the subscription into a pending list. See - * also weston_compositor_add_log_scope(). + * also weston_log_ctx_add_log_scope(). * * @param log_ctx the log context, used for accessing pending list * @param subscriber the subscriber, which has to be created before diff --git a/meson.build b/meson.build index 43e1795f..662867cb 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,7 @@ project('weston', license: 'MIT/Expat', ) -libweston_major = 8 +libweston_major = 9 # libweston_revision is manufactured to follow the autotools build's # library file naming, thanks to libtool diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c index 552f5745..d1e0a29e 100644 --- a/pipewire/pipewire-plugin.c +++ b/pipewire/pipewire-plugin.c @@ -822,11 +822,11 @@ weston_module_init(struct weston_compositor *compositor) goto failed; } - pipewire->debug = weston_compositor_add_log_scope( - compositor->weston_log_ctx, - "pipewire", - "Debug messages from pipewire plugin\n", - NULL, NULL, NULL); + pipewire->debug = + weston_log_ctx_add_log_scope(compositor->weston_log_ctx, + "pipewire", + "Debug messages from pipewire plugin\n", + NULL, NULL, NULL); return 0; diff --git a/xwayland/launcher.c b/xwayland/launcher.c index 2f2cebbe..e15dd4f6 100644 --- a/xwayland/launcher.c +++ b/xwayland/launcher.c @@ -396,10 +396,10 @@ weston_module_init(struct weston_compositor *compositor) } wxs->wm_debug = - weston_compositor_add_log_scope(wxs->compositor->weston_log_ctx, - "xwm-wm-x11", - "XWM's window management X11 events\n", - NULL, NULL, NULL); + weston_log_ctx_add_log_scope(wxs->compositor->weston_log_ctx, + "xwm-wm-x11", + "XWM's window management X11 events\n", + NULL, NULL, NULL); return 0;