perf diff: Color the Ratio column
[linux-2.6-microblaze.git] / tools / perf / util / color.c
index 8cda46c..87b8672 100644 (file)
@@ -319,15 +319,19 @@ int percent_color_fprintf(FILE *fp, const char *fmt, double percent)
        return r;
 }
 
+int value_color_snprintf(char *bf, size_t size, const char *fmt, double value)
+{
+       const char *color = get_percent_color(value);
+       return color_snprintf(bf, size, color, fmt, value);
+}
+
 int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...)
 {
        va_list args;
        double percent;
-       const char *color;
 
        va_start(args, fmt);
        percent = va_arg(args, double);
        va_end(args);
-       color = get_percent_color(percent);
-       return color_snprintf(bf, size, color, fmt, percent);
+       return value_color_snprintf(bf, size, fmt, percent);
 }