• Ingo Molnar's avatar
    perf bench: Change the procps visible command-name of invididual benchmark tests plus cleanups · 4157922a
    Ingo Molnar authored
    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: default avatarIngo Molnar <mingo@kernel.org>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Hitoshi Mitake <h.mitake@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung.kim@lge.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20131023123756.GA17871@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    4157922a
builtin-bench.c 5.96 KB