libweston: Create the 'timeline' scope
authorMarius Vlad <marius.vlad@collabora.com>
Thu, 5 Sep 2019 11:31:01 +0000 (14:31 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 17 Oct 2019 18:42:25 +0000 (21:42 +0300)
With everything now in place, it is time to create the timeline scope.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
include/libweston/libweston.h
libweston/compositor.c
libweston/weston-log-internal.h

index 62f5ad6681b37b9e74fd2182d8735d388201f3d4..3d69f4753052eedeb99dde1197cf78e19c30f292 100644 (file)
@@ -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;
 };
index 2d46546e0af229bc883f2fc7535c4538a0ae69f4..e371e07b48674df94e699b11aa7d1901520ebb2f 100644 (file)
@@ -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.
index 6e28a4f5a0885708d11987c698f17fd5753161a8..ba5b51ce1306e8a3c64a75db4a35e75594cee623 100644 (file)
@@ -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 */