]> git.baikalelectronics.ru Git - kernel.git/commit
perf stat: Abstract stat metrics printing
authorAndi Kleen <ak@linux.intel.com>
Sat, 30 Jan 2016 17:06:49 +0000 (09:06 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 16 Feb 2016 20:13:00 +0000 (17:13 -0300)
commit402501fd5a89654456084b5a2f81a7310b2b7a59
tree69deb9bca1b23bc1c4640ee7f30ea005f956687f
parent0748913267c3554c91aa209db5c78da10033299e
perf stat: Abstract stat metrics printing

Abstract the printing of shadow metrics. Instead of every metric calling
fprintf directly and taking care of indentation, use two call backs: one
to print metrics and another to start a new line.

This will allow adding metrics to CSV mode and also using them for other
purposes.

The computation of padding is now done in the central callback, instead
of every metric doing it manually.  This makes it easier to add new
metrics.

v2: Refactor functions, printout now does more. Move
shadow printing. Improve fallback callbacks. Don't
use void * callback data.
v3: Remove unnecessary hunk. Add typedef for new_line
v4: Remove unnecessary hunk. Don't print metrics for CSV/interval
mode yet.  Move printout change to separate patch.
v5: Fix bisect bugs. Avoid bogus frontend cycles printing.
Fix indentation in different aggregation modes.
v6: Delay newline handling

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1454173616-17710-2-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c
tools/perf/util/stat-shadow.c
tools/perf/util/stat.h