• Ingo Molnar's avatar
    perf bench sched: Add --threaded option · a9faa0ca
    Ingo Molnar authored
    Allow the measurement of thread versus process context switch
    performance.
    
    The default stays at 'process' based measurement, like lmbench's lat_ctx
    benchmark.
    
    Sample output:
    
     comet:~/tip/tools/perf> taskset 1 ./perf bench sched pipe
     # Running sched/pipe benchmark...
     # Executed 1000000 pipe operations between two processes
    
         Total time: 4.138 [sec]
    
           4.138729 usecs/op
             241620 ops/sec
     comet:~/tip/tools/perf> taskset 1 ./perf bench sched pipe --threaded
     # Running sched/pipe benchmark...
     # Executed 1000000 pipe operations between two threads
    
         Total time: 3.667 [sec]
    
           3.667667 usecs/op
             272652 ops/sec
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Namhyung Kim <namhyung.kim@lge.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
    Link: http://lkml.kernel.org/r/20130917114256.GA31159@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    a9faa0ca
sched-pipe.c 3.84 KB