Skip to content

Commit 40c2189

Browse files
iproninacmel
authored andcommitted
perf stat: Fix CVS output format for non-supported counters
When printing stats in CSV mode, 'perf stat' appends extra separators when a counter is not supported: <not supported>,,L1-dcache-store-misses,mesos/bd442f34-2b4a-47df-b966-9b281f9f56fc,0,100.00,,,, Which causes a failure when parsing fields. The numbers of separators should be the same for each line, no matter if the counter is or not supported. Signed-off-by: Ilya Pronin <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Andi Kleen <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Fixes: 92a61f6 ("perf stat: Implement CSV metrics output") Signed-off-by: Cong Wang <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 4caea05 commit 40c2189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static void print_metric_csv(void *ctx,
917917
char buf[64], *vals, *ends;
918918

919919
if (unit == NULL || fmt == NULL) {
920-
fprintf(out, "%s%s%s%s", csv_sep, csv_sep, csv_sep, csv_sep);
920+
fprintf(out, "%s%s", csv_sep, csv_sep);
921921
return;
922922
}
923923
snprintf(buf, sizeof(buf), fmt, val);

0 commit comments

Comments
 (0)