summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-01-19 20:15:25 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2018-01-19 20:15:25 +0000
commit26009076a23062f2556b785aa5e5502fa5b52dce (patch)
tree36c0e61f2f6361a20a4acfce73292d22c1fe903d /tools
parent49150ba51524a3ae423a8fb649c543718d41b4d9 (diff)
Beautify the eos-profile-show output
Add more Unicode art.
Diffstat (limited to 'tools')
-rw-r--r--tools/eos-profile-tool/eos-profile-cmd-show.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/tools/eos-profile-tool/eos-profile-cmd-show.c b/tools/eos-profile-tool/eos-profile-cmd-show.c
index 1645331..f8a0f72 100644
--- a/tools/eos-profile-tool/eos-profile-cmd-show.c
+++ b/tools/eos-profile-tool/eos-profile-cmd-show.c
@@ -80,7 +80,7 @@ print_location (const char *file,
const char *function)
{
eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
- " `- %s at %s:%d",
+ " ┕━ • location: %s() at %s:%d",
function,
file,
line);
@@ -159,29 +159,33 @@ print_samples (const char *name,
g_autofree char *stddev = g_strdup_printf (", σ: %g", s);
- msg =
- g_strdup_printf ("%d samples: total time: %d %s, avg: %g %s, min: %d %s, max: %d %s%s",
- valid_samples->len,
- (int) scale_val (total), unit_for (total),
- scale_val (avg), unit_for (avg),
- (int) scale_val (min_sample), unit_for (min_sample),
- (int) scale_val (max_sample), unit_for (max_sample),
- s == 0.0 ? "" : stddev);
+ eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
+ " ┕━ • %d samples",
+ valid_samples->len);
+ eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
+ " ┕━ • total time: %d %s,"
+ " avg: %g %s, min: %d %s, max: %d"
+ "%s%s",
+ (int) scale_val (total), unit_for (total),
+ scale_val (avg), unit_for (avg),
+ (int) scale_val (min_sample), unit_for (min_sample),
+ (int) scale_val (max_sample), unit_for (max_sample),
+ s == 0.0 || isnan (s) ? "" : stddev);
}
else if (valid_samples->len == 1)
{
- msg = g_strdup_printf ("1 sample: total time: %d %s",
- (int) scale_val (total),
- unit_for (total));
+ eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
+ " ┕━ • 1 sample");
+ eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
+ " ┕━ • total time: %d %s",
+ (int) scale_val (total),
+ unit_for (total));
}
else
{
- msg = g_strdup ("Not enough valid samples found");
+ eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
+ " ┕━ • Not enough valid samples found");
}
-
- eos_profile_util_print_message (NULL, EOS_PRINT_COLOR_NONE,
- " `- %s",
- msg);
}
int