diff --git a/benchmarks/libcpucycles/Makefile b/benchmarks/libcpucycles/Makefile index 77f506393ed5..c10e707747bf 100644 --- a/benchmarks/libcpucycles/Makefile +++ b/benchmarks/libcpucycles/Makefile @@ -1,39 +1,31 @@ PORTNAME= libcpucycles -DISTVERSION= 20250925 +DISTVERSION= 20251226 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/ +post-install: + ${MV} ${STAGEDIR}${PREFIX}/man/man1/* ${STAGEDIR}${PREFIX}/share/man/man1/ + ${MV} ${STAGEDIR}${PREFIX}/man/man3/* ${STAGEDIR}${PREFIX}/share/man/man3/ + ${RMDIR} ${STAGEDIR}${PREFIX}/man/man? ${STAGEDIR}${PREFIX}/man 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 index 2f5c126dde9d..4b7cb6a5ef40 100644 --- a/benchmarks/libcpucycles/distinfo +++ b/benchmarks/libcpucycles/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1758883194 -SHA256 (libcpucycles-20250925.tar.gz) = 62313d42ad5a3cbd8d41a9fb7088edc328ef499d426e1f191612331d0fcbe301 -SIZE (libcpucycles-20250925.tar.gz) = 48447 +TIMESTAMP = 1766776193 +SHA256 (libcpucycles-20251226.tar.gz) = 5dc17b801b9b27f3861aab0e1754285b1703bffe9b8f469dc666de6d9be2f93f +SIZE (libcpucycles-20251226.tar.gz) = 55008 diff --git a/benchmarks/libcpucycles/files/patch-cpucycles_wrapper.c b/benchmarks/libcpucycles/files/patch-cpucycles_wrapper.c index 703b4a0763c3..2a786d59da21 100644 --- a/benchmarks/libcpucycles/files/patch-cpucycles_wrapper.c +++ b/benchmarks/libcpucycles/files/patch-cpucycles_wrapper.c @@ -1,54 +1,45 @@ ---- cpucycles/wrapper.c.orig 2024-03-18 00:15:33 UTC +--- cpucycles/wrapper.c.orig 2025-12-26 09:44:50 UTC +++ cpucycles/wrapper.c -@@ -16,6 +16,12 @@ +@@ -18,6 +18,12 @@ #include #include #include + +#ifdef __FreeBSD__ +#include +#include +#endif + #include "cpucycles.h" #include "cpucycles_internal.h" -@@ -26,7 +32,7 @@ void cpucycles_tracesetup(void) - tracesetup = 1; - } - --static jmp_buf crash_jmp; -+static sigjmp_buf crash_jmp; - - static void crash(int s) - { -@@ -81,6 +87,21 @@ static double osfreq(void) +@@ -83,6 +89,21 @@ static double osfreq(void) if (s > 0) return result; } +#ifdef __FreeBSD__ + { + int freq; + size_t len = sizeof freq; + char *freqctl; + + if (asprintf(&freqctl, "dev.cpu.%d.freq", sched_getcpu())) { + if (sysctlbyname(freqctl, &freq, &len, NULL, 0) == 0) { + free(freqctl); + return 1e6 * freq; + } else + free(freqctl); + } + } +#else f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed", "r"); if (f) { s = fscanf(f,"%lf",&result); -@@ -163,6 +184,7 @@ static double osfreq(void) +@@ -165,6 +186,7 @@ static double osfreq(void) pclose(f); if (result) return 1000000.0 * result; } +#endif /* defined(__FreeBSD__) */ x = getenv("cpucyclespersecond"); if (x) { diff --git a/benchmarks/libcpucycles/pkg-plist b/benchmarks/libcpucycles/pkg-plist index 8c9c0b661f23..7a5fc83cb36d 100644 --- a/benchmarks/libcpucycles/pkg-plist +++ b/benchmarks/libcpucycles/pkg-plist @@ -1,7 +1,9 @@ bin/cpucycles-info +bin/cpucycles-open include/cpucycles.h lib/libcpucycles.a lib/libcpucycles.so lib/libcpucycles.so.1 share/man/man1/cpucycles-info.1.gz +share/man/man1/cpucycles-open.1.gz share/man/man3/cpucycles.3.gz