perf metricgroup: Use strsep()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Jun 2019 14:21:47 +0000 (11:21 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Jun 2019 14:31:43 +0000 (11:31 -0300)
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@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-f2siadtp3hb5o0l1w7bvd8bk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c

index a0cf3cd95cedfc57a5746a32cf9768822a3b7e2d..90cd84e2a503c7b54490558e29cdfdfbeeb35e15 100644 (file)
@@ -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)