From: Arnaldo Carvalho de Melo Date: Wed, 26 Jun 2019 14:21:47 +0000 (-0300) Subject: perf metricgroup: Use strsep() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=80e9073f1f4473639d585b89ebc9130bb47920e8;p=linux.git perf metricgroup: Use strsep() No change in behaviour intended, trivial optimization done by avoiding looking for spaces in 'g' right after setting it to "No_group". Cc: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-f2siadtp3hb5o0l1w7bvd8bk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index a0cf3cd95cedf..90cd84e2a503c 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -308,10 +308,9 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter, struct mep *me; char *s; + g = skip_spaces(g); if (*g == 0) g = "No_group"; - while (isspace(*g)) - g++; if (filter && !strstr(g, filter)) continue; if (raw)