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.
diff --git a/include/haproxy/thread.h b/include/haproxy/thread.h
index 810eb6f..8457121 100644
--- a/include/haproxy/thread.h
+++ b/include/haproxy/thread.h
@@ -454,6 +454,15 @@
int 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,
"Stats about Lock %s: \n"
"\t # write lock : %lu\n"