Commit e2ce1059 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf metricgroup: Remove unnecessary ',' from events

Remove unnecessary commas from events before they are parsed. This
avoids ',' being echoed by parse-events.l.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Kim Phillips <kim.phillips@amd.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: http://lore.kernel.org/lkml/20200520182011.32236-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 05530a79
......@@ -504,9 +504,14 @@ static void metricgroup__add_metric_non_group(struct strbuf *events,
{
struct hashmap_entry *cur;
size_t bkt;
bool first = true;
hashmap__for_each_entry((&ctx->ids), cur, bkt)
strbuf_addf(events, ",%s", (const char *)cur->key);
hashmap__for_each_entry((&ctx->ids), cur, bkt) {
if (!first)
strbuf_addf(events, ",");
strbuf_addf(events, "%s", (const char *)cur->key);
first = false;
}
}
static void metricgroup___watchdog_constraint_hint(const char *name, bool foot)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment