DEBUG: pool: show a few examples in -dMhelp

It's not always easy to remember what certain options do together nor
which ones are only relevant when combined with others, so let's add a
few examples with the "help" command on -dM.
This commit is contained in:
Willy Tarreau 2022-12-08 18:42:51 +01:00
parent 4da51bd190
commit b634987fed
1 changed files with 11 additions and 0 deletions

View File

@ -1052,6 +1052,17 @@ int pool_parse_debugging(const char *str, char **err)
dbg_options[v].clr,
dbg_options[v].hlp);
}
memprintf(err,
"%s -----------------+-----------------+-----------------------------------------\n"
"Examples:\n"
" Disable merging and enable poisonning with byte 'P': -dM0x50,no-merge\n"
" Randomly fail allocations: -dMfail\n"
" Detect out-of-bound corruptions: -dMno-merge,tag\n"
" Detect post-free cache corruptions: -dMno-merge,cold-first,integrity,caller\n"
" Detect all cache corruptions: -dMno-merge,cold-first,integrity,tag,caller\n"
" Detect post-free cache corruptions: -dMno-merge,cold-first,integrity,caller\n",
*err);
return -1;
}