From da104ebe5b5c68398f93955fd9d5fb81cdf5f30c Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 5 Sep 2019 14:31:01 +0300 Subject: [PATCH] libweston: Create the 'timeline' scope With everything now in place, it is time to create the timeline scope. Signed-off-by: Marius Vlad --- include/libweston/libweston.h | 1 + libweston/compositor.c | 9 +++++++++ libweston/weston-log-internal.h | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 62f5ad66..3d69f475 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1118,6 +1118,7 @@ struct weston_compositor { struct weston_log_context *weston_log_ctx; struct weston_log_scope *debug_scene; + struct weston_log_scope *timeline; struct content_protection *content_protection; }; diff --git a/libweston/compositor.c b/libweston/compositor.c index 2d46546e..e371e07b 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -7294,6 +7294,12 @@ weston_compositor_create(struct wl_display *display, 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); return ec; fail: @@ -7618,6 +7624,9 @@ weston_compositor_tear_down(struct weston_compositor *compositor) weston_compositor_log_scope_destroy(compositor->debug_scene); compositor->debug_scene = NULL; + + weston_compositor_log_scope_destroy(compositor->timeline); + compositor->timeline = NULL; } /** Destroys the compositor. diff --git a/libweston/weston-log-internal.h b/libweston/weston-log-internal.h index 6e28a4f5..ba5b51ce 100644 --- a/libweston/weston-log-internal.h +++ b/libweston/weston-log-internal.h @@ -108,4 +108,12 @@ weston_log_subscription_get_data(struct weston_log_subscription *sub); void weston_log_subscription_set_data(struct weston_log_subscription *sub, void *data); +void +weston_timeline_create_subscription(struct weston_log_subscription *sub, + void *user_data); + +void +weston_timeline_destroy_subscription(struct weston_log_subscription *sub, + void *user_data); + #endif /* WESTON_LOG_INTERNAL_H */