projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
741a0c5
)
perf tools: Generalize percent_color_snprintf()
author
Ramkumar Ramachandra
<artagnon@gmail.com>
Mon, 30 Dec 2013 07:34:18 +0000
(13:04 +0530)
committer
Arnaldo Carvalho de Melo
<acme@redhat.com>
Mon, 13 Jan 2014 13:46:39 +0000
(10:46 -0300)
Make percent_color_snprintf() handle negative values correctly.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link:
http://lkml.kernel.org/r/1388388861-7931-2-git-send-email-artagnon@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/color.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/color.c
b/tools/perf/util/color.c
index 66e44a5019d538fff04d338bbf304b3dccecb4e2..8cda46c43e74f330c0297079c661ec2116a72fb9 100644
(file)
--- a/
tools/perf/util/color.c
+++ b/
tools/perf/util/color.c
@@
-1,6
+1,7
@@
#include <linux/kernel.h>
#include "cache.h"
#include "color.h"
+#include <math.h>
int perf_use_color_default = -1;
@@
-298,10
+299,10
@@
const char *get_percent_color(double percent)
* entries in green - and keep the low overhead places
* normal:
*/
- if (
percent
>= MIN_RED)
+ if (
fabs(percent)
>= MIN_RED)
color = PERF_COLOR_RED;
else {
- if (
percent
> MIN_GREEN)
+ if (
fabs(percent)
> MIN_GREEN)
color = PERF_COLOR_GREEN;
}
return color;