mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
node: improve profiler
Make a new complete event and use it instead of the start event Use the start event at the start of the cycle Make the profiler also log incomplete graph cycles
This commit is contained in:
parent
f630dd1a3b
commit
62954e14c3
3 changed files with 9 additions and 3 deletions
|
|
@ -150,7 +150,7 @@ static void flush_timeout(void *data, uint64_t expirations)
|
||||||
pw_profiler_resource_profile(resource, &p->pod);
|
pw_profiler_resource_profile(resource, &p->pod);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void context_start(void *data, struct pw_impl_node *node)
|
static void context_do_profile(void *data, struct pw_impl_node *node)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
char buffer[4096];
|
char buffer[4096];
|
||||||
|
|
@ -243,7 +243,8 @@ done:
|
||||||
|
|
||||||
static const struct pw_context_driver_events context_events = {
|
static const struct pw_context_driver_events context_events = {
|
||||||
PW_VERSION_CONTEXT_DRIVER_EVENTS,
|
PW_VERSION_CONTEXT_DRIVER_EVENTS,
|
||||||
.start = context_start,
|
.incomplete = context_do_profile,
|
||||||
|
.complete = context_do_profile,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int do_stop(struct spa_loop *loop,
|
static int do_stop(struct spa_loop *loop,
|
||||||
|
|
|
||||||
|
|
@ -1008,7 +1008,7 @@ static inline int process_node(void *data)
|
||||||
a->signal_time - a->prev_signal_time,
|
a->signal_time - a->prev_signal_time,
|
||||||
a->cpu_load[0], a->cpu_load[1], a->cpu_load[2]);
|
a->cpu_load[0], a->cpu_load[1], a->cpu_load[2]);
|
||||||
|
|
||||||
pw_context_driver_emit_start(this->context, this);
|
pw_context_driver_emit_complete(this->context, this);
|
||||||
|
|
||||||
} else if (status == SPA_STATUS_OK) {
|
} else if (status == SPA_STATUS_OK) {
|
||||||
pw_log_trace_fp(NAME" %p: async continue", this);
|
pw_log_trace_fp(NAME" %p: async continue", this);
|
||||||
|
|
@ -1542,6 +1542,8 @@ static int node_ready(void *data, int status)
|
||||||
do_reposition(node, reposition_node);
|
do_reposition(node, reposition_node);
|
||||||
|
|
||||||
update_position(node, all_ready);
|
update_position(node, all_ready);
|
||||||
|
|
||||||
|
pw_context_driver_emit_start(node->context, node);
|
||||||
}
|
}
|
||||||
if (SPA_UNLIKELY(node->driver && !node->driving))
|
if (SPA_UNLIKELY(node->driver && !node->driving))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ pw_core_resource_errorf(struct pw_resource *resource, uint32_t id, int seq,
|
||||||
#define pw_context_driver_emit_incomplete(c,n) pw_context_driver_emit(c, incomplete, 0, n)
|
#define pw_context_driver_emit_incomplete(c,n) pw_context_driver_emit(c, incomplete, 0, n)
|
||||||
#define pw_context_driver_emit_timeout(c,n) pw_context_driver_emit(c, timeout, 0, n)
|
#define pw_context_driver_emit_timeout(c,n) pw_context_driver_emit(c, timeout, 0, n)
|
||||||
#define pw_context_driver_emit_drained(c,n) pw_context_driver_emit(c, drained, 0, n)
|
#define pw_context_driver_emit_drained(c,n) pw_context_driver_emit(c, drained, 0, n)
|
||||||
|
#define pw_context_driver_emit_complete(c,n) pw_context_driver_emit(c, complete, 0, n)
|
||||||
|
|
||||||
struct pw_context_driver_events {
|
struct pw_context_driver_events {
|
||||||
#define PW_VERSION_CONTEXT_DRIVER_EVENTS 0
|
#define PW_VERSION_CONTEXT_DRIVER_EVENTS 0
|
||||||
|
|
@ -344,6 +345,8 @@ struct pw_context_driver_events {
|
||||||
void (*timeout) (void *data, struct pw_impl_node *node);
|
void (*timeout) (void *data, struct pw_impl_node *node);
|
||||||
/** a node drained */
|
/** a node drained */
|
||||||
void (*drained) (void *data, struct pw_impl_node *node);
|
void (*drained) (void *data, struct pw_impl_node *node);
|
||||||
|
/** The driver completed the graph */
|
||||||
|
void (*complete) (void *data, struct pw_impl_node *node);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define pw_registry_resource(r,m,v,...) pw_resource_call(r, struct pw_registry_events,m,v,##__VA_ARGS__)
|
#define pw_registry_resource(r,m,v,...) pw_resource_call(r, struct pw_registry_events,m,v,##__VA_ARGS__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue