From 66cad4ffb12fec261a476661393167c7426c29d8 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Sun, 23 Nov 2025 19:57:55 +0200 Subject: mempool: Fix 32-bit stats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are living in 64-bit world long time, so there is very likely mempool stats might overflow past 4GB and report incorrect values. Updated mempool stats to use 64-bit counters so they don’t wrap past 4 GB and print correctly in CLI. Signed-off-by: Denys Fedoryshchenko --- accel-pppd/cli/std_cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'accel-pppd/cli/std_cmd.c') diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index ace48391..c37777b1 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "triton.h" #include "events.h" @@ -57,8 +58,8 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt, cli_sendv(client, "mem(rss/virt): %lu/%lu kB\r\n", vmrss * page_size_kb, vmsize * page_size_kb); #endif cli_send(client, "core:\r\n"); - cli_sendv(client, " mempool_allocated: %u\r\n", triton_stat.mempool_allocated); - cli_sendv(client, " mempool_available: %u\r\n", triton_stat.mempool_available); + cli_sendv(client, " mempool_allocated: %" PRIu64 "\r\n", triton_stat.mempool_allocated); + cli_sendv(client, " mempool_available: %" PRIu64 "\r\n", triton_stat.mempool_available); cli_sendv(client, " thread_count: %u\r\n", triton_stat.thread_count); cli_sendv(client, " thread_active: %u\r\n", triton_stat.thread_active); cli_sendv(client, " context_count: %u\r\n", triton_stat.context_count); -- cgit v1.2.3