perf list: Do not print 'Metric Groups:' unnecessarily
authorNamhyung Kim <namhyung@kernel.org>
Wed, 9 Sep 2020 05:58:48 +0000 (14:58 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Sep 2020 14:12:10 +0000 (11:12 -0300)
commitfac49a3bc4030524c155d9d59f3d7d14e771fe6f
treeb49ef76e0bc34200868c46aa33c5c8354000131a
parent9f86d641ba2052f78a90016f000e691357d17947
perf list: Do not print 'Metric Groups:' unnecessarily

It was printed unconditionally even if nothing is printed.
Check if the output list empty when filter is given.

Before:
  $ ./perf list duration

  List of pre-defined events (to be used in -e):

    duration_time                                      [Tool event]

  Metric Groups:

After:
  $ ./perf list duration

  List of pre-defined events (to be used in -e):

    duration_time                                      [Tool event]

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200909055849.469612-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c