[PATCH 29/43] perf metricgroup: Use strsep()

From: Arnaldo Carvalho de Melo
Date: Mon Jul 01 2019 - 22:28:01 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

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 <adrian.hunter@xxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: https://lkml.kernel.org/n/tip-f2siadtp3hb5o0l1w7bvd8bk@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/metricgroup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index a0cf3cd95ced..90cd84e2a503 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)
--
2.20.1