Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177468
b: refs/heads/master
c: 9b33827
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Dec 16, 2009
1 parent 8ed8a69 commit b0c476e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 604c5c92972dcb4b98be34775452d09a5d4ec248
refs/heads/master: 9b33827de63539c7c3314ddf890fb216e4acf3d8
9 changes: 5 additions & 4 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "hist.h"
#include "session.h"
#include "sort.h"
#include <math.h>

struct callchain_param callchain_param = {
.mode = CHAIN_GRAPH_REL,
Expand Down Expand Up @@ -494,13 +495,13 @@ static size_t hist_entry__fprintf(struct hist_entry *self,
double old_percent = 0, new_percent = 0, diff;

if (total > 0)
old_percent = (count * 100) / total;
old_percent = (count * 100.0) / total;
if (session->events_stats.total > 0)
new_percent = (self->count * 100) / session->events_stats.total;
new_percent = (self->count * 100.0) / session->events_stats.total;

diff = old_percent - new_percent;
diff = new_percent - old_percent;

if ((u64)diff != 0)
if (fabs(diff) >= 0.01)
snprintf(bf, sizeof(bf), "%+4.2F%%", diff);
else
snprintf(bf, sizeof(bf), " ");
Expand Down

0 comments on commit b0c476e

Please sign in to comment.