benchmarks: add unixbench

Add a recipe for UnixBench, a benchmark suite used to measure
CPU, memory, and overall system performance.

The recipe has been successfully built and validated on
aarch64 targets. Functional testing confirmed that the
benchmark suite executes correctly and generates results.

Signed-off-by: Vaibhav Jindal <vaibjind@qti.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Vaibhav Jindal
2026-07-30 18:19:06 +05:30
committed by Khem Raj
parent 8b20981f42
commit 322cac79ac
3 changed files with 98 additions and 0 deletions
@@ -0,0 +1,32 @@
From: Vaibhav Jindal <vaibjind@qti.qualcomm.com>
Date: Mon, 1 Jan 2024 00:00:00 +0000
Subject: [PATCH] Skip make checks for prebuilt Yocto package
The UnixBench Run script expects a source tree and invokes
'make check' and 'make all'. In Yocto, binaries are prebuilt
during do_compile() and only runtime artifacts are installed.
Skip the build verification step.
Upstream-Status: Inappropriate [cross-compilation]
diff --git a/UnixBench/Run b/UnixBench/Run
index 898eb5c..fb24263 100755
--- a/UnixBench/Run
+++ b/UnixBench/Run
@@ -1037,16 +1037,6 @@ sub preChecks {
# Set the language.
$ENV{'LANG'} = $language;
- # Check that the required files are in the proper places.
- my $make = $ENV{MAKE} || "make";
- system("$make check");
- if ($? != 0) {
- system("$make all");
- if ($? != 0) {
- abortRun("\"$make all\" failed");
- }
- }
-
# Create a script to kill this run.
system("echo \"kill -9 $$\" > \"${TMPDIR}/kill_run\"");
chmod(0755, $TMPDIR . "/kill_run");
@@ -0,0 +1,65 @@
SUMMARY = "BYTE UNIX Benchmark Suite"
DESCRIPTION = "UnixBench is the original BYTE UNIX benchmark suite that provides a basic indicator of the performance of a Unix-like system. It includes tests for CPU, memory, I/O, and graphics performance."
HOMEPAGE = "https://github.com/kdlucas/byte-unixbench"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = " \
git://github.com/kdlucas/byte-unixbench.git;protocol=https;nobranch=1 \
file://0001-skip-make-checks.patch \
"
SRCREV = "e949d4402f76b4bc9b7b114418faace882f0ef12"
do_configure[noexec] = "1"
RDEPENDS:${PN} += " \
perl \
perl-modules \
"
INSANE_SKIP:${PN} = "ldflags"
do_compile() {
oe_runmake -C ${S}/UnixBench \
CC="${CC}" \
AS="${AS}" \
AR="${AR}" \
LD="${CC}" \
UB_GCC_OPTIONS="${CFLAGS}" \
LDFLAGS="${LDFLAGS} -lm" \
all
}
do_install() {
# Install UnixBench under datadir to preserve directory structure
install -d ${D}${datadir}/unixbench/pgms
install -d ${D}${datadir}/unixbench/testdir
install -d ${D}${datadir}/unixbench/results
install -d ${D}${datadir}/unixbench/tmp
# Install UnixBench binaries under pgms/ directory
for binary in arithoh register short int long float double hanoi syscall context1 pipe spawn execl dhry2 dhry2reg looper fstime whetstone-double; do
if [ -f ${S}/UnixBench/pgms/${binary} ]; then
install -m 0755 ${S}/UnixBench/pgms/${binary} ${D}${datadir}/unixbench/pgms/${binary}
fi
done
# Install Run script
install -m 0755 ${S}/UnixBench/Run ${D}${datadir}/unixbench/Run
# Install test scripts
install -m 0755 ${S}/UnixBench/pgms/multi.sh ${D}${datadir}/unixbench/pgms/
install -m 0755 ${S}/UnixBench/pgms/tst.sh ${D}${datadir}/unixbench/pgms/
install -m 0644 ${S}/UnixBench/pgms/index.base ${D}${datadir}/unixbench/pgms/
install -m 0644 ${S}/UnixBench/pgms/unixbench.logo ${D}${datadir}/unixbench/pgms/
# Install test data files
install -m 0644 ${S}/UnixBench/testdir/sort.src ${D}${datadir}/unixbench/testdir/
install -m 0644 ${S}/UnixBench/testdir/cctest.c ${D}${datadir}/unixbench/testdir/
install -m 0644 ${S}/UnixBench/testdir/dc.dat ${D}${datadir}/unixbench/testdir/
install -m 0644 ${S}/UnixBench/testdir/large.txt ${D}${datadir}/unixbench/testdir/
}
FILES:${PN} += " \
${datadir}/unixbench \
"
@@ -78,6 +78,7 @@ RDEPENDS:packagegroup-meta-oe-benchmarks = "\
stressapptest \
tinymembench \
tiobench \
unixbench \
whetstone \
wrk \
wrk2 \