diff options
author | Akos PASZTORY <akos.pasztory@gmail.com> | 2011-12-03 15:42:57 +0000 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-12-05 10:55:06 +0100 |
commit | 252fffecad8a44284a2bf5e11e7794544f06e6f1 (patch) | |
tree | 8f3edf23c5a195a614e285cea1537fe3f6bc88e9 | |
parent | 777033801b83419c842ad9beaf74a2b336cf861e (diff) | |
download | latrace-stat_fixies.tar.gz latrace-stat_fixies.tar.xz latrace-stat_fixies.zip |
stats: report zero percents instead of NaNstat_fixies
-rw-r--r-- | src/stats.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stats.c b/src/stats.c index d5c5351..410c68e 100644 --- a/src/stats.c +++ b/src/stats.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> +#include <math.h> #include "config.h" @@ -229,6 +230,8 @@ static int lt_stats_show_thread(struct lt_config_app *cfg, struct lt_thread *t) u_int time_sym = sym->tv_all.tv_sec*1000000 + sym->tv_all.tv_usec; sym->percent = time_sym / (time_global/100); + if (isnan(sym->percent)) + sym->percent = 0.0f; sym->usec_call = time_sym/sym->call; } |