summaryrefslogtreecommitdiffstats
path: root/mutrace.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-14 21:40:17 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-14 21:40:17 +0200
commitef2a8b9846b56cf97f36037636c5f876d03e2932 (patch)
tree228804bb58be6f54f6dda6007ffee1e2327b5981 /mutrace.c
parent8fab7a9d8b474bb1b26800a16882de6938e5bdb2 (diff)
If nothing is contended say that explicitly
Diffstat (limited to 'mutrace.c')
-rw-r--r--mutrace.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/mutrace.c b/mutrace.c
index 38cadc6..b881d25 100644
--- a/mutrace.c
+++ b/mutrace.c
@@ -407,20 +407,25 @@ static void show_summary(void) {
for (i = 0, m = 0; i < n && m < show_n_max; i++)
m += mutex_info_dump(table[i]) ? 1 : 0;
- fprintf(stderr,
- "\n"
- "mutrace: %u most contended mutexes:\n"
- "\n"
- " Mutex # Locked Changed Cont. tot.Time[ms] avg.Time[ms] max.Time[ms] Type\n",
- show_n_max);
+ if (m > 0) {
+ fprintf(stderr,
+ "\n"
+ "mutrace: %u most contended mutexes:\n"
+ "\n"
+ " Mutex # Locked Changed Cont. tot.Time[ms] avg.Time[ms] max.Time[ms] Type\n",
+ m);
- for (i = 0, m = 0; i < n && m < show_n_max; i++)
- m += mutex_info_stat(table[i]) ? 1 : 0;
+ for (i = 0, m = 0; i < n && m < show_n_max; i++)
+ m += mutex_info_stat(table[i]) ? 1 : 0;
- if (i < n)
+ if (i < n)
+ fprintf(stderr,
+ " ... ... ... ... ... ... ...\n");
+ } else
fprintf(stderr,
- " ... ... ... ... ... ... ...\n");
+ "\n"
+ "mutrace: No mutex contended according to filtering parameters.\n");
free(table);