]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: pools: also print the value of the tag when it doesn't match
authorWilly Tarreau <w@1wt.eu>
Tue, 12 Sep 2023 15:29:57 +0000 (17:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Sep 2023 16:14:05 +0000 (18:14 +0200)
Sometimes the tag's value may reveal a recognizable pattern, so let's
print it when it doesn't match a known pool.

src/pool.c

index f4b99a4327100c2078b43e75fee47d78e62b475d..37c8485441dfe7ef032745b0e0a4e4fad5b7d226 100644 (file)
@@ -967,7 +967,10 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item
                        the_pool = pool;
                }
                else {
-                       chunk_appendf(&trash, "Tag does not match. Possible origin pool(s):\n");
+                       if (!may_access(pool_mark))
+                               chunk_appendf(&trash, "Tag not accessible. ");
+                       else
+                               chunk_appendf(&trash, "Tag does not match (%p). ", tag);
 
                        list_for_each_entry(ph, &pools, list) {
                                pool_mark = (const void **)(((char *)item) + ph->size);
@@ -976,6 +979,9 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item
                                tag =  *pool_mark;
 
                                if (tag == ph) {
+                                       if (!the_pool)
+                                               chunk_appendf(&trash, "Possible origin pool(s):\n");
+
                                        chunk_appendf(&trash, "  tag: @%p = %p (%s, size %u, real %u, users %u)\n",
                                                      pool_mark, tag, ph->name, ph->size, ph->alloc_sz, ph->users);
                                        if (!the_pool || the_pool->size < ph->size)
@@ -984,7 +990,7 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item
                        }
 
                        if (!the_pool)
-                               chunk_appendf(&trash, "  none found.\n");
+                               chunk_appendf(&trash, "Tag does not match any other pool.\n");
                }
        }