From 8a0a9c809483c54909985beed4add4dd2070ba3c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 10 Jul 2020 12:44:50 +0200 Subject: [PATCH] mem: add some more debug --- src/pipewire/mem.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pipewire/mem.c b/src/pipewire/mem.c index 94b620492..e21224d96 100644 --- a/src/pipewire/mem.c +++ b/src/pipewire/mem.c @@ -162,6 +162,8 @@ void pw_mempool_clear(struct pw_mempool *pool) struct mempool *impl = SPA_CONTAINER_OF(pool, struct mempool, this); struct memblock *b; + pw_log_debug(NAME" %p: clear", pool); + spa_list_consume(b, &impl->blocks, link) pw_memblock_free(&b->this); pw_map_reset(&impl->map); @@ -383,14 +385,18 @@ struct pw_memmap * pw_memblock_map(struct pw_memblock *block, mm->this.offset = offset; mm->this.size = size; mm->this.ptr = SPA_MEMBER(m->ptr, range.start, void); - if (tag) - memcpy(mm->this.tag, tag, sizeof(mm->this.tag)); - - spa_list_append(&b->memmaps, &mm->link); pw_log_debug(NAME" %p: map:%p block:%p fd:%d ptr:%p (%d %d) mapping:%p ref:%d", p, &mm->this, b, b->this.fd, mm->this.ptr, offset, size, m, m->ref); + if (tag) { + memcpy(mm->this.tag, tag, sizeof(mm->this.tag)); + pw_log_debug(NAME" %p: tag:%d:%d:%d:%d:%d", p, + tag[0], tag[1], tag[2], tag[3], tag[4]); + } + + spa_list_append(&b->memmaps, &mm->link); + return &mm->this; } @@ -760,7 +766,8 @@ struct pw_memmap * pw_mempool_find_tag(struct pw_mempool *pool, uint32_t tag[5], struct memblock *b; struct memmap *mm; - pw_log_debug(NAME" %p: find tag %zd", pool, size); + pw_log_debug(NAME" %p: find tag %d:%d:%d:%d:%d size:%zd", pool, + tag[0], tag[1], tag[2], tag[3], tag[4], size); spa_list_for_each(b, &impl->blocks, link) { spa_list_for_each(mm, &b->memmaps, link) {