perf bench: Change the procps visible command-name of invididual benchmark tests plus cleanups
perf bench: Change the procps visible command-name of invididual benchmark tests plus cleanups

Before this patch, looking at 'perf bench sched pipe' behavior over
'top' only told us that something related to perf is running:

      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    19934 mingo     20   0 54836 1296  952 R 18.6  0.0   0:00.56 perf
    19935 mingo     20   0 54836  384   36 S 18.6  0.0   0:00.56 perf

After the patch it's clearly visible what's going on:

      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    19744 mingo     20   0  125m 3536 2644 R 68.2  0.0   0:01.12 sched-pipe
    19745 mingo     20   0  125m 1172  276 R 68.2  0.0   0:01.12 sched-pipe

The benchmark-subsystem name is concatenated with the individual
testcase name.

Unfortunately 'perf top' does not show the reconfigured name, possibly
because it caches ->comm[] values and does not recognize changes to
them?

Also clean up a few bits in builtin-bench.c while at it and reorganize
the code and the output strings to be consistent.

Use iterators to access the various arrays. Rename 'suites' concept to
'benchmark collection' and the 'bench_suite' to 'benchmark/bench'. The
many repetitions of 'suite' made the code harder to read and understand.

The new output is:

  comet:~/tip/tools/perf> ./perf bench
  Usage:
        perf bench [<common options>] <collection> <benchmark> [<options>]

        # List of all available benchmark collections:

         sched: Scheduler and IPC benchmarks
           mem: Memory access benchmarks
          numa: NUMA scheduling and MM benchmarks
           all: All benchmarks

  comet:~/tip/tools/perf> ./perf bench sched

        # List of available benchmarks for collection 'sched':

     messaging: Benchmark for scheduling and IPC
          pipe: Benchmark for pipe() between two processes
           all: Test all scheduler benchmarks

  comet:~/tip/tools/perf> ./perf bench mem

        # List of available benchmarks for collection 'mem':

        memcpy: Benchmark for memcpy()
        memset: Benchmark for memset() tests
           all: Test all memory benchmarks

  comet:~/tip/tools/perf> ./perf bench numa

        # List of available benchmarks for collection 'numa':

           mem: Benchmark for NUMA workloads
           all: Test all NUMA benchmarks

Individual benchmark modules were not touched.

Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Cc: David Ahern <b80c1600f604d3b0d768f26f90a76757e76005dd@gmail.com>
Cc: Hitoshi Mitake <f5d714bdcbd540cbcf6bb2062e1b0243e2f5e923@gmail.com>
Cc: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>
Cc: Namhyung Kim <1b20bcb62cf1b100c528e605608922000dc2fc80@lge.com>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Link: 0df63c33ecbbd548280ef950db0b7d7f5defaf07@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs