diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-09-14 21:40:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-09-14 21:40:17 +0200 |
commit | ef2a8b9846b56cf97f36037636c5f876d03e2932 (patch) | |
tree | 228804bb58be6f54f6dda6007ffee1e2327b5981 /mutrace.c | |
parent | 8fab7a9d8b474bb1b26800a16882de6938e5bdb2 (diff) |
If nothing is contended say that explicitly
Diffstat (limited to 'mutrace.c')
-rw-r--r-- | mutrace.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -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); |