mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 05:50:10 +01:00
timeline-perfetto: Store disambiguator globally
This way we can use the same ID when for perfetto counters to allow to identify clients much easier. Also, renamed "surface" with "unlabelled surface" when get_label function is not set. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
af95899121
commit
ad3957ddf8
3 changed files with 7 additions and 5 deletions
|
|
@ -1559,6 +1559,7 @@ struct weston_compositor {
|
||||||
struct wl_list debug_binding_list;
|
struct wl_list debug_binding_list;
|
||||||
|
|
||||||
bool view_list_needs_rebuild;
|
bool view_list_needs_rebuild;
|
||||||
|
int global_weston_surface_disambiguator; /* surface ids to avoid using PID-reuse */
|
||||||
|
|
||||||
uint32_t state;
|
uint32_t state;
|
||||||
struct wl_event_source *idle_source;
|
struct wl_event_source *idle_source;
|
||||||
|
|
@ -2071,6 +2072,7 @@ struct weston_surface {
|
||||||
|
|
||||||
bool is_mapped, is_unmapping, is_mapping;
|
bool is_mapped, is_unmapping, is_mapping;
|
||||||
bool is_opaque;
|
bool is_opaque;
|
||||||
|
uint32_t s_id;
|
||||||
|
|
||||||
/* An list of per seat pointer constraints. */
|
/* An list of per seat pointer constraints. */
|
||||||
struct wl_list pointer_constraints;
|
struct wl_list pointer_constraints;
|
||||||
|
|
|
||||||
|
|
@ -1010,6 +1010,9 @@ weston_surface_create(struct weston_compositor *compositor)
|
||||||
|
|
||||||
surface->compositor = compositor;
|
surface->compositor = compositor;
|
||||||
surface->ref_count = 1;
|
surface->ref_count = 1;
|
||||||
|
compositor->global_weston_surface_disambiguator++;
|
||||||
|
surface->s_id =
|
||||||
|
compositor->global_weston_surface_disambiguator;
|
||||||
|
|
||||||
surface->buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
surface->buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||||
surface->buffer_viewport.buffer.scale = 1;
|
surface->buffer_viewport.buffer.scale = 1;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ weston_perfetto_ensure_output_ids(struct weston_output *output)
|
||||||
static void
|
static void
|
||||||
build_track_name(struct weston_surface *surface, char *name, int size)
|
build_track_name(struct weston_surface *surface, char *name, int size)
|
||||||
{
|
{
|
||||||
static int disambiguator = 0;
|
|
||||||
char surface_label[512];
|
char surface_label[512];
|
||||||
|
|
||||||
/* Make sure we only call this once, so we don't accidentally
|
/* Make sure we only call this once, so we don't accidentally
|
||||||
|
|
@ -70,12 +69,10 @@ build_track_name(struct weston_surface *surface, char *name, int size)
|
||||||
uint32_t res_id;
|
uint32_t res_id;
|
||||||
|
|
||||||
res_id = wl_resource_get_id(surface->resource);
|
res_id = wl_resource_get_id(surface->resource);
|
||||||
snprintf(surface_label, sizeof(surface_label), "surface %d", res_id);
|
snprintf(surface_label, sizeof(surface_label), "unlabelled surface %d", res_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
disambiguator++;
|
snprintf(name, size, "%s #%d", surface_label, surface->s_id);
|
||||||
|
|
||||||
snprintf(name, size, "%s #%d", surface_label, disambiguator);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue