diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2025-11-23 19:57:55 +0200 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2025-11-23 19:57:55 +0200 |
| commit | 66cad4ffb12fec261a476661393167c7426c29d8 (patch) | |
| tree | 39256de0a406f517af67f355ef0b3e712cbef5ae /accel-pppd/cli/std_cmd.c | |
| parent | 9aebde5345cb78c9f37de12897c11979ef3a7cb7 (diff) | |
| download | accel-ppp-66cad4ffb12fec261a476661393167c7426c29d8.tar.gz accel-ppp-66cad4ffb12fec261a476661393167c7426c29d8.zip | |
mempool: Fix 32-bit stats
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 <denys.f@collabora.com>
Diffstat (limited to 'accel-pppd/cli/std_cmd.c')
| -rw-r--r-- | accel-pppd/cli/std_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 <signal.h> #include <malloc.h> #include <arpa/inet.h> +#include <inttypes.h> #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); |
