From 2d89ad85333b8869723f93180d5d6ed6c9f34bec Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 20 Dec 2020 12:24:26 +0100 Subject: [PATCH] profiler: add xrun_count and latency to profiler --- spa/include/spa/param/profiler.h | 10 +++++++--- src/modules/module-profiler.c | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/spa/include/spa/param/profiler.h b/spa/include/spa/param/profiler.h index d08bd082b..8bb4635ba 100644 --- a/spa/include/spa/param/profiler.h +++ b/spa/include/spa/param/profiler.h @@ -41,7 +41,8 @@ enum spa_profiler { * Long : counter, * Float : cpu_load fast, * Float : cpu_load medium, - * Float : cpu_load slow)) */ + * Float : cpu_load slow), + * Int : xrun-count)) */ SPA_PROFILER_clock, /**< clock information * (Struct( * Int : clock flags, @@ -62,7 +63,8 @@ enum spa_profiler { * Long : driver signal, * Long : driver awake, * Long : driver finish, - * Int : driver status)) */ + * Int : driver status), + * Fraction : latency)) */ SPA_PROFILER_START_Follower = 0x20000, /**< follower related profiler properties */ SPA_PROFILER_followerBlock, /**< generic follower info block @@ -73,7 +75,9 @@ enum spa_profiler { * Long : signal, * Long : awake, * Long : finish, - * Int : status)) */ + * Int : status, + * Fraction : latency)) */ + SPA_PROFILER_START_CUSTOM = 0x1000000, }; diff --git a/src/modules/module-profiler.c b/src/modules/module-profiler.c index 35d74b773..5f20bd80e 100644 --- a/src/modules/module-profiler.c +++ b/src/modules/module-profiler.c @@ -171,7 +171,8 @@ static void context_start(void *data, struct pw_impl_node *node) SPA_POD_Long(impl->count), SPA_POD_Float(a->cpu_load[0]), SPA_POD_Float(a->cpu_load[1]), - SPA_POD_Float(a->cpu_load[2])); + SPA_POD_Float(a->cpu_load[2]), + SPA_POD_Int(a->xrun_count)); spa_pod_builder_prop(&b, SPA_PROFILER_clock, 0); spa_pod_builder_add_struct(&b, @@ -194,7 +195,8 @@ static void context_start(void *data, struct pw_impl_node *node) SPA_POD_Long(a->signal_time), SPA_POD_Long(a->awake_time), SPA_POD_Long(a->finish_time), - SPA_POD_Int(a->status)); + SPA_POD_Int(a->status), + SPA_POD_Fraction(&node->latency)); spa_list_for_each(t, &node->rt.target_list, link) { struct pw_impl_node *n = t->node; @@ -212,7 +214,8 @@ static void context_start(void *data, struct pw_impl_node *node) SPA_POD_Long(na->signal_time), SPA_POD_Long(na->awake_time), SPA_POD_Long(na->finish_time), - SPA_POD_Int(na->status)); + SPA_POD_Int(na->status), + SPA_POD_Fraction(&n->latency)); } spa_pod_builder_pop(&b, &f[0]);