From: Willy Tarreau Date: Thu, 22 Oct 2020 06:00:09 +0000 (+0200) Subject: MINOR: threads/debug: only report used lock stats X-Git-Tag: v2.3-dev8~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23d3b00bdd389effb4cdf77de432ad769359bd2c;p=thirdparty%2Fhaproxy.git 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 810eb6f464..84571217c5 100644 --- a/include/haproxy/thread.h +++ b/include/haproxy/thread.h @@ -454,6 +454,15 @@ static inline void show_lock_stats() 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"