perf test: Make 'list' subcommand match main 'perf test' numbering/matching

Before:

  # perf test Synth
  39: Synthesize thread map  : Ok
  41: Synthesize cpu map     : Ok
  42: Synthesize stat config : Ok
  43: Synthesize stat        : Ok
  44: Synthesize stat round  : Ok
  45: Synthesize attr update : Ok
  #
  # perf test list Synth
   1: Synthesize thread map
   2: Synthesize cpu map
   3: Synthesize stat config
   4: Synthesize stat
   5: Synthesize stat round
   6: Synthesize attr update
  #

After:

  # perf test Synth
  39: Synthesize thread map  : Ok
  41: Synthesize cpu map     : Ok
  42: Synthesize stat config : Ok
  43: Synthesize stat        : Ok
  44: Synthesize stat round  : Ok
  45: Synthesize attr update : Ok
  #
  # perf test list Synth
  39: Synthesize thread map
  41: Synthesize cpu map
  42: Synthesize stat config
  43: Synthesize stat
  44: Synthesize stat round
  45: Synthesize attr update
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-pjhuhkphs7o3tkbqrukfv6bz@git.kernel.org
Fixes: e8210cef ("perf tests: Introduce iterator function for tests")
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c295036b
...@@ -465,10 +465,12 @@ static int perf_test__list(int argc, const char **argv) ...@@ -465,10 +465,12 @@ static int perf_test__list(int argc, const char **argv)
int i = 0; int i = 0;
for_each_test(j, t) { for_each_test(j, t) {
++i;
if (argc > 1 && !strstr(t->desc, argv[1])) if (argc > 1 && !strstr(t->desc, argv[1]))
continue; continue;
pr_info("%2d: %s\n", ++i, t->desc); pr_info("%2d: %s\n", i, t->desc);
} }
return 0; return 0;
......
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