diff --git a/benchmarks/Makefile b/benchmarks/Makefile index 8a7572e2a904..78b25950bdc5 100644 --- a/benchmarks/Makefile +++ b/benchmarks/Makefile @@ -1,121 +1,122 @@ COMMENT = Benchmarking tools SUBDIR += ali SUBDIR += apib SUBDIR += autobench SUBDIR += blogbench SUBDIR += bombardier SUBDIR += bonnie SUBDIR += bonnie++ SUBDIR += clpeak SUBDIR += cpipe SUBDIR += dbench SUBDIR += ddosify SUBDIR += dhrystone SUBDIR += dkftpbench SUBDIR += fhourstones SUBDIR += filebench SUBDIR += fio SUBDIR += flamegraph SUBDIR += flops SUBDIR += flowgrind SUBDIR += forkbomb SUBDIR += glmark2 SUBDIR += gtkperf SUBDIR += hey SUBDIR += himenobench SUBDIR += hipercontracer SUBDIR += hpl SUBDIR += httperf SUBDIR += hyperfine SUBDIR += imb SUBDIR += inferno SUBDIR += interbench SUBDIR += ior SUBDIR += iorate SUBDIR += iozone SUBDIR += ipc-bench SUBDIR += iperf SUBDIR += iperf3 SUBDIR += kdiskmark SUBDIR += libcelero + SUBDIR += libcpucycles SUBDIR += libmicro SUBDIR += linux-gputest SUBDIR += linux-unigine-heaven SUBDIR += linux-unigine-sanctuary SUBDIR += linux-unigine-superposition SUBDIR += linux-unigine-tropics SUBDIR += linux-unigine-valley SUBDIR += linux-vdbench SUBDIR += lmbench SUBDIR += lzbench SUBDIR += mangohud SUBDIR += mdtest SUBDIR += mst-bench SUBDIR += nbench SUBDIR += netio SUBDIR += netperf SUBDIR += netperfmeter SUBDIR += nosqlbench SUBDIR += nqueens SUBDIR += nttcp SUBDIR += nuttcp SUBDIR += octave-forge-benchmark SUBDIR += p5-Benchmark-Forking SUBDIR += p5-Benchmark-Stopwatch SUBDIR += p5-Dumbbench SUBDIR += pathchirp SUBDIR += pathload SUBDIR += pathrate SUBDIR += pear-Benchmark SUBDIR += perftest SUBDIR += phoronix-test-suite SUBDIR += pipebench SUBDIR += plow SUBDIR += polygraph SUBDIR += postal SUBDIR += postmark SUBDIR += py-asv SUBDIR += py-asv-runner SUBDIR += py-locust SUBDIR += py-naarad SUBDIR += py-throughpy SUBDIR += py-zopkio SUBDIR += raidtest SUBDIR += randomio SUBDIR += rubygem-benchmark SUBDIR += rubygem-benchmark-ips SUBDIR += rubygem-benchmark-memory SUBDIR += rubygem-derailed_benchmarks SUBDIR += rubygem-gitlab-derailed_benchmarks SUBDIR += rubygem-railsbench SUBDIR += scimark2 SUBDIR += scimark2c SUBDIR += scimark4c SUBDIR += shellbench SUBDIR += siege SUBDIR += sipp SUBDIR += slowloris SUBDIR += smhasher SUBDIR += spp SUBDIR += stream SUBDIR += stress-ng SUBDIR += sysbench SUBDIR += tcpblast SUBDIR += thrulay SUBDIR += tinymembench SUBDIR += tsung SUBDIR += ttcp SUBDIR += typometer SUBDIR += ubench SUBDIR += uica SUBDIR += unixbench SUBDIR += uperf SUBDIR += vegeta SUBDIR += vkmark SUBDIR += vkoverhead SUBDIR += vkpeak SUBDIR += webbench SUBDIR += wrk .include diff --git a/benchmarks/libcpucycles/Makefile b/benchmarks/libcpucycles/Makefile new file mode 100644 index 000000000000..d2180fd16f91 --- /dev/null +++ b/benchmarks/libcpucycles/Makefile @@ -0,0 +1,39 @@ +PORTNAME= libcpucycles +DISTVERSION= 20240318 +CATEGORIES= benchmarks devel +MASTER_SITES= https://cpucycles.cr.yp.to/ + +MAINTAINER= fuz@FreeBSD.org +COMMENT= Microlibrary for counting CPU cycles +WWW= https://cpucycles.cr.yp.to/ + +LICENSE= PD + +USES= python:build shebangfix +USE_LDCONFIG= yes +SHEBANG_FILES= configure scripts-build/* +HAS_CONFIGURE= yes +CONFIGURE_ARGS= --host=${ARCH} +ALL_TARGET= default +CFLAGS+= -fPIC -fwrapv -fvisibility=hidden + +_STAGE= ${WRKSRC}/build/0/package + +pre-configure: + ${ECHO} ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} >${WRKSRC}/compilers/default + +# no staging support for some reason +do-install: + ${INSTALL_MAN} ${_STAGE}/man/man1/cpucycles-info.1 ${STAGEDIR}${PREFIX}/share/man/man1/ + ${INSTALL_MAN} ${_STAGE}/man/man3/cpucycles.3 ${STAGEDIR}${PREFIX}/share/man/man3/ + ${INSTALL_DATA} ${_STAGE}/include/cpucycles.h ${STAGEDIR}${PREFIX}/include/ + for lib in ${_STAGE}/lib/libcpucycles* ; \ + do \ + ${INSTALL_LIB} $$lib ${STAGEDIR}${PREFIX}/lib/ ; \ + done + ${INSTALL_PROGRAM} ${_STAGE}/bin/cpucycles-info ${STAGEDIR}${PREFIX}/bin/ + +do-test: + ${SETENVI} LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib ${STAGEDIR}${PREFIX}/bin/cpucycles-info + +.include diff --git a/benchmarks/libcpucycles/distinfo b/benchmarks/libcpucycles/distinfo new file mode 100644 index 000000000000..7d9974242ff7 --- /dev/null +++ b/benchmarks/libcpucycles/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1730224174 +SHA256 (libcpucycles-20240318.tar.gz) = 19646a1b69d8f013647313fcedf15b6a89327a4b7ce553536d513f1f6e54d32d +SIZE (libcpucycles-20240318.tar.gz) = 42790 diff --git a/benchmarks/libcpucycles/pkg-descr b/benchmarks/libcpucycles/pkg-descr new file mode 100644 index 000000000000..ec932913c336 --- /dev/null +++ b/benchmarks/libcpucycles/pkg-descr @@ -0,0 +1,20 @@ +libcpucycles is a microlibrary for counting CPU cycles. Cycle counts +are not as detailed as Falk diagrams but are the most precise timers +available to typical software; they are central tools used in +understanding and improving software performance. + +The libcpucycles API is simple: include , call cpucycles() +to receive a long long whenever desired, and link with -lcpucycles. + +Internally, libcpucycles understands machine-level cycle counters for +amd64 (both PMC and TSC), arm32, arm64 (both PMC and VCT), mips64, +ppc32, ppc64, riscv32, riscv64, s390x, sparc64, and x86. libcpucycles +also understands four OS-level mechanisms, which give varying levels of +accuracy: mach_absolute_time, perf_event, CLOCK_MONOTONIC, and, as a +fallback, microsecond-resolution gettimeofday. + +When the program first calls cpucycles(), libcpucycles automatically +benchmarks the available mechanisms and selects the mechanism that does +the best job. Subsequent cpucycles() calls are thread-safe and very +fast. An accompanying cpucycles-info program prints a summary of +cycle-counter accuracy. diff --git a/benchmarks/libcpucycles/pkg-plist b/benchmarks/libcpucycles/pkg-plist new file mode 100644 index 000000000000..8c9c0b661f23 --- /dev/null +++ b/benchmarks/libcpucycles/pkg-plist @@ -0,0 +1,7 @@ +bin/cpucycles-info +include/cpucycles.h +lib/libcpucycles.a +lib/libcpucycles.so +lib/libcpucycles.so.1 +share/man/man1/cpucycles-info.1.gz +share/man/man3/cpucycles.3.gz