diff options
-rw-r--r-- | Android.bp | 44 | ||||
-rw-r--r-- | Android.mk | 29 | ||||
-rw-r--r-- | METADATA | 15 | ||||
-rw-r--r-- | OWNERS | 1 | ||||
-rw-r--r-- | src/queue.h | 3 | ||||
-rw-r--r-- | src/stressapptest_config_android.h | 13 | ||||
-rw-r--r-- | src/worker.cc | 52 | ||||
-rw-r--r-- | src/worker.h | 1 |
8 files changed, 76 insertions, 82 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..3743d2f --- /dev/null +++ b/Android.bp @@ -0,0 +1,44 @@ +cc_binary { + name: "stressapptest", + + srcs: [ + "src/main.cc", + "src/adler32memcpy.cc", + "src/disk_blocks.cc", + "src/error_diag.cc", + "src/finelock_queue.cc", + "src/logger.cc", + "src/os.cc", + "src/os_factory.cc", + "src/pattern.cc", + "src/queue.cc", + "src/sat.cc", + "src/sat_factory.cc", + "src/worker.cc", + ], + + arch: { + arm: { cflags: ["-DSTRESSAPPTEST_CPU_ARMV7A"] }, + arm64: { cflags: ["-DSTRESSAPPTEST_CPU_AARCH64"] }, + x86: { + enabled: false, + }, + x86_64: { + enabled: false, + }, + }, + + cflags: [ + "-DHAVE_CONFIG_H", + "-DANDROID", + "-DNDEBUG", + "-UDEBUG", + "-DCHECKOPTS", + + "-Wall", + "-Werror", + "-Wno-unused-parameter", + "-Wno-#warnings", + "-Wno-implicit-fallthrough", + ], +} diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 0b24bae..0000000 --- a/Android.mk +++ /dev/null @@ -1,29 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - src/main.cc \ - src/adler32memcpy.cc \ - src/disk_blocks.cc \ - src/error_diag.cc \ - src/finelock_queue.cc \ - src/logger.cc \ - src/os.cc \ - src/os_factory.cc \ - src/pattern.cc \ - src/queue.cc \ - src/sat.cc \ - src/sat_factory.cc \ - src/worker.cc - -# just build a 32b version, even on 64b hosts -LOCAL_MULTILIB := 32 -LOCAL_MODULE:= stressapptest -LOCAL_MODULE_TAGS := optional - -LOCAL_CFLAGS := -DHAVE_CONFIG_H -DANDROID -DNDEBUG -UDEBUG -DCHECKOPTS - -LOCAL_CPP_EXTENSION := .cc - -include $(BUILD_EXECUTABLE) diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..486ae0d --- /dev/null +++ b/METADATA @@ -0,0 +1,15 @@ +name: "stressapptest" +description: "Stressful Application Test - userspace memory and IO test" +third_party { + url { + type: GIT + value: "https://github.com/stressapptest/stressapptest.git" + } + version: "v1.0.9" + license_type: NOTICE + last_upgrade_date { + year: 2020 + month: 4 + day: 9 + } +} @@ -0,0 +1 @@ +include platform/system/core:/janitors/OWNERS diff --git a/src/queue.h b/src/queue.h index d1920a5..a6296b1 100644 --- a/src/queue.h +++ b/src/queue.h @@ -44,7 +44,6 @@ struct page_entry { int32 tag; // These are tags for use in NUMA affinity or other uses. uint32 touch; // Counter of the number of reads from this page. uint64 ts; // Timestamp of the last read from this page. - uint32 lastcpu; // Last CPU to write this page. class Pattern *lastpattern; // Expected Pattern at last read. }; @@ -55,7 +54,7 @@ static inline void init_pe(struct page_entry *pe) { pe->tag = kInvalidTag; pe->touch = 0; pe->ts = 0; - pe->lastcpu = 0; + pe->lastpattern = NULL; } // This is a threadsafe randomized queue of pages for diff --git a/src/stressapptest_config_android.h b/src/stressapptest_config_android.h index 0f6718e..03f6201 100644 --- a/src/stressapptest_config_android.h +++ b/src/stressapptest_config_android.h @@ -54,6 +54,9 @@ /* Define to 1 if you have the `posix_memalign' function. */ #define HAVE_POSIX_MEMALIGN 1 +/* Define to 1 if the system has `pthread_barrier'. */ +#define HAVE_PTHREAD_BARRIERS 1 + /* Define to 1 if you have the <pthread.h> header file. */ #define HAVE_PTHREAD_H 1 @@ -70,7 +73,7 @@ #define HAVE_SOCKET 1 /* Define to 1 if stdbool.h conforms to C99. */ -/* #undef HAVE_STDBOOL_H */ +#define HAVE_STDBOOL_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 @@ -141,7 +144,7 @@ #define PACKAGE_NAME "stressapptest" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "stressapptest 1.0.4_autoconf" +#define PACKAGE_STRING "stressapptest 1.0.9_autoconf" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "stressapptest" @@ -150,7 +153,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0.4_autoconf" +#define PACKAGE_VERSION "1.0.9_autoconf" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -171,7 +174,7 @@ /* #undef STRERROR_R_CHAR_P */ /* Defined if the target CPU is armv7a */ -#define STRESSAPPTEST_CPU_ARMV7A /**/ +/* #define STRESSAPPTEST_CPU_ARMV7A */ /* Defined if the target CPU is i686 */ /* #undef STRESSAPPTEST_CPU_I686 */ @@ -200,7 +203,7 @@ #define TIME_WITH_SYS_TIME 1 /* Version number of package */ -#define VERSION "1.0.4_autoconf" +#define VERSION "1.0.9_autoconf" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/src/worker.cc b/src/worker.cc index d8f37eb..922d2c1 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -117,8 +117,6 @@ struct ErrorRecord { uint64 paddr; // This is the bus address, if available. uint64 *tagvaddr; // This holds the tag value if this data was tagged. uint64 tagpaddr; // This holds the physical address corresponding to the tag. - uint32 lastcpu; // This holds the CPU recorded as probably writing this data. - const char *patternname; // This holds the pattern name of the expected data. }; // This is a helper function to create new threads with pthreads. @@ -464,9 +462,6 @@ bool WorkerThread::FillPage(struct page_entry *pe) { return 0; } - // Tag this page as written from the current CPU. - pe->lastcpu = sched_getcpu(); - // Mask is the bitmask of indexes used by the pattern. // It is the pattern size -1. Size is always a power of 2. uint64 *memwords = static_cast<uint64*>(pe->addr); @@ -519,8 +514,6 @@ bool FillThread::FillPageRandom(struct page_entry *pe) { // Choose a random pattern for this block. pe->pattern = patternlist_->GetRandomPattern(); - pe->lastcpu = sched_getcpu(); - if (pe->pattern == 0) { logprintf(0, "Process Error: Null data pattern\n"); return 0; @@ -611,19 +604,17 @@ void WorkerThread::ProcessError(struct ErrorRecord *error, (error->vaddr), 1); logprintf(priority, - "%s: miscompare on CPU %d(<-%d) at %p(0x%llx:%s): " - "read:0x%016llx, reread:0x%016llx expected:0x%016llx. '%s'%s.\n", + "%s: miscompare on CPU %d(0x%s) at %p(0x%llx:%s): " + "read:0x%016llx, reread:0x%016llx expected:0x%016llx\n", message, core_id, - error->lastcpu, + CurrentCpusFormat().c_str(), error->vaddr, error->paddr, dimm_string, error->actual, error->reread, - error->expected, - (error->patternname) ? error->patternname : "None", - (error->reread == error->expected) ? " read error" : ""); + error->expected); } @@ -690,8 +681,7 @@ void FileThread::ProcessError(struct ErrorRecord *error, dimm_string, error->actual, error->reread, - error->expected, - (error->patternname) ? error->patternname : "None"); + error->expected); // Overwrite incorrect data with correct data to prevent // future miscompares when this data is reused. @@ -704,7 +694,6 @@ void FileThread::ProcessError(struct ErrorRecord *error, // Print errors on mismatches. int WorkerThread::CheckRegion(void *addr, class Pattern *pattern, - uint32 lastcpu, int64 length, int offset, int64 pattern_offset) { @@ -740,8 +729,6 @@ int WorkerThread::CheckRegion(void *addr, recorded[errors].actual = actual; recorded[errors].expected = expected; recorded[errors].vaddr = &memblock[i]; - recorded[errors].patternname = pattern->name(); - recorded[errors].lastcpu = lastcpu; errors++; } else { page_error = true; @@ -915,7 +902,6 @@ int WorkerThread::CrcCheckPage(struct page_entry *srcpe) { expectedcrc->ToHexString().c_str()); int errorcount = CheckRegion(memslice, srcpe->pattern, - srcpe->lastcpu, blocksize, currentblock * blocksize, 0); if (errorcount == 0) { @@ -934,7 +920,6 @@ int WorkerThread::CrcCheckPage(struct page_entry *srcpe) { uint64 *memslice = memblock + blocks * blockwords; errors += CheckRegion(memslice, srcpe->pattern, - srcpe->lastcpu, leftovers, blocks * blocksize, 0); } @@ -1227,7 +1212,6 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe, expectedcrc->ToHexString().c_str()); int errorcount = CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, blocksize, currentblock * blocksize, 0); if (errorcount == 0) { @@ -1242,7 +1226,6 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe, memcpy(sourcemem, targetmem, blocksize); errorcount = CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, blocksize, currentblock * blocksize, 0); if (errorcount == 0) { @@ -1257,9 +1240,6 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe, er.actual = sourcemem[0]; er.expected = 0xbad00000ull << 32; er.vaddr = sourcemem; - er.lastcpu = srcpe->lastcpu; - logprintf(0, "Process Error: lastCPU %d\n", srcpe->lastcpu); - er.patternname = srcpe->pattern->name(); ProcessError(&er, 0, "Hardware Error"); errors += 1; errorcount_ ++; @@ -1278,7 +1258,6 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe, errors += CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, leftovers, blocks * blocksize, 0); int leftoverwords = leftovers / wordsize_; @@ -1289,7 +1268,6 @@ int WorkerThread::CrcCopyPage(struct page_entry *dstpe, // Update pattern reference to reflect new contents. dstpe->pattern = srcpe->pattern; - dstpe->lastcpu = sched_getcpu(); // Clean clean clean the errors away. if (errors) { @@ -1322,7 +1300,6 @@ int InvertThread::InvertPageDown(struct page_entry *srcpe) { } } - srcpe->lastcpu = sched_getcpu(); return 0; } @@ -1345,8 +1322,6 @@ int InvertThread::InvertPageUp(struct page_entry *srcpe) { OsLayer::FastFlush(&sourcemem[i]); } } - - srcpe->lastcpu = sched_getcpu(); return 0; } @@ -1383,7 +1358,6 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe, expectedcrc->ToHexString().c_str()); int errorcount = CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, blocksize, currentblock * blocksize, 0); if (errorcount == 0) { @@ -1398,7 +1372,6 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe, memcpy(sourcemem, targetmem, blocksize); errorcount = CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, blocksize, currentblock * blocksize, 0); if (errorcount == 0) { @@ -1413,8 +1386,6 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe, er.actual = sourcemem[0]; er.expected = 0xbad; er.vaddr = sourcemem; - er.lastcpu = srcpe->lastcpu; - er.patternname = srcpe->pattern->name(); ProcessError(&er, 0, "Hardware Error"); errors ++; errorcount_ ++; @@ -1433,7 +1404,6 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe, errors += CheckRegion(sourcemem, srcpe->pattern, - srcpe->lastcpu, leftovers, blocks * blocksize, 0); int leftoverwords = leftovers / wordsize_; @@ -1444,8 +1414,6 @@ int WorkerThread::CrcWarmCopyPage(struct page_entry *dstpe, // Update pattern reference to reflect new contents. dstpe->pattern = srcpe->pattern; - dstpe->lastcpu = sched_getcpu(); - // Clean clean clean the errors away. if (errors) { @@ -1526,7 +1494,7 @@ bool CopyThread::Work() { // Force errors for unittests. if (sat_->error_injection()) { - if ((random() % 50000) == 8) { + if (loops == 8) { char *addr = reinterpret_cast<char*>(src.addr); int offset = random() % sat_->page_length(); addr[offset] = 0xba; @@ -1541,7 +1509,6 @@ bool CopyThread::Work() { } else { memcpy(dst.addr, src.addr, sat_->page_length()); dst.pattern = src.pattern; - dst.lastcpu = sched_getcpu(); } result = result && sat_->PutValid(&dst); @@ -1786,7 +1753,6 @@ bool FileThread::SectorValidatePage(const struct PageRec &page, tag[sec].sector, page.src, page.dst); - errorcount_ += 1; logprintf(5, "Sector Error: Sector tag @ 0x%x, pass %d/%d. " "sec %x/%x, block %d/%d, magic %x/%x, File: %s \n", block * page_length + 512 * sec, @@ -1878,7 +1844,6 @@ bool FileThread::GetEmptyPage(struct page_entry *dst) { dst->addr = local_page_; dst->offset = 0; dst->pattern = 0; - dst->lastcpu = 0; } return true; } @@ -1934,7 +1899,6 @@ bool FileThread::ReadPages(int fd) { return false; // Retrieve expected pattern. dst.pattern = page_recs_[i].pattern; - dst.lastcpu = sched_getcpu(); // Update page recordpage record. page_recs_[i].dst = dst.addr; @@ -2266,7 +2230,6 @@ bool NetworkThread::Work() { // Update pattern reference to reflect new contents. dst.pattern = src.pattern; - dst.lastcpu = sched_getcpu(); // Do the network read. if (!(result = result && ReceivePage(sock, &dst))) @@ -3186,7 +3149,7 @@ bool DiskThread::ValidateBlockOnDisk(int fd, BlockData *block) { // In non-destructive mode, don't compare the block to the pattern since // the block was never written to disk in the first place. if (!non_destructive_) { - if (CheckRegion(block_buffer_, block->pattern(), 0, current_bytes, + if (CheckRegion(block_buffer_, block->pattern(), current_bytes, 0, bytes_read)) { os_->ErrorReport(device_name_.c_str(), "disk-pattern-error", 1); errorcount_ += 1; @@ -3424,7 +3387,6 @@ bool MemoryRegionThread::Work() { phase_ = kPhaseCopy; CrcCopyPage(&memregion_pe, &source_pe); memregion_pe.pattern = source_pe.pattern; - memregion_pe.lastcpu = sched_getcpu(); // Error injection for CRC Check. if ((sat_->error_injection() || error_injection_) && loops == 2) { diff --git a/src/worker.h b/src/worker.h index 3398208..091d96b 100644 --- a/src/worker.h +++ b/src/worker.h @@ -320,7 +320,6 @@ class WorkerThread { // Compare a region of memory with a known data patter, and report errors. virtual int CheckRegion(void *addr, class Pattern *pat, - uint32 lastcpu, int64 length, int offset, int64 patternoffset); |