'\" t .\" Title: perf-bench .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-04-24 .\" Manual: perf Manual .\" Source: perf .\" Language: English .\" .TH "PERF\-BENCH" "1" "2024-04-24" "perf" "perf Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" perf-bench \- General framework for benchmark suites .SH "SYNOPSIS" .sp .nf \fIperf bench\fP [] [] .fi .br .SH "DESCRIPTION" .sp This \fIperf bench\fP command is a general framework for benchmark suites. .SH "COMMON OPTIONS" .sp \-r, \-\-repeat= .RS 4 Specify number of times to repeat the run (default 10). .RE .sp \-f, \-\-format= .RS 4 Specify format style. Current available format styles are: .RE .sp \fIdefault\fP .RS 4 Default style. This is mainly for human reading. .RE .sp .if n .RS 4 .nf .fam C % perf bench sched pipe # with no style specified (executing 1000000 pipe operations between two tasks) Total time:5.855 sec 5.855061 usecs/op 170792 ops/sec .fam .fi .if n .RE .sp \fIsimple\fP .RS 4 This simple style is friendly for automated processing by scripts. .RE .sp .if n .RS 4 .nf .fam C % perf bench \-\-format=simple sched pipe # specified simple 5.988 .fam .fi .if n .RE .SH "SUBSYSTEM" .sp \fIsched\fP .RS 4 Scheduler and IPC mechanisms. .RE .sp \fIsyscall\fP .RS 4 System call performance (throughput). .RE .sp \fImem\fP .RS 4 Memory access performance. .RE .sp \fInuma\fP .RS 4 NUMA scheduling and MM benchmarks. .RE .sp \fIfutex\fP .RS 4 Futex stressing benchmarks. .RE .sp \fIepoll\fP .RS 4 Eventpoll (epoll) stressing benchmarks. .RE .sp \fIinternals\fP .RS 4 Benchmark internal perf functionality. .RE .sp \fIuprobe\fP .RS 4 Benchmark overhead of uprobe + BPF. .RE .sp \fIall\fP .RS 4 All benchmark subsystems. .RE .SS "SUITES FOR \fIsched\fP" .sp \fBmessaging\fP .RS 4 Suite for evaluating performance of scheduler and IPC mechanisms. Based on hackbench by Rusty Russell. .RE .SS "Options of \fBmessaging\fP" .sp \-p, \-\-pipe .RS 4 Use pipe() instead of socketpair() .RE .sp \-t, \-\-thread .RS 4 Be multi thread instead of multi process .RE .sp \-g, \-\-group= .RS 4 Specify number of groups .RE .sp \-l, \-\-nr_loops= .RS 4 Specify number of loops .RE .SS "Example of \fBmessaging\fP" .sp .if n .RS 4 .nf .fam C % perf bench sched messaging # run with default options (20 sender and receiver processes per group) (10 groups == 400 processes run) Total time:0.308 sec % perf bench sched messaging \-t \-g 20 # be multi\-thread, with 20 groups (20 sender and receiver threads per group) (20 groups == 800 threads run) Total time:0.582 sec .fam .fi .if n .RE .sp \fBpipe\fP .RS 4 Suite for pipe() system call. Based on pipe\-test\-1m.c by Ingo Molnar. .RE .SS "Options of \fBpipe\fP" .sp \-l, \-\-loop= .RS 4 Specify number of loops. .RE .sp \-G, \-\-cgroups= .RS 4 Names of cgroups for sender and receiver, separated by a comma. This is useful to check cgroup context switching overhead. Note that perf doesn\(cqt create nor delete the cgroups, so users should make sure that the cgroups exist and are accessible before use. .RE .SS "Example of \fBpipe\fP" .sp .if n .RS 4 .nf .fam C % perf bench sched pipe (executing 1000000 pipe operations between two tasks) Total time:8.091 sec 8.091833 usecs/op 123581 ops/sec % perf bench sched pipe \-l 1000 # loop 1000 (executing 1000 pipe operations between two tasks) Total time:0.016 sec 16.948000 usecs/op 59004 ops/sec % perf bench sched pipe \-G AAA,BBB (executing 1000000 pipe operations between cgroups) # Running \*(Aqsched/pipe\*(Aq benchmark: # Executed 1000000 pipe operations between two processes Total time: 6.886 [sec] 6.886208 usecs/op 145217 ops/sec .fam .fi .if n .RE .sp SUITES FOR \fIsyscall\fP ~~~~~~ \fBbasic\fP:: Suite for evaluating performance of core system call throughput (both usecs/op and ops/sec metrics). This uses a single thread simply doing getppid(2), which is a simple syscall where the result is not cached by glibc. .SS "SUITES FOR \fImem\fP" .sp \fBmemcpy\fP .RS 4 Suite for evaluating performance of simple memory copy in various ways. .RE .SS "Options of \fBmemcpy\fP" .sp \-l, \-\-size .RS 4 Specify size of memory to copy (default: 1MB). Available units are B, KB, MB, GB and TB (case insensitive). .RE .sp \-f, \-\-function .RS 4 Specify function to copy (default: default). Available functions are depend on the architecture. On x86\-64, x86\-64\-unrolled, x86\-64\-movsq and x86\-64\-movsb are supported. .RE .sp \-l, \-\-nr_loops .RS 4 Repeat memcpy invocation this number of times. .RE .sp \-c, \-\-cycles .RS 4 Use perf\(cqs cpu\-cycles event instead of gettimeofday syscall. .RE .sp \fBmemset\fP .RS 4 Suite for evaluating performance of simple memory set in various ways. .RE .SS "Options of \fBmemset\fP" .sp \-l, \-\-size .RS 4 Specify size of memory to set (default: 1MB). Available units are B, KB, MB, GB and TB (case insensitive). .RE .sp \-f, \-\-function .RS 4 Specify function to set (default: default). Available functions are depend on the architecture. On x86\-64, x86\-64\-unrolled, x86\-64\-stosq and x86\-64\-stosb are supported. .RE .sp \-l, \-\-nr_loops .RS 4 Repeat memset invocation this number of times. .RE .sp \-c, \-\-cycles .RS 4 Use perf\(cqs cpu\-cycles event instead of gettimeofday syscall. .RE .SS "SUITES FOR \fInuma\fP" .sp \fBmem\fP .RS 4 Suite for evaluating NUMA workloads. .RE .SS "SUITES FOR \fIfutex\fP" .sp \fBhash\fP .RS 4 Suite for evaluating hash tables. .RE .sp \fBwake\fP .RS 4 Suite for evaluating wake calls. .RE .sp \fBwake\-parallel\fP .RS 4 Suite for evaluating parallel wake calls. .RE .sp \fBrequeue\fP .RS 4 Suite for evaluating requeue calls. .RE .sp \fBlock\-pi\fP .RS 4 Suite for evaluating futex lock_pi calls. .RE .SS "SUITES FOR \fIepoll\fP" .sp \fBwait\fP .RS 4 Suite for evaluating concurrent epoll_wait calls. .RE .sp \fBctl\fP .RS 4 Suite for evaluating multiple epoll_ctl calls. .RE .SS "SUITES FOR \fIinternals\fP" .sp \fBsynthesize\fP .RS 4 Suite for evaluating perf\(cqs event synthesis performance. .RE .SH "SEE ALSO" .sp perf(1)