From: tip-bot for Ilya Pronin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com,
ak@linux.intel.com, mingo@kernel.org, ipronin@twitter.com,
tglx@linutronix.de, xiyou.wangcong@gmail.com, jolsa@redhat.com
Subject: [tip:perf/urgent] perf stat: Fix CVS output format for non-supported counters
Date: Wed, 7 Mar 2018 00:27:33 -0800 [thread overview]
Message-ID: <tip-40c21898ba5372c14ef71717040529794a91ccc2@git.kernel.org> (raw)
In-Reply-To: <20180306064353.31930-1-xiyou.wangcong@gmail.com>
Commit-ID: 40c21898ba5372c14ef71717040529794a91ccc2
Gitweb: https://git.kernel.org/tip/40c21898ba5372c14ef71717040529794a91ccc2
Author: Ilya Pronin <ipronin@twitter.com>
AuthorDate: Mon, 5 Mar 2018 22:43:53 -0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 6 Mar 2018 10:53:52 -0300
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 <ipronin@twitter.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/20180306064353.31930-1-xiyou.wangcong@gmail.com
Fixes: 92a61f6412d3 ("perf stat: Implement CSV metrics output")
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 98bf9d32f222..54a4c152edb3 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -917,7 +917,7 @@ static void print_metric_csv(void *ctx,
char buf[64], *vals, *ends;
if (unit == NULL || fmt == NULL) {
- fprintf(out, "%s%s%s%s", csv_sep, csv_sep, csv_sep, csv_sep);
+ fprintf(out, "%s%s", csv_sep, csv_sep);
return;
}
snprintf(buf, sizeof(buf), fmt, val);
prev parent reply other threads:[~2018-03-07 8:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 6:43 [PATCH] perf stat: fix cvs output format Cong Wang
2018-03-06 7:58 ` Jiri Olsa
2018-03-06 13:54 ` Arnaldo Carvalho de Melo
2018-03-06 17:00 ` Andi Kleen
2018-03-06 17:30 ` Arnaldo Carvalho de Melo
2018-03-06 18:57 ` Andi Kleen
2018-03-06 17:47 ` Cong Wang
2018-03-06 17:53 ` Andi Kleen
2018-03-06 19:03 ` Cong Wang
2018-03-06 20:31 ` Ilya Pronin
2018-03-07 17:04 ` Andi Kleen
2018-03-08 21:52 ` Ilya Pronin
2018-03-09 0:06 ` Andi Kleen
2018-03-07 8:27 ` tip-bot for Ilya Pronin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-40c21898ba5372c14ef71717040529794a91ccc2@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=hpa@zytor.com \
--cc=ipronin@twitter.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.