Davidlohr Bueso
60758d6668
perf bench futex: Sanitize numeric parameters
...
This gets rid of oddities such as:
perf bench futex hash -t -4
perf: calloc: Cannot allocate memory
Runtime (and many more) are equally busted, i.e. run for bogus amounts of
time. Just use the abs, instead of, for example errorring out.
Committer note:
After the patch:
$ perf bench futex hash -t -4
# Running 'futex/hash' benchmark:
Run summary [PID 10178]: 4 threads, each operating on 1024 [private] futexes for 10 secs.
[thread 0] futexes: 0x34f9fa0 ... 0x34faf9c [ 4702208 ops/sec ]
[thread 1] futexes: 0x34fb140 ... 0x34fc13c [ 4707020 ops/sec ]
[thread 2] futexes: 0x34fc2e0 ... 0x34fd2dc [ 4711526 ops/sec ]
[thread 3] futexes: 0x34fd480 ... 0x34fe47c [ 4709683 ops/sec ]
Averaged 4707609 operations/sec (+- 0.04%), total secs = 10
$
Signed-off-by: Davidlohr Bueso <dbueso@suse.de >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Link: http://lkml.kernel.org/r/1477342613-9938-3-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-10-25 09:50:53 -03:00
Arnaldo Carvalho de Melo
565e69114e
perf bench futex: Use NSEC_PER_USEC
...
Following kernel practices and better documentin
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-xncwqxegjp13g2nxih3lp9mx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-08-23 15:37:33 -03:00
Arnaldo Carvalho de Melo
86695f59c9
perf bench futex: Add missing compiler.h header
...
Since these files use __maybe_unused, and that is defined in
linux/compiler.h, include it.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Davidlohr Bueso <dbueso@suse.de >
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-1llbf59ut6xon6ti88jm0n9j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-07-12 15:20:30 -03:00
Arnaldo Carvalho de Melo
9c304f6c71
perf bench: Disentangle headers
...
We should try avoiding that perf.h header, it includes way too much
stuff, making it difficult to use things like setting _GNU_SOURCE only
on a small set of headers.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Davidlohr Bueso <dbueso@suse.de >
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-lb6eg9w1kzrwhv0gm3ho0h54@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-07-12 15:19:54 -03:00
Arnaldo Carvalho de Melo
8a15858904
perf bench: Add missing pthread.h include for CPU_*() macros
...
Cc: David Ahern <dsahern@gmail.com >
Cc: Davidlohr Bueso <dbueso@suse.de >
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-48qbfv7tqs8n8ey74lbyfjtq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-07-12 15:19:52 -03:00
Josh Poimboeuf
4b6ab94eab
perf subcmd: Create subcmd library
...
Move the subcommand-related files from perf to a new library named
libsubcmd.a.
Since we're moving files anyway, go ahead and rename 'exec_cmd.*' to
'exec-cmd.*' to be consistent with the naming of all the other files.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/c0a838d4c878ab17fee50998811612b2281355c1.1450193761.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-12-17 14:27:14 -03:00
Davidlohr Bueso
598adc5c9c
perf bench futex: Handle spurious wakeups
...
Wrap futex_wait around a loop and catch for EINTR.
Either a spurious wakeup occurred or a signal interrupted is, either way
we need to block again.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de >
Cc: Davidlohr Bueso <dbueso@suse.de >
Link: http://lkml.kernel.org/r/1431110280-20231-2-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-05-08 16:24:02 -03:00
Davidlohr Bueso
86c87e13f8
perf bench futex: Support operations for shared futexes
...
Unlike futex-hash, requeuing and wakeup benchmarks do not support shared
futexes, limiting the usefulness of the programs. Correct this, and
allow using the local -S parameter. The default remains using private
futexes.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de >
Cc: Davidlohr Bueso <dbueso@suse.de >
Link: http://lkml.kernel.org/r/1412008868-22328-1-git-send-email-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-09-29 15:43:21 -03:00
Davidlohr Bueso
d9de84afd1
perf bench futex: Use global --repeat option
...
This option is available through perf-bench, use it instead and free the
local option.
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com >
Cc: Aswin Chandramouleeswaran <aswin@hp.com >
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: http://lkml.kernel.org/r/1402942467-10671-6-git-send-email-davidlohr@hp.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-06-19 16:13:16 -03:00
Davidlohr Bueso
27db783074
perf bench: Add futex-wake microbenchmark
...
Block a bunch of threads on a futex and wake them up, N at a time.
This program is particularly useful to measure the latency of nthread
wakeups in non-error situations: all waiters are queued and all wake
calls wakeup one or more tasks.
An example run:
$ perf bench futex wake -t 512 -r 100
Run summary [PID 27823]: blocking on 512 threads (at futex 0x7e10d4), waking up 1 at a time.
[Run 1]: Wokeup 512 of 512 threads in 6.0080 ms
[Run 2]: Wokeup 512 of 512 threads in 5.2280 ms
[Run 3]: Wokeup 512 of 512 threads in 4.8300 ms
...
[Run 100]: Wokeup 512 of 512 threads in 5.0100 ms
Wokeup 512 of 512 threads in 5.0109 ms (+-2.25%)
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com >
Acked-by: Darren Hart <dvhart@linux.intel.com >
Cc: Aswin Chandramouleeswaran <aswin@hp.com >
Cc: Darren Hart <dvhart@linux.intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jason Low <jason.low2@hp.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Scott J Norton <scott.norton@hp.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Waiman Long <Waiman.Long@hp.com >
Link: http://lkml.kernel.org/r/1387081917-9102-3-git-send-email-davidlohr@hp.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-03-14 11:20:43 -03:00