summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-10-07 17:24:53 -0700
committerArmin Kuster <akuster808@gmail.com>2023-10-12 09:58:06 -0400
commit0eb91f152f90aa27d4e08bc121b427d4d7fc17fd (patch)
tree0cd2dab42e5958153db1a3ad743c768fa45f8ce3
parent8f6e3aab5da852ca893c8bb6cd55f80688309623 (diff)
downloadmeta-openembedded-0eb91f152f90aa27d4e08bc121b427d4d7fc17fd.tar.gz
stressapptest: Upgrade to 1.0.11 release
Drop patches already in this upstream version Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 350fd96f1e1271314855647981d0cc0ba6c155db) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest/0001-configure-Add-with-cpu.patch37
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest/0002-Replace-lfs64-functions-and-defines.patch103
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest/0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch43
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest/libcplusplus-compat.patch28
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest/read_sysfs_for_cachesize.patch72
-rw-r--r--meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.11.bb (renamed from meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.9.bb)12
6 files changed, 2 insertions, 293 deletions
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0001-configure-Add-with-cpu.patch b/meta-oe/recipes-benchmark/stressapptest/stressapptest/0001-configure-Add-with-cpu.patch
deleted file mode 100644
index 41fb456c6c..0000000000
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0001-configure-Add-with-cpu.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 73049e5a9e3698cc6d51471d70ac5e06bed803cc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Dec 2022 10:24:48 -0800
4Subject: [PATCH] configure: Add --with-cpu
5
6Some cross build systems e.g. yocto may use architectures different from cross compiler target tuple
7arm-yoe-gnueabi but build for armv7a, AC_CANONICAL_HOST will fail in
8this case even though target will be armv7a it will detect it as arm and
9disable armv7a specific optimization paths. This option provides the
10needed knob so it can be set explicitly e.g. --with-cpu=armv7a etc. if needed.
11
12Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 configure.ac | 9 ++++++++-
16 1 file changed, 8 insertions(+), 1 deletion(-)
17
18diff --git a/configure.ac b/configure.ac
19index c839c87..403728c 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -11,7 +11,14 @@ else
23 AC_MSG_NOTICE([Compiling with dynamically linked libraries.])
24 fi
25
26-AC_CANONICAL_HOST
27+AC_ARG_WITH(cpu, [ --with-cpu define host cpu])
28+
29+if test -z "$with_cpu"
30+then
31+ AC_CANONICAL_HOST
32+else
33+ host_cpu=$with_cpu
34+fi
35 # Checking for target cpu and setting custom configuration
36 # for the different platforms
37 AS_CASE(["$host_cpu"],
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0002-Replace-lfs64-functions-and-defines.patch b/meta-oe/recipes-benchmark/stressapptest/stressapptest/0002-Replace-lfs64-functions-and-defines.patch
deleted file mode 100644
index 48ff3ef93b..0000000000
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0002-Replace-lfs64-functions-and-defines.patch
+++ /dev/null
@@ -1,103 +0,0 @@
1From 9ab360fd018d267fe174713d7e14454408b26043 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Dec 2022 10:33:01 -0800
4Subject: [PATCH] Replace lfs64 functions and defines
5
6AC_SYS_LARGEFILE is already in use in configure.ac which detects
7enabling lfs64 functions as needed, it will define _FILE_OFFSET_BITS=64
8which should make lseek same as lseek64 since off_t is 64bit on most of
9current 32bit linux platforms
10
11Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/os.cc | 18 ++++++------------
15 src/worker.cc | 6 +++---
16 2 files changed, 9 insertions(+), 15 deletions(-)
17
18diff --git a/src/os.cc b/src/os.cc
19index 1928e0a..faa6068 100644
20--- a/src/os.cc
21+++ b/src/os.cc
22@@ -142,7 +142,7 @@ int OsLayer::AddressMode() {
23 uint64 OsLayer::VirtualToPhysical(void *vaddr) {
24 uint64 frame, paddr, pfnmask, pagemask;
25 int pagesize = sysconf(_SC_PAGESIZE);
26- off64_t off = ((uintptr_t)vaddr) / pagesize * 8;
27+ off_t off = ((uintptr_t)vaddr) / pagesize * 8;
28 int fd = open(kPagemapPath, O_RDONLY);
29
30 /*
31@@ -154,7 +154,7 @@ uint64 OsLayer::VirtualToPhysical(void *vaddr) {
32 if (fd < 0)
33 return 0;
34
35- if (lseek64(fd, off, SEEK_SET) != off || read(fd, &frame, 8) != 8) {
36+ if (lseek(fd, off, SEEK_SET) != off || read(fd, &frame, 8) != 8) {
37 int err = errno;
38 string errtxt = ErrorString(err);
39 logprintf(0, "Process Error: failed to access %s with errno %d (%s)\n",
40@@ -607,9 +607,9 @@ bool OsLayer::AllocateTestMem(int64 length, uint64 paddr_base) {
41 dynamic_mapped_shmem_ = true;
42 } else {
43 // Do a full mapping here otherwise.
44- shmaddr = mmap64(NULL, length, PROT_READ | PROT_WRITE,
45- MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
46- shm_object, 0);
47+ shmaddr = mmap(NULL, length, PROT_READ | PROT_WRITE,
48+ MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
49+ shm_object, 0);
50 if (shmaddr == reinterpret_cast<void*>(-1)) {
51 int err = errno;
52 string errtxt = ErrorString(err);
53@@ -704,18 +704,12 @@ void *OsLayer::PrepareTestMem(uint64 offset, uint64 length) {
54 if (dynamic_mapped_shmem_) {
55 // TODO(nsanders): Check if we can support MAP_NONBLOCK,
56 // and evaluate performance hit from not using it.
57-#ifdef HAVE_MMAP64
58- void * mapping = mmap64(NULL, length, PROT_READ | PROT_WRITE,
59- MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
60- shmid_, offset);
61-#else
62 void * mapping = mmap(NULL, length, PROT_READ | PROT_WRITE,
63 MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
64 shmid_, offset);
65-#endif
66 if (mapping == MAP_FAILED) {
67 string errtxt = ErrorString(errno);
68- logprintf(0, "Process Error: PrepareTestMem mmap64(%llx, %llx) failed. "
69+ logprintf(0, "Process Error: PrepareTestMem mmap(%llx, %llx) failed. "
70 "error: %s.\n",
71 offset, length, errtxt.c_str());
72 sat_assert(0);
73diff --git a/src/worker.cc b/src/worker.cc
74index 745a816..41e93a0 100644
75--- a/src/worker.cc
76+++ b/src/worker.cc
77@@ -1705,7 +1705,7 @@ bool FileThread::WritePages(int fd) {
78 int strict = sat_->strict();
79
80 // Start fresh at beginning of file for each batch of pages.
81- lseek64(fd, 0, SEEK_SET);
82+ lseek(fd, 0, SEEK_SET);
83 for (int i = 0; i < sat_->disk_pages(); i++) {
84 struct page_entry src;
85 if (!GetValidPage(&src))
86@@ -1943,7 +1943,7 @@ bool FileThread::ReadPages(int fd) {
87 bool result = true;
88
89 // Read our data back out of the file, into it's new location.
90- lseek64(fd, 0, SEEK_SET);
91+ lseek(fd, 0, SEEK_SET);
92 for (int i = 0; i < sat_->disk_pages(); i++) {
93 struct page_entry dst;
94 if (!GetEmptyPage(&dst))
95@@ -3153,7 +3153,7 @@ bool DiskThread::ValidateBlockOnDisk(int fd, BlockData *block) {
96
97 // Read block from disk and time the read. If it takes longer than the
98 // threshold, complain.
99- if (lseek64(fd, address * kSectorSize, SEEK_SET) == -1) {
100+ if (lseek(fd, address * kSectorSize, SEEK_SET) == -1) {
101 logprintf(0, "Process Error: Unable to seek to sector %lld in "
102 "DiskThread::ValidateSectorsOnDisk on disk %s "
103 "(thread %d).\n", address, device_name_.c_str(), thread_num_);
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch b/meta-oe/recipes-benchmark/stressapptest/stressapptest/0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch
deleted file mode 100644
index b21a534d94..0000000000
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest/0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From d64a282b57352dde5f5b007947c005e504dc9a6b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Dec 2022 10:46:31 -0800
4Subject: [PATCH] configure: Check for pthread_rwlockattr_setkind_np before use
5
6musl does not implement this therefore detect this non-posix API before
7using it
8
9Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 configure.ac | 1 +
13 src/worker.cc | 2 ++
14 2 files changed, 3 insertions(+)
15
16diff --git a/configure.ac b/configure.ac
17index 403728c..47968cb 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -157,6 +157,7 @@ AC_FUNC_STRERROR_R
21 AC_FUNC_VPRINTF
22 AC_CHECK_FUNCS([ftruncate gettimeofday memset munmap select socket strtol strtoull])
23 AC_CHECK_FUNCS([mmap64 posix_memalign rand_r sched_getaffinity])
24+AC_CHECK_FUNCS([pthread_rwlockattr_setkind_np])
25
26 AC_CONFIG_FILES([Makefile src/Makefile])
27 AC_OUTPUT
28diff --git a/src/worker.cc b/src/worker.cc
29index 41e93a0..c4abc87 100644
30--- a/src/worker.cc
31+++ b/src/worker.cc
32@@ -133,9 +133,11 @@ void WorkerStatus::Initialize() {
33
34 pthread_rwlockattr_t attrs;
35 sat_assert(0 == pthread_rwlockattr_init(&attrs));
36+#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
37 // Avoid writer lock starvation.
38 sat_assert(0 == pthread_rwlockattr_setkind_np(
39 &attrs, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP));
40+#endif
41 sat_assert(0 == pthread_rwlock_init(&status_rwlock_, &attrs));
42
43 #ifdef HAVE_PTHREAD_BARRIERS
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest/libcplusplus-compat.patch b/meta-oe/recipes-benchmark/stressapptest/stressapptest/libcplusplus-compat.patch
deleted file mode 100644
index 8754e40697..0000000000
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest/libcplusplus-compat.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1Fix compile on sytems using libc++ instead of libstdc++
2
3libc++ does not really implement __gnu_cxx namespace and it
4compiles fine without this namespace, therefore detect libc++
5and if it is used them exclude this namespace
6
7See https://github.com/stressapptest/stressapptest/issues/47
8
9Fixes
10
11./sattypes.h:33:17: error: expected namespace name
12using namespace __gnu_cxx; //NOLINT
13
14Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17--- stressapptest-1.0.9.orig/src/sattypes.h
18+++ stressapptest-1.0.9/src/sattypes.h
19@@ -30,7 +30,9 @@
20 #include "stressapptest_config_android.h" // NOLINT
21 #else
22 #include "stressapptest_config.h" // NOLINT
23+#ifndef _LIBCPP_VERSION
24 using namespace __gnu_cxx; //NOLINT
25+#endif // _LIBCPP_VERSION
26 #endif // __ANDROID__
27 using namespace std;
28
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest/read_sysfs_for_cachesize.patch b/meta-oe/recipes-benchmark/stressapptest/stressapptest/read_sysfs_for_cachesize.patch
deleted file mode 100644
index 19261657ac..0000000000
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest/read_sysfs_for_cachesize.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1sysconf params like _SC_LEVEL1_DCACHE_LINESIZE are not universally
2implemented, therefore check for them being available, if not there
3then read the sysfs directly to get the value
4
5Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7--- a/src/sat.cc
8+++ b/src/sat.cc
9@@ -1482,15 +1482,47 @@ int Sat::CpuCount() {
10 return sysconf(_SC_NPROCESSORS_CONF);
11 }
12
13+int Sat::ReadInt(const char *filename, int *value) {
14+ char line[64];
15+ int fd = open(filename, O_RDONLY), err = -1;
16+
17+ if (fd < 0)
18+ return -1;
19+ if (read(fd, line, sizeof(line)) > 0) {
20+ *value = atoi(line);
21+ err = 0;
22+ }
23+
24+ close(fd);
25+ return err;
26+}
27+
28 // Return the worst case (largest) cache line size of the various levels of
29 // cache actually prsent in the machine.
30 int Sat::CacheLineSize() {
31- int max_linesize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
32- int linesize = sysconf(_SC_LEVEL2_CACHE_LINESIZE);
33+ int max_linesize, linesize;
34+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
35+ max_linesize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
36+#else
37+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", &max_linesize);
38+#endif
39+#ifdef _SC_LEVEL2_DCACHE_LINESIZE
40+ linesize = sysconf(_SC_LEVEL2_DCACHE_LINESIZE);
41+#else
42+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index1/coherency_line_size", &linesize);
43+#endif
44 if (linesize > max_linesize) max_linesize = linesize;
45- linesize = sysconf(_SC_LEVEL3_CACHE_LINESIZE);
46+#ifdef _SC_LEVEL3_DCACHE_LINESIZE
47+ linesize = sysconf(_SC_LEVEL3_DCACHE_LINESIZE);
48+#else
49+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index2/coherency_line_size", &linesize);
50+#endif
51 if (linesize > max_linesize) max_linesize = linesize;
52- linesize = sysconf(_SC_LEVEL4_CACHE_LINESIZE);
53+#ifdef _SC_LEVEL4_DCACHE_LINESIZE
54+ linesize = sysconf(_SC_LEVEL4_DCACHE_LINESIZE);
55+#else
56+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index3/coherency_line_size", &linesize);
57+#endif
58 if (linesize > max_linesize) max_linesize = linesize;
59 return max_linesize;
60 }
61--- a/src/sat.h
62+++ b/src/sat.h
63@@ -136,7 +136,8 @@ class Sat {
64 int CpuCount();
65 // Return the worst-case (largest) cache line size of the system.
66 int CacheLineSize();
67-
68+ // Read int values from kernel file system e.g. sysfs
69+ int ReadInt(const char *filename, int *value);
70 // Collect error counts from threads.
71 int64 GetTotalErrorCount();
72
diff --git a/meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.9.bb b/meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.11.bb
index 02144c558a..ba61ff971e 100644
--- a/meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.9.bb
+++ b/meta-oe/recipes-benchmark/stressapptest/stressapptest_1.0.11.bb
@@ -9,22 +9,14 @@ SECTION = "benchmark"
9LICENSE = "Apache-2.0" 9LICENSE = "Apache-2.0"
10LIC_FILES_CHKSUM = "file://COPYING;md5=55ea9d559f985fb4834317d8ed6b9e58" 10LIC_FILES_CHKSUM = "file://COPYING;md5=55ea9d559f985fb4834317d8ed6b9e58"
11 11
12SRCREV = "9146a8bfe3e3daefa95f7a61b75183e5fc64af2c" 12SRCREV = "25e31a2c1fcc66f3a43e91998f0819b016322a70"
13
14PV .= "+1.0.10git${SRCPV}"
15 13
16EXTRA_AUTOCONF:append:armv7a = " --with-cpu=armv7a" 14EXTRA_AUTOCONF:append:armv7a = " --with-cpu=armv7a"
17EXTRA_AUTOCONF:append:armv7ve = " --with-cpu=armv7a" 15EXTRA_AUTOCONF:append:armv7ve = " --with-cpu=armv7a"
18 16
19GI_DATA_ENABLED:libc-musl:armv7a = "False" 17GI_DATA_ENABLED:libc-musl:armv7a = "False"
20GI_DATA_ENABLED:libc-musl:armv7ve = "False" 18GI_DATA_ENABLED:libc-musl:armv7ve = "False"
21SRC_URI = "git://github.com/stressapptest/stressapptest;branch=master;protocol=https \ 19SRC_URI = "git://github.com/stressapptest/stressapptest;branch=master;protocol=https"
22 file://libcplusplus-compat.patch \
23 file://read_sysfs_for_cachesize.patch \
24 file://0001-configure-Add-with-cpu.patch \
25 file://0002-Replace-lfs64-functions-and-defines.patch \
26 file://0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch \
27 "
28 20
29S = "${WORKDIR}/git" 21S = "${WORKDIR}/git"
30 22