BUG/MINOR: pool/cli: use ullong to report total pool usage in bytes

As noticed by Gabriel Tzagkarakis in issue #1903, the total pool size
in bytes is historically still in 32 bits, but at least we should report
the product of the number of objects and their size in 64 bits so that
the value doesn't wrap around 4G.

This may be backported to all versions.

(cherry picked from commit 0c5e9896c79cbec3507894ed33a8553127bc170e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c65d18df9ec531576cd88185ee60cdf6486cc17a)
[cf: ctx adjustment]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 07007514f84adf654f316ad95c6b5b3b46263c07)
[cf: ctx adjustment]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/pool.c b/src/pool.c
index b74ffd2..7f5032f 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -525,7 +525,7 @@
 void dump_pools_to_trash()
 {
 	struct pool_head *entry;
-	unsigned long allocated, used;
+	unsigned long long allocated, used;
 	int nbpools;
 
 	allocated = used = nbpools = 0;
@@ -534,21 +534,21 @@
 #ifndef CONFIG_HAP_LOCKLESS_POOLS
 		HA_SPIN_LOCK(POOL_LOCK, &entry->lock);
 #endif
-		chunk_appendf(&trash, "  - Pool %s (%u bytes) : %u allocated (%u bytes), %u used, needed_avg %u, %u failures, %u users, @%p%s\n",
+		chunk_appendf(&trash, "  - Pool %s (%u bytes) : %u allocated (%llu bytes), %u used, needed_avg %u, %u failures, %u users, @%p%s\n",
 			 entry->name, entry->size, entry->allocated,
-		         entry->size * entry->allocated, entry->used,
+			 (ullong)entry->size * entry->allocated, entry->used,
 		         swrate_avg(entry->needed_avg, POOL_AVG_SAMPLES), entry->failed,
 			 entry->users, entry,
 			 (entry->flags & MEM_F_SHARED) ? " [SHARED]" : "");
 
-		allocated += entry->allocated * entry->size;
-		used += entry->used * entry->size;
+		allocated += entry->allocated * (ullong)entry->size;
+		used += entry->used * (ullong)entry->size;
 		nbpools++;
 #ifndef CONFIG_HAP_LOCKLESS_POOLS
 		HA_SPIN_UNLOCK(POOL_LOCK, &entry->lock);
 #endif
 	}
-	chunk_appendf(&trash, "Total: %d pools, %lu bytes allocated, %lu used.\n",
+	chunk_appendf(&trash, "Total: %d pools, %llu bytes allocated, %llu used.\n",
 		 nbpools, allocated, used);
 }