Skip to content

Commit

Permalink
perf trace: Remove thread summary coloring
Browse files Browse the repository at this point in the history
Thread summary line coloring looks ugly.  It doesn't add much value so
remove coloring completely.

Signed-off-by: Pekka Enberg <[email protected]>
Acked-by: David Ahern <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
penberg authored and acmel committed Nov 27, 2013
1 parent 12e5556 commit 15e65c6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,25 +2158,16 @@ static int trace__fprintf_one_thread(struct thread *thread, void *priv)
size_t printed = data->printed;
struct trace *trace = data->trace;
struct thread_trace *ttrace = thread->priv;
const char *color;
double ratio;

if (ttrace == NULL)
return 0;

ratio = (double)ttrace->nr_events / trace->nr_events * 100.0;

color = PERF_COLOR_NORMAL;
if (ratio > 50.0)
color = PERF_COLOR_RED;
else if (ratio > 25.0)
color = PERF_COLOR_GREEN;
else if (ratio > 5.0)
color = PERF_COLOR_YELLOW;

printed += color_fprintf(fp, color, " %s (%d), ", thread__comm_str(thread), thread->tid);
printed += fprintf(fp, " %s (%d), ", thread__comm_str(thread), thread->tid);
printed += fprintf(fp, "%lu events, ", ttrace->nr_events);
printed += color_fprintf(fp, color, "%.1f%%", ratio);
printed += fprintf(fp, "%.1f%%", ratio);
printed += fprintf(fp, ", %.3f msec\n", ttrace->runtime_ms);
printed += thread__dump_stats(ttrace, trace, fp);

Expand Down

0 comments on commit 15e65c6

Please sign in to comment.