From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/3] perf tools metric: Don't include duration_time in group
Date: Fri, 28 Jun 2019 15:07:37 -0700 [thread overview]
Message-ID: <20190628220737.13259-3-andi@firstfloor.org> (raw)
In-Reply-To: <20190628220737.13259-1-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
The Memory_BW metric generates groups including duration_time,
which maps to a software event.
For some reason this makes the group always not count.
Always put duration_time outside a group when generating metrics.
It's always the same time, so no need to group it.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/metricgroup.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 1c85c9624c58..17ec05e17e7b 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -410,6 +410,7 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,
const char **ids;
int idnum;
struct egroup *eg;
+ bool no_group = false;
pr_debug("metric expr %s for %s\n", pe->metric_expr, pe->metric_name);
@@ -420,11 +421,25 @@ static int metricgroup__add_metric(const char *metric, struct strbuf *events,
strbuf_addf(events, ",");
for (j = 0; j < idnum; j++) {
pr_debug("found event %s\n", ids[j]);
+ /*
+ * Duration time maps to a software event and can make
+ * groups not count. Always use it outside a
+ * group.
+ */
+ if (!strcmp(ids[j], "duration_time")) {
+ if (j > 0)
+ strbuf_addf(events, "}:W,");
+ strbuf_addf(events, "duration_time");
+ no_group = true;
+ continue;
+ }
strbuf_addf(events, "%s%s",
- j == 0 ? "{" : ",",
+ j == 0 || no_group ? "{" : ",",
ids[j]);
+ no_group = false;
}
- strbuf_addf(events, "}:W");
+ if (!no_group)
+ strbuf_addf(events, "}:W");
eg = malloc(sizeof(struct egroup));
if (!eg) {
--
2.20.1
next prev parent reply other threads:[~2019-06-28 22:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-28 22:07 [PATCH 1/3] perf vendor events intel: Metric fixes for SKX/CLX Andi Kleen
2019-06-28 22:07 ` [PATCH 2/3] perf list: Avoid extra : for --raw metrics Andi Kleen
2019-07-03 14:42 ` [tip:perf/core] " tip-bot for Andi Kleen
2019-06-28 22:07 ` Andi Kleen [this message]
2019-07-03 14:43 ` [tip:perf/core] perf tools metric: Don't include duration_time in group tip-bot for Andi Kleen
2019-07-02 15:58 ` [PATCH 1/3] perf vendor events intel: Metric fixes for SKX/CLX Arnaldo Carvalho de Melo
2019-07-03 14:41 ` [tip:perf/core] " tip-bot for Andi Kleen
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=20190628220737.13259-3-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®