renderer-gl: Add a Perfetto trace counter for tracking GPU active

This duplicates the 'active' time slice we have in Perfetto but provides
a better way to gauge instantly the GPU activity rather than a time
slice.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2026-03-11 23:53:43 +02:00
parent 54a25720c6
commit a643011bb0

View file

@ -58,6 +58,7 @@
#include "linux-explicit-synchronization.h"
#include "output-capture.h"
#include "pixel-formats.h"
#include "weston-trace.h"
#include "shared/fd-util.h"
#include "shared/helpers.h"
@ -735,7 +736,7 @@ timeline_render_point_handler(int fd, uint32_t mask, void *data)
(int64_t) begin.tv_sec, end.tv_nsec,
(int64_t) begin.tv_sec, end.tv_nsec,
(float) (elapsed / 1000));
WESTON_TRACE_SET_COUNTER("GPU active (us)", elapsed / 1000);
}