summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/color.c
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@linaro.org>2013-10-31 16:47:45 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-01 10:40:51 -0300
commit53805eca3d89b095062c11a6798689bb0af09216 (patch)
treed91df4fa0ec2f36f08d2bfd68ed9abeaeb9020f9 /tools/perf/util/color.c
parente8a923cc1fff6e627f906655ad52ee694ef2f6d7 (diff)
downloadtalos-op-linux-53805eca3d89b095062c11a6798689bb0af09216.tar.gz
talos-op-linux-53805eca3d89b095062c11a6798689bb0af09216.zip
perf tools: Remove cast of non-variadic function to variadic
The 4fb71074a570 (perf ui/hist: Consolidate hpp helpers) cset introduced a cast of percent_color_snprintf to a function pointer type with varargs. Change percent_color_snprintf to be variadic and remove the cast. The symptom of this was all percentages being reported as 0.00% in perf report --stdio output on the armhf arch. Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Will Deacon <will.deacon@arm.com> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Will Deacon <will.deacon@arm.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/87zjppvw7y.fsf@canonical.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/color.c')
-rw-r--r--tools/perf/util/color.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
index 11e46da17bbb..66e44a5019d5 100644
--- a/tools/perf/util/color.c
+++ b/tools/perf/util/color.c
@@ -318,8 +318,15 @@ int percent_color_fprintf(FILE *fp, const char *fmt, double percent)
return r;
}
-int percent_color_snprintf(char *bf, size_t size, const char *fmt, double percent)
+int percent_color_snprintf(char *bf, size_t size, const char *fmt, ...)
{
- const char *color = get_percent_color(percent);
+ 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);
}
OpenPOWER on IntegriCloud