perf tools: generalize percent_color_snprintf()

Make percent_color_snprintf() handle negative values correctly.

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
perf diff: color the Delta column

Color the numbers in the Delta column using
percent_color_snprintf(). Generalize the coloring function so that we
can accommodate all three comparison methods in future patches: delta,
ratio, and wdiff.

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
perf diff: color the Ratio column

In

  $ perf diff -c ratio

color the Ratio column using value_color_snprintf(), a new function that
operates exactly like percent_color_snprintf(). At first glance, it
looks like percent_color_snprintf() can be turned into a non-variadic
function simplifying things; however, 53805ec (perf tools: Remove cast
of non-variadic function to variadic, 2013-10-31) explains why it needs
to be a variadic function.

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
perf diff: color the Weighted Diff column

In

  $ perf diff -c wdiff:M,N

color the numbers in the Weighted Diff column using
value_color_snprintf().

Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>