move some debug to fastpath

This commit is contained in:
Wim Taymans 2022-03-28 16:25:00 +02:00
parent 2fdd05d568
commit 74da804e97
3 changed files with 24 additions and 24 deletions

View file

@ -177,7 +177,7 @@ static void flush_items(struct impl *impl)
item = SPA_PTROFF(impl->buffer_data, index & (DATAS_SIZE - 1), struct invoke_item);
block = item->block;
spa_log_trace(impl->log, "%p: flush item %p", impl, item);
spa_log_trace_fp(impl->log, "%p: flush item %p", impl, item);
item->res = item->func ? item->func(&impl->loop,
true, item->seq, item->data, item->size,
item->user_data) : 0;
@ -249,7 +249,7 @@ loop_invoke(void *object,
item->user_data = user_data;
item->item_size = SPA_ROUND_UP_N(sizeof(struct invoke_item) + size, ITEM_ALIGN);
spa_log_trace(impl->log, "%p: add item %p filled:%d", impl, item, filled);
spa_log_trace_fp(impl->log, "%p: add item %p filled:%d", impl, item, filled);
if (l0 >= item->item_size) {
/* item + size fit in current ringbuffer idx */

View file

@ -843,9 +843,9 @@ static int link_signal_func(void *user_data)
{
struct link *link = user_data;
struct spa_system *data_system = link->data->context->data_system;
struct timespec ts;
struct timespec ts = { 0, 0 };
pw_log_trace("link %p: signal", link);
pw_log_trace_fp("link %p: signal", link);
spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts);
link->target.activation->status = PW_NODE_ACTIVATION_TRIGGERED;

View file

@ -392,14 +392,14 @@ do_call_process(struct spa_loop *loop,
{
struct stream *impl = user_data;
struct pw_stream *stream = &impl->this;
pw_log_trace("%p: do process", stream);
pw_log_trace_fp("%p: do process", stream);
pw_stream_emit_process(stream);
return 0;
}
static void call_process(struct stream *impl)
{
pw_log_trace("%p: call process rt:%u", impl, impl->process_rt);
pw_log_trace_fp("%p: call process rt:%u", impl, impl->process_rt);
if (impl->process_rt)
spa_callbacks_call(&impl->rt_callbacks, struct pw_stream_events, process, 0);
else
@ -413,7 +413,7 @@ do_call_drained(struct spa_loop *loop,
{
struct stream *impl = user_data;
struct pw_stream *stream = &impl->this;
pw_log_trace("%p: drained", stream);
pw_log_trace_fp("%p: drained", stream);
pw_stream_emit_drained(stream);
return 0;
}
@ -430,7 +430,7 @@ do_call_trigger_done(struct spa_loop *loop,
{
struct stream *impl = user_data;
struct pw_stream *stream = &impl->this;
pw_log_trace("%p: trigger_done", stream);
pw_log_trace_fp("%p: trigger_done", stream);
pw_stream_emit_trigger_done(stream);
return 0;
}
@ -951,7 +951,7 @@ static int impl_node_process_input(void *object)
struct spa_io_buffers *io = impl->io;
struct buffer *b;
pw_log_trace("%p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64,
pw_log_trace_fp("%p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64,
stream, io->status, io->buffer_id, impl->time.ticks, impl->time.delay);
if (io->status == SPA_STATUS_HAVE_DATA &&
@ -967,7 +967,7 @@ static int impl_node_process_input(void *object)
if (io->status != SPA_STATUS_NEED_DATA) {
/* pop buffer to recycle */
if ((b = pop_queue(impl, &impl->queued))) {
pw_log_trace("%p: recycle buffer %d", stream, b->id);
pw_log_trace_fp("%p: recycle buffer %d", stream, b->id);
} else if (io->status == -EPIPE)
return io->status;
io->buffer_id = b ? b->id : SPA_ID_INVALID;
@ -990,14 +990,14 @@ static int impl_node_process_output(void *object)
bool recycled;
again:
pw_log_trace("%p: process out status:%d id:%d", stream,
pw_log_trace_fp("%p: process out status:%d id:%d", stream,
io->status, io->buffer_id);
recycled = false;
if ((res = io->status) != SPA_STATUS_HAVE_DATA) {
/* recycle old buffer */
if ((b = get_buffer(stream, io->buffer_id)) != NULL) {
pw_log_trace("%p: recycle buffer %d", stream, b->id);
pw_log_trace_fp("%p: recycle buffer %d", stream, b->id);
push_queue(impl, &impl->dequeued, b);
recycled = true;
}
@ -1007,17 +1007,17 @@ again:
impl->drained = false;
io->buffer_id = b->id;
res = io->status = SPA_STATUS_HAVE_DATA;
pw_log_trace("%p: pop %d %p", stream, b->id, io);
pw_log_trace_fp("%p: pop %d %p", stream, b->id, io);
} else if (impl->draining || impl->drained) {
impl->draining = true;
impl->drained = true;
io->buffer_id = SPA_ID_INVALID;
res = io->status = SPA_STATUS_DRAINED;
pw_log_trace("%p: draining", stream);
pw_log_trace_fp("%p: draining", stream);
} else {
io->buffer_id = SPA_ID_INVALID;
res = io->status = SPA_STATUS_NEED_DATA;
pw_log_trace("%p: no more buffers %p", stream, io);
pw_log_trace_fp("%p: no more buffers %p", stream, io);
}
}
@ -1041,7 +1041,7 @@ again:
}
}
pw_log_trace("%p: res %d", stream, res);
pw_log_trace_fp("%p: res %d", stream, res);
if (impl->driving && impl->using_trigger && res != SPA_STATUS_HAVE_DATA)
call_trigger_done(impl);
@ -2095,7 +2095,7 @@ int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
time->delay += (impl->latency.min_rate + impl->latency.max_rate) / 2;
time->delay += ((impl->latency.min_ns + impl->latency.max_ns) / 2) * time->rate.denom / SPA_NSEC_PER_SEC;
pw_log_trace("%p: %"PRIi64" %"PRIi64" %"PRIu64" %d/%d %"PRIu64" %"
pw_log_trace_fp("%p: %"PRIi64" %"PRIi64" %"PRIu64" %d/%d %"PRIu64" %"
PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, stream,
time->now, time->delay, time->ticks,
time->rate.num, time->rate.denom, time->queued,
@ -2123,17 +2123,17 @@ struct pw_buffer *pw_stream_dequeue_buffer(struct pw_stream *stream)
if ((b = pop_queue(impl, &impl->dequeued)) == NULL) {
res = -errno;
pw_log_trace("%p: no more buffers: %m", stream);
pw_log_trace_fp("%p: no more buffers: %m", stream);
errno = -res;
return NULL;
}
pw_log_trace("%p: dequeue buffer %d size:%"PRIu64, stream, b->id, b->this.size);
pw_log_trace_fp("%p: dequeue buffer %d size:%"PRIu64, stream, b->id, b->this.size);
if (b->busy && impl->direction == SPA_DIRECTION_OUTPUT) {
if (ATOMIC_INC(b->busy->count) > 1) {
ATOMIC_DEC(b->busy->count);
push_queue(impl, &impl->dequeued, b);
pw_log_trace("%p: buffer busy", stream);
pw_log_trace_fp("%p: buffer busy", stream);
errno = EBUSY;
return NULL;
}
@ -2151,7 +2151,7 @@ int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
if (b->busy)
ATOMIC_DEC(b->busy->count);
pw_log_trace("%p: queue buffer %d", stream, b->id);
pw_log_trace_fp("%p: queue buffer %d", stream, b->id);
if ((res = push_queue(impl, &impl->queued, b)) < 0)
return res;
@ -2171,7 +2171,7 @@ do_flush(struct spa_loop *loop,
struct stream *impl = user_data;
struct buffer *b;
pw_log_trace("%p: flush", impl);
pw_log_trace_fp("%p: flush", impl);
do {
b = pop_queue(impl, &impl->queued);
if (b != NULL)
@ -2189,7 +2189,7 @@ do_drain(struct spa_loop *loop,
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct stream *impl = user_data;
pw_log_trace("%p", impl);
pw_log_trace_fp("%p", impl);
impl->draining = true;
impl->drained = false;
return 0;
@ -2248,7 +2248,7 @@ int pw_stream_trigger_process(struct pw_stream *stream)
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
int res = 0;
pw_log_trace("%p", impl);
pw_log_trace_fp("%p", impl);
/* flag to check for old or new behaviour */
impl->using_trigger = true;