profiler: add xrun_count and latency to profiler

This commit is contained in:
Wim Taymans 2020-12-20 12:24:26 +01:00
parent 0370d7580f
commit 2d89ad8533
2 changed files with 13 additions and 6 deletions

View file

@ -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,
};

View file

@ -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]);