summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-07-29 17:05:19 +0200
committerWim Taymans <wtaymans@redhat.com>2019-07-29 17:05:19 +0200
commitc164cb80c815b7f2a0f52110d8d0f22c52004fa4 (patch)
tree92f61427f472b35b0870aa38f61342fa7262e01b
parent40e3ba8bb49c642ad6ff8b6758d1d902bac8a8e2 (diff)
improve debug
-rw-r--r--src/modules/module-client-node/client-node.c3
-rw-r--r--src/pipewire/client.c3
-rw-r--r--src/pipewire/mem.c10
-rw-r--r--src/pipewire/node.c4
-rw-r--r--src/pipewire/stream.c7
5 files changed, 19 insertions, 8 deletions
diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c
index 551d703a..72849596 100644
--- a/src/modules/module-client-node/client-node.c
+++ b/src/modules/module-client-node/client-node.c
@@ -378,10 +378,11 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
spa_return_val_if_fail(this != NULL, -EINVAL);
spa_return_val_if_fail(command != NULL, -EINVAL);
+ pw_log_debug(NAME " %p: send command %d", this, SPA_COMMAND_TYPE(command));
+
if (this->resource == NULL)
return -EIO;
- pw_log_debug(NAME " %p: send command %d", this, SPA_COMMAND_TYPE(command));
return pw_client_node_resource_command(this->resource, command);
}
diff --git a/src/pipewire/client.c b/src/pipewire/client.c
index 536a92a0..c3eff1a9 100644
--- a/src/pipewire/client.c
+++ b/src/pipewire/client.c
@@ -228,6 +228,8 @@ static void pool_added(void *data, struct pw_memblock *block)
{
struct impl *impl = data;
struct pw_client *client = &impl->this;
+
+ pw_log_debug("client %p: added block %d", client, block->id);
if (client->core_resource) {
pw_core_resource_add_mem(client->core_resource,
block->id, block->type, block->fd,
@@ -239,6 +241,7 @@ static void pool_removed(void *data, struct pw_memblock *block)
{
struct impl *impl = data;
struct pw_client *client = &impl->this;
+ pw_log_debug("client %p: removed block %d", client, block->id);
if (client->core_resource)
pw_core_resource_remove_mem(client->core_resource, block->id);
}
diff --git a/src/pipewire/mem.c b/src/pipewire/mem.c
index ccf07d15..8ffa06bb 100644
--- a/src/pipewire/mem.c
+++ b/src/pipewire/mem.c
@@ -244,10 +244,15 @@ static struct mapping * memblock_find_mapping(struct memblock *b,
uint32_t flags, uint32_t offset, uint32_t size)
{
struct mapping *m;
+ struct pw_mempool *pool = b->this.pool;
spa_list_for_each(m, &b->mappings, link) {
- if (m->offset <= offset && (m->offset + m->size) >= (offset + size))
+ if (m->offset <= offset && (m->offset + m->size) >= (offset + size)) {
+ pw_log_debug("pool %p: found %p id:%d fd:%d offs:%d size:%d ref:%d",
+ pool, &b->this, b->this.id, b->this.fd,
+ offset, size, b->this.ref);
return m;
+ }
}
return NULL;
}
@@ -487,7 +492,8 @@ static struct memblock * mempool_find_fd(struct pw_mempool *pool, int fd)
spa_list_for_each(b, &impl->blocks, link) {
if (fd == b->this.fd) {
- pw_log_debug("pool %p: found %p id:%d for fd %d", pool, &b->this, b->this.id, fd);
+ pw_log_debug("pool %p: found %p id:%d fd:%d ref:%d",
+ pool, &b->this, b->this.id, fd, b->this.ref);
return b;
}
}
diff --git a/src/pipewire/node.c b/src/pipewire/node.c
index f8c81e11..093ebbca 100644
--- a/src/pipewire/node.c
+++ b/src/pipewire/node.c
@@ -719,10 +719,10 @@ static void dump_states(struct pw_node *driver)
struct pw_node_activation *a = t->activation;
if (t->node == NULL)
continue;
- pw_log_warn("node %p (%s): required:%d s:%"PRIu64" a:%"PRIu64" f:%"PRIu64
+ pw_log_warn("node %p (%s): pending:%d/%d s:%"PRIu64" a:%"PRIu64" f:%"PRIu64
" waiting:%"PRIu64" process:%"PRIu64" status:%d",
t->node, t->node->info.name,
- a->state[0].required,
+ a->state[0].pending, a->state[0].required,
a->signal_time,
a->awake_time,
a->finish_time,
diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c
index 68c56834..ba187780 100644
--- a/src/pipewire/stream.c
+++ b/src/pipewire/stream.c
@@ -711,8 +711,8 @@ static int impl_node_process_input(void *object)
size = impl->time.ticks - impl->dequeued.incount;
- pw_log_trace(NAME" %p: process in %d %d %"PRIu64" %"PRIi64" %"PRIu64, stream,
- io->status, io->buffer_id, impl->time.ticks, impl->time.delay, size);
+ pw_log_trace(NAME" %p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64" size:%"PRIi64,
+ stream, io->status, io->buffer_id, impl->time.ticks, impl->time.delay, size);
if (io->status != SPA_STATUS_HAVE_BUFFER)
goto done;
@@ -750,7 +750,7 @@ static int impl_node_process_output(void *object)
uint32_t index;
again:
- pw_log_trace(NAME" %p: process out %d %d %"PRIu64" %"PRIi64, stream,
+ pw_log_trace(NAME" %p: process out status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64, stream,
io->status, io->buffer_id, impl->time.ticks, impl->time.delay);
res = 0;
@@ -1531,6 +1531,7 @@ SPA_EXPORT
int pw_stream_set_active(struct pw_stream *stream, bool active)
{
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
+ pw_log_debug(NAME" %p: active:%d", stream, active);
if (impl->node)
pw_node_set_active(impl->node, active);
return 0;