MINOR: threads/debug: only report used lock stats

The lock stats are very verbose and more than half of them are used in
a typical test, making it hard to spot the sought values. Let's simply
report "not used" for those which have not been called at all.
This commit is contained in:
Willy Tarreau 2020-10-22 08:00:09 +02:00
parent 9a3d3fcb5d
commit 23d3b00bdd

View File

@ -454,6 +454,15 @@ static inline void show_lock_stats()
int lbl; int lbl;
for (lbl = 0; lbl < LOCK_LABELS; lbl++) { for (lbl = 0; lbl < LOCK_LABELS; lbl++) {
if (!lock_stats[lbl].num_write_locked &&
!lock_stats[lbl].num_seek_locked &&
!lock_stats[lbl].num_read_locked) {
fprintf(stderr,
"Stats about Lock %s: not used\n",
lock_label(lbl));
continue;
}
fprintf(stderr, fprintf(stderr,
"Stats about Lock %s: \n" "Stats about Lock %s: \n"
"\t # write lock : %lu\n" "\t # write lock : %lu\n"