MINOR: cli/pools: add sorting capabilities to "show pools"

The "show pools" command is used a lot for debugging but didn't get much
love over the years. This patch brings new capabilities:
  - sorting the output by pool names to ese their finding ("byname").
  - sorting the output by reverse item size to spot the biggest ones("bysize")
  - sorting the output by reverse number of allocated bytes ("byusage")

The last one (byusage) also omits displaying the ones with zero allocation.

In addition, an optional max number of output entries may be passed so as
to dump only the N most relevant ones.
This commit is contained in:
Willy Tarreau
2022-11-21 09:34:02 +01:00
parent 224adf2bfb
commit 2fba08faec
3 changed files with 101 additions and 12 deletions

View File

@@ -106,7 +106,6 @@ void *pool_get_from_os(struct pool_head *pool);
void pool_put_to_os(struct pool_head *pool, void *ptr);
void *pool_alloc_nocache(struct pool_head *pool);
void pool_free_nocache(struct pool_head *pool, void *ptr);
void dump_pools_to_trash(void);
void dump_pools(void);
int pool_parse_debugging(const char *str, char **err);
int pool_total_failures(void);