summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-util/stressapptest
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-util/stressapptest')
-rw-r--r--dev-util/stressapptest/Manifest3
-rw-r--r--dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch43
-rw-r--r--dev-util/stressapptest/files/stressapptest-1.0.6-autotools.patch145
-rw-r--r--dev-util/stressapptest/files/stressapptest-1.0.6-channel-hash.patch226
-rw-r--r--dev-util/stressapptest/files/stressapptest-1.0.6-misc-fixes.patch75
-rw-r--r--dev-util/stressapptest/files/stressapptest-1.0.6-pthread-test.patch136
-rw-r--r--dev-util/stressapptest/metadata.xml8
-rw-r--r--dev-util/stressapptest/stressapptest-1.0.4.ebuild35
-rw-r--r--dev-util/stressapptest/stressapptest-1.0.6-r1.ebuild33
-rw-r--r--dev-util/stressapptest/stressapptest-1.0.6-r2.ebuild34
-rw-r--r--dev-util/stressapptest/stressapptest-1.0.6.ebuild32
-rw-r--r--dev-util/stressapptest/stressapptest-1.0.7_p1.ebuild29
12 files changed, 799 insertions, 0 deletions
diff --git a/dev-util/stressapptest/Manifest b/dev-util/stressapptest/Manifest
new file mode 100644
index 000000000000..be0b0ff14f72
--- /dev/null
+++ b/dev-util/stressapptest/Manifest
@@ -0,0 +1,3 @@
+DIST stressapptest-1.0.4_autoconf.tar.gz 200370 SHA256 c8c83419e800504682506e10800763759f3f339b2158bae1329bb145ff981b65 SHA512 bcc81057361c9ae09562106398f1a3d6b5a0a41e4bf4e7b61ca8f05144a4295e642136dd5441ad1950b5c2785476593ad30d03052e4fe9e9f4071aabd33b123f WHIRLPOOL fe8befb6f76c33c4b2d525064c47e3b9c69a1352b6a0eb502c06ca3b12143aa7a3127e9b944ab1c871937345978ddc6598f1dbe2f3fb7cd3dc6dd65b4563b537
+DIST stressapptest-1.0.6_autoconf.tar.gz 208918 SHA256 31b04bbd964431668977a89aee44b241cb54a5e84c3abf6132507545b286cdd9 SHA512 92a1258cc67f49de55f3cc1fa4e3fa627ed77aa033790f8af2b5d006799ff1aeef5b8e35dbeb52c777f9b4dad08ab6e4dfe445bc05e977c0f7c4a15c0cf46331 WHIRLPOOL 7e916e74e87ef935894c134ea867a077bc761b1959c3b2063b6b5ee5b2bae473d56a7e19423eb8d6c0be0a4f6dab29bad7c20eb5f2d68cee66210a6da2306921
+DIST stressapptest-1.0.7_p1.tar.xz 165876 SHA256 39183d4dd79ae37e7ad480a4b9254ff52bcc926e853e954df492b51db3ee3b04 SHA512 ac3c072eae6f13ba6608d2cee1ee33b5d27b078dbbcb9e7ae1e59507d4571e36a06dd0e19e4a1b705c916104e06be39aa93ebe607fe93d5669e8764c68904fc9 WHIRLPOOL 374a8c86dc2742187c001580ec335b72822f0ac44ba2694bdabf6991765126fedca8928862db56c827f24e9e11c5f7f8b6654d0e04a94ba5a4a284f608f28bf1
diff --git a/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch b/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch
new file mode 100644
index 000000000000..740349bc6f1f
--- /dev/null
+++ b/dev-util/stressapptest/files/stressapptest-1.0.4-cpuid-pic.patch
@@ -0,0 +1,43 @@
+http://code.google.com/p/stressapptest/issues/detail?id=26
+
+--- a/src/os.cc
++++ b/src/os.cc
+@@ -149,7 +149,16 @@ void OsLayer::GetFeatures() {
+ // http://www.sandpile.org/ia32/cpuid.htm
+ int ax, bx, cx, dx;
+ __asm__ __volatile__ (
+- "cpuid": "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (1));
++# if defined(STRESSAPPTEST_CPU_I686) && defined(__PIC__)
++ "xchg %%ebx, %%esi;"
++ "cpuid;"
++ "xchg %%esi, %%ebx;"
++ : "=S" (bx),
++# else
++ "cpuid;"
++ : "=b" (bx),
++# endif
++ "=a" (ax), "=c" (cx), "=d" (dx) : "a" (1));
+ has_clflush_ = (dx >> 19) & 1;
+ has_sse2_ = (dx >> 26) & 1;
+
+--- a/src/worker.cc
++++ b/src/worker.cc
+@@ -85,7 +85,17 @@ namespace {
+ inline int apicid(void) {
+ int cpu;
+ #if defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
+- __asm __volatile("cpuid" : "=b" (cpu) : "a" (1) : "cx", "dx");
++ __asm__ __volatile__ (
++# if defined(STRESSAPPTEST_CPU_I686) && defined(__PIC__)
++ "xchg %%ebx, %%esi;"
++ "cpuid;"
++ "xchg %%esi, %%ebx;"
++ : "=S" (cpu)
++# else
++ "cpuid;"
++ : "=b" (cpu)
++# endif
++ : "a" (1) : "cx", "dx");
+ #elif defined(STRESSAPPTEST_CPU_ARMV7A)
+ #warning "Unsupported CPU type ARMV7A: unable to determine core ID."
+ cpu = 0;
diff --git a/dev-util/stressapptest/files/stressapptest-1.0.6-autotools.patch b/dev-util/stressapptest/files/stressapptest-1.0.6-autotools.patch
new file mode 100644
index 000000000000..db5103d34584
--- /dev/null
+++ b/dev-util/stressapptest/files/stressapptest-1.0.6-autotools.patch
@@ -0,0 +1,145 @@
+From fdc52203836f7fd54e1bff84e11d26838a8f21bc Mon Sep 17 00:00:00 2001
+From: "nick.j.sanders@gmail.com"
+ <nick.j.sanders@gmail.com@93e54ea4-8218-11de-8aaf-8d8425684b44>
+Date: Tue, 11 Feb 2014 08:53:31 +0000
+Subject: [PATCH] Fix autoconf bugs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+* Correctly use autoconf host rather than target.
+* Use autoconf host_os.
+* Warn rather than error on unknown configs.
+* Add --disable-default-optimizations to avoid forced flags.
+* Fix manfile install
+
+
+git-svn-id: http://stressapptest.googlecode.com/svn/trunk@42 93e54ea4-8218-11de-8aaf-8d8425684b44
+---
+ Makefile.am | 3 +-
+ Makefile.in | 171 ++++++++-----
+ aclocal.m4 | 72 ++++--
+ configure | 781 ++++++++++++++++++++++++++++----------------------------
+ configure.ac | 63 +++--
+ src/Makefile.in | 36 ++-
+ 6 files changed, 602 insertions(+), 524 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index c476e5f..5b1998f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,2 +1,3 @@
+ SUBDIRS = src
+-dist_doc_DATA = COPYING stressapptest.1
+\ No newline at end of file
++dist_man_MANS = stressapptest.1
++
+diff --git a/configure.ac b/configure.ac
+index 6f09eb9..1fbc460 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,60 +12,53 @@ else
+ fi
+
+ AC_CANONICAL_HOST
+-AC_CANONICAL_BUILD
+ # Checking for target cpu and setting custom configuration
+ # for the different platforms
+-AC_CANONICAL_TARGET
+-case x"$target_cpu" in
+- "xx86_64")
++AS_CASE(["$host_cpu"],
++ [*x86_64*], [
+ AC_DEFINE([STRESSAPPTEST_CPU_X86_64],[],
+ [Defined if the target CPU is x86_64])
+- ;;
+- "xi686")
++ ],
++ [*i686*], [
+ AC_DEFINE([STRESSAPPTEST_CPU_I686],[],
+ [Defined if the target CPU is i686])
+- ;;
+- "xpowerpc")
++ ],
++ [*powerpc*], [
+ AC_DEFINE([STRESSAPPTEST_CPU_PPC],[],
+ [Defined if the target CPU is PowerPC])
+- ;;
+- "xarmv7a")
++ ],
++ [*armv7a*], [
+ AC_DEFINE([STRESSAPPTEST_CPU_ARMV7A],[],
+ [Defined if the target CPU is armv7a])
+- ;;
+- *)
+- AC_MSG_ERROR([$target_cpu is not supported! Try x86_64, i686, powerpc, or armv7a])
+- ;;
+-esac
++ ],
++ [AC_MSG_WARN([Unsupported CPU: $host_cpu! Try x86_64, i686, powerpc, or armv7a])]
++)
+
+-_os=`uname`
+ ## The following allows like systems to share settings. This is not meant to
+ ## imply that these OS are the same thing. From OpenOffice dmake configure.in
+-case "$_os" in
+- "Linux")
++AS_CASE(["$host_os"],
++ [*linux*], [
+ OS_VERSION=linux
+ AC_DEFINE([STRESSAPPTEST_OS_LINUX],[],
+ [Defined if the target OS is Linux])
+- ;;
+- "Darwin")
++ ],
++ [*darwin*], [
+ OS_VERSION=macosx
+ AC_DEFINE([STRESSAPPTEST_OS_DARWIN],[],
+ [Defined if the target OS is OSX])
+- ;;
+- "FreeBSD")
++ ],
++ [*freebsd*], [
+ OS_VERSION=bsd
+ AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
+ [Defined if the target OS is BSD based])
+- ;;
+- "NetBSD")
++ ],
++ [*netbsd*], [
+ OS_VERSION=bsd
+ AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
+ [Defined if the target OS is BSD based])
+- ;;
+- *)
+- AC_MSG_ERROR([$_os operating system is not suitable to build dmake!])
+- ;;
+-esac
++ ],
++ [AC_MSG_WARN([unsupported system: $host_os])]
++)
+
+ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+ AC_CONFIG_SRCDIR([src/])
+@@ -95,10 +88,14 @@ AC_DEFINE_UNQUOTED([STRESSAPPTEST_TIMESTAMP],
+ "$username @ $hostname on $timestamp",
+ [Timestamp when ./configure was executed])
+
+-#Default cxxflags
+-CXXFLAGS="$CXXFLAGS -DCHECKOPTS"
+-CXXFLAGS="$CXXFLAGS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi"
+-CXXFLAGS="$CXXFLAGS -O3 -funroll-all-loops -funroll-loops -DNDEBUG"
++AC_ARG_ENABLE([default-optimizations],
++ [AS_HELP_STRING([--disable-default-optimizations], [Disable default optimization flag overrides])])
++AS_IF([test x"$enable_default_optimizations" != xno], [
++ #Default cxxflags
++ CXXFLAGS="$CXXFLAGS -DCHECKOPTS"
++ CXXFLAGS="$CXXFLAGS -Wreturn-type -Wunused -Wuninitialized -Wall -Wno-psabi"
++ CXXFLAGS="$CXXFLAGS -O3 -funroll-all-loops -funroll-loops -DNDEBUG"
++])
+
+ # Checks for header files.
+ AC_HEADER_DIRENT
+--
+2.0.0
+
diff --git a/dev-util/stressapptest/files/stressapptest-1.0.6-channel-hash.patch b/dev-util/stressapptest/files/stressapptest-1.0.6-channel-hash.patch
new file mode 100644
index 000000000000..468d2d3b5101
--- /dev/null
+++ b/dev-util/stressapptest/files/stressapptest-1.0.6-channel-hash.patch
@@ -0,0 +1,226 @@
+From 7d1eaee59d311523757fb93ec59d8985ea15b54d Mon Sep 17 00:00:00 2001
+From: "nick.j.sanders" <nick.j.sanders@93e54ea4-8218-11de-8aaf-8d8425684b44>
+Date: Thu, 10 Jan 2013 23:42:36 +0000
+Subject: [PATCH] Replace interleave_size with channel_hash
+
+This patch replaces the previously introduced interleave_size memory
+channel decoding mechanism with a more powerful channel_hash. Decoding
+can now be based upon an arbitrary mask of address bits, which will be
+XORed together to determine the target channel. Note that this drops
+support for more than two channels, but TripleChannel controllers will
+probably use much more complicated decoding mechanisms anyway.
+
+It also includes the findmask program, which offers a crude method to
+guess the decoding mask from an unknown memory controller for enterprising
+users. Use at your own risk.
+
+Signed-off-by: Julius Werner <jwerner@chromium.org>
+
+
+git-svn-id: http://stressapptest.googlecode.com/svn/trunk@37 93e54ea4-8218-11de-8aaf-8d8425684b44
+---
+ src/Makefile.am | 2 +
+ src/Makefile.in | 68 +++++++++++++++++++--------
+ src/findmask.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/findmask.inc | 4 ++
+ src/os.cc | 17 +++----
+ src/os.h | 12 ++---
+ src/sat.cc | 55 +++++++++++-----------
+ src/sat.h | 5 +-
+ 8 files changed, 238 insertions(+), 63 deletions(-)
+ create mode 100644 src/findmask.c
+ create mode 100644 src/findmask.inc
+
+--- a/src/os.cc
++++ b/src/os.cc
+@@ -261,21 +261,22 @@ bool OsLayer::AdlerMemcpyWarm(uint64 *dstmem, uint64 *srcmem,
+ }
+
+
+-// Translate physical address to memory module name.
+-// Assumes simple round-robin interleaving between memory channels of
+-// 'interleave_size_' sized chunks, with repeated 'channel_width_'
++// Translate physical address to memory module/chip name.
++// Assumes interleaving between two memory channels based on the XOR of
++// all address bits in the 'channel_hash' mask, with repeated 'channel_width_'
+ // blocks with bits distributed from each chip in that channel.
+ int OsLayer::FindDimm(uint64 addr, char *buf, int len) {
+ static const string unknown = "DIMM Unknown";
+- if (!modules_) {
++ if (!channels_) {
+ snprintf(buf, len, "%s", unknown.c_str());
+ return 0;
+ }
+
+- // Find channel by counting interleave units (typically cachelines),
+- // and mod by number of channels.
+- vector<string>& channel = (*modules_)[
+- (addr / interleave_size_) % modules_->size()];
++ // Find channel by XORing address bits in channel_hash mask.
++ uint32 low = (uint32)(addr & channel_hash_);
++ uint32 high = (uint32)((addr & channel_hash_) >> 32);
++ vector<string>& channel = (*channels_)[
++ __builtin_parity(high) ^ __builtin_parity(low)];
+
+ // Find dram chip by finding which byte within the channel
+ // by address mod channel width, then divide the channel
+--- a/src/os.h
++++ b/src/os.h
+@@ -58,11 +58,11 @@ class OsLayer {
+ }
+
+ // Set parameters needed to translate physical address to memory module.
+- void SetDramMappingParams(int interleave_size, int channel_width,
+- vector< vector<string> > *modules) {
+- interleave_size_ = interleave_size;
++ void SetDramMappingParams(uintptr_t channel_hash, int channel_width,
++ vector< vector<string> > *channels) {
++ channel_hash_ = channel_hash;
+ channel_width_ = channel_width;
+- modules_ = modules;
++ channels_ = channels;
+ }
+
+ // Initializes data strctures and open files.
+@@ -269,8 +269,8 @@ class OsLayer {
+ bool use_posix_shm_; // Use 4k page shmem?
+ bool dynamic_mapped_shmem_; // Conserve virtual address space.
+ int shmid_; // Handle to shmem
+- vector< vector<string> > *modules_; // Memory module names per channel.
+- int interleave_size_; // Channel interleaving chunk size.
++ vector< vector<string> > *channels_; // Memory module names per channel.
++ uint64 channel_hash_; // Mask of address bits XORed for channel.
+ int channel_width_; // Channel width in bits.
+
+ int64 regionsize_; // Size of memory "regions"
+--- a/src/sat.cc
++++ b/src/sat.cc
+@@ -572,12 +572,12 @@ bool Sat::Initialize() {
+
+ if (min_hugepages_mbytes_ > 0)
+ os_->SetMinimumHugepagesSize(min_hugepages_mbytes_ * kMegabyte);
+- if (modules_.size() > 0) {
++ if (channels_.size() > 0) {
+ logprintf(6, "Log: Decoding memory: %dx%d bit channels,"
+- " %d byte burst size, %d modules per channel (x%d)\n",
+- modules_.size(), channel_width_, interleave_size_, modules_[0].size(),
+- channel_width_/modules_[0].size());
+- os_->SetDramMappingParams(interleave_size_, channel_width_, &modules_);
++ "%d modules per channel (x%d), decoding hash 0x%x\n",
++ channels_.size(), channel_width_, channels_[0].size(),
++ channel_width_/channels_[0].size(), channel_hash_);
++ os_->SetDramMappingParams(channel_hash_, channel_width_, &channels_);
+ }
+
+ if (!os_->Initialize()) {
+@@ -650,7 +650,7 @@ Sat::Sat() {
+ min_hugepages_mbytes_ = 0;
+ freepages_ = 0;
+ paddr_base_ = 0;
+- interleave_size_ = kCacheLineSize;
++ channel_hash_ = kCacheLineSize;
+ channel_width_ = 64;
+
+ user_break_ = false;
+@@ -927,19 +927,19 @@ bool Sat::ParseArgs(int argc, char **argv) {
+ continue;
+ }
+
+- ARG_IVALUE("--interleave_size", interleave_size_);
++ ARG_IVALUE("--channel_hash", channel_hash_);
+ ARG_IVALUE("--channel_width", channel_width_);
+
+ if (!strcmp(argv[i], "--memory_channel")) {
+ i++;
+ if (i < argc) {
+- char *module = argv[i];
+- modules_.push_back(vector<string>());
+- while (char* next = strchr(module, ',')) {
+- modules_.back().push_back(string(module, next - module));
+- module = next + 1;
++ char *channel = argv[i];
++ channels_.push_back(vector<string>());
++ while (char* next = strchr(channel, ',')) {
++ channels_.back().push_back(string(channel, next - channel));
++ channel = next + 1;
+ }
+- modules_.back().push_back(string(module));
++ channels_.back().push_back(string(channel));
+ }
+ continue;
+ }
+@@ -990,22 +990,25 @@ bool Sat::ParseArgs(int argc, char **argv) {
+ }
+
+ // Validate memory channel parameters if supplied
+- if (modules_.size()) {
+- if (interleave_size_ <= 0 ||
+- interleave_size_ & (interleave_size_ - 1)) {
++ if (channels_.size()) {
++ if (channels_.size() == 1) {
++ channel_hash_ = 0;
++ logprintf(7, "Log: "
++ "Only one memory channel...deactivating interleave decoding.\n");
++ } else if (channels_.size() > 2) {
+ logprintf(6, "Process Error: "
+- "Interleave size %d is not a power of 2.\n", interleave_size_);
++ "Triple-channel mode not yet supported... sorry.\n");
+ bad_status();
+ return false;
+ }
+- for (uint i = 0; i < modules_.size(); i++)
+- if (modules_[i].size() != modules_[0].size()) {
++ for (uint i = 0; i < channels_.size(); i++)
++ if (channels_[i].size() != channels_[0].size()) {
+ logprintf(6, "Process Error: "
+- "Channels 0 and %d have a different amount of modules.\n",i);
++ "Channels 0 and %d have a different count of dram modules.\n",i);
+ bad_status();
+ return false;
+ }
+- if (modules_[0].size() & (modules_[0].size() - 1)) {
++ if (channels_[0].size() & (channels_[0].size() - 1)) {
+ logprintf(6, "Process Error: "
+ "Amount of modules per memory channel is not a power of 2.\n");
+ bad_status();
+@@ -1018,9 +1021,9 @@ bool Sat::ParseArgs(int argc, char **argv) {
+ bad_status();
+ return false;
+ }
+- if (channel_width_ / modules_[0].size() < 8) {
+- logprintf(6, "Process Error: "
+- "Chip width x%d must be x8 or greater.\n", channel_width_ / modules_[0].size());
++ if (channel_width_ / channels_[0].size() < 8) {
++ logprintf(6, "Process Error: Chip width x%d must be x8 or greater.\n",
++ channel_width_ / channels_[0].size());
+ bad_status();
+ return false;
+ }
+@@ -1095,8 +1098,8 @@ void Sat::PrintHelp() {
+ "each CPU to be tested by that CPU\n"
+ " --remote_numa choose memory regions not associated with "
+ "each CPU to be tested by that CPU\n"
+- " --interleave_size bytes size in bytes of each channel's data as interleaved "
+- "between memory channels\n"
++ " --channel_hash mask of address bits XORed to determine channel.\n"
++ " Mask 0x40 interleaves cachelines between channels\n"
+ " --channel_width bits width in bits of each memory channel\n"
+ " --memory_channel u1,u2 defines a comma-separated list of names\n"
+ " for dram packages in a memory channel.\n"
+--- a/src/sat.h
++++ b/src/sat.h
+@@ -151,9 +151,8 @@ class Sat {
+ int64 freepages_; // How many invalid pages we need.
+ int disk_pages_; // Number of pages per temp file.
+ uint64 paddr_base_; // Physical address base.
+- vector< vector<string> > modules_; // Memory module names per channel.
+- int interleave_size_; // Channel interleaving chunk size in bytes.
+- // Usually cacheline sized.
++ vector< vector<string> > channels_; // Memory module names per channel.
++ uint64 channel_hash_; // Mask of address bits XORed for channel.
+ int channel_width_; // Channel width in bits.
+
+ // Control flags.
+--
+2.0.0
+
diff --git a/dev-util/stressapptest/files/stressapptest-1.0.6-misc-fixes.patch b/dev-util/stressapptest/files/stressapptest-1.0.6-misc-fixes.patch
new file mode 100644
index 000000000000..e67bbc52e7c3
--- /dev/null
+++ b/dev-util/stressapptest/files/stressapptest-1.0.6-misc-fixes.patch
@@ -0,0 +1,75 @@
+extracted just a few fixes we care about
+
+From 5fca3981f68115144566ddf91d2d188372603b7b Mon Sep 17 00:00:00 2001
+From: "ewout@google.com"
+ <ewout@google.com@93e54ea4-8218-11de-8aaf-8d8425684b44>
+Date: Tue, 10 Sep 2013 21:27:49 +0000
+Subject: [PATCH] New frequency test, fixed error accounting, added logging
+ timestamps, and miscellaneous smaller changes.
+
+* Added a CPU Frequency test for select X86 processors to verify a minimum frequency is maintained during non-pause periods.
+* Fixed the error accounting in WorkerThread::CheckRegion if more than 128 miscompares are found and when block errors are detected.
+* Updated the logger to include timestamps and the associated timezone.
+* Moved from apicid() to sched_getcpu() for determining the core ID.
+* Added the ability to reserve a specified amount of memory. This can override the requested memory allocation.
+* If not using POSIX shared memory or hugepages, explicitly mmap memory if the pagesize is 4kB otherwise use memalign.
+* Removed the OSLayer's unused PCI device handling.
+* Numerous refactoring changes.
+
+
+
+git-svn-id: http://stressapptest.googlecode.com/svn/trunk@38 93e54ea4-8218-11de-8aaf-8d8425684b44
+---
+ configure.ac | 6 +-
+ src/Makefile.am | 1 +
+ src/clock.h | 29 ++++
+ src/disk_blocks.cc | 187 ++++++++---------------
+ src/disk_blocks.h | 157 +++++++++++++------
+ src/findmask.c | 6 +-
+ src/logger.cc | 56 ++++---
+ src/logger.h | 17 ++-
+ src/os.cc | 218 +++++++++++----------------
+ src/os.h | 132 ++++++++++++++--
+ src/sat.cc | 144 +++++++++++++++---
+ src/sat.h | 19 ++-
+ src/sattypes.h | 58 ++++++-
+ src/worker.cc | 435 +++++++++++++++++++++++++++++++++++++++++------------
+ src/worker.h | 100 +++++++++++-
+ stressapptest.1 | 7 +-
+ 16 files changed, 1095 insertions(+), 477 deletions(-)
+ create mode 100644 src/clock.h
+
+diff --git a/src/os.cc b/src/os.cc
+index 7cae23b..6358398 100644
+--- a/src/os.cc
++++ b/src/os.cc
+@@ -130,7 +141,7 @@ int OsLayer::AddressMode() {
+ // Translates user virtual to physical address.
+ uint64 OsLayer::VirtualToPhysical(void *vaddr) {
+ uint64 frame, shift;
+- off64_t off = ((uintptr_t)vaddr) / getpagesize() * 8;
++ off64_t off = ((uintptr_t)vaddr) / sysconf(_SC_PAGESIZE) * 8;
+ int fd = open(kPagemapPath, O_RDONLY);
+ // /proc/self/pagemap is available in kernel >= 2.6.25
+ if (fd < 0)
+@@ -507,7 +533,7 @@ bool OsLayer::AllocateTestMem(int64 length, uint64 paddr_base) {
+ break;
+ }
+
+- shmaddr = shmat(shmid, NULL, NULL);
++ shmaddr = shmat(shmid, NULL, 0);
+ if (shmaddr == reinterpret_cast<void*>(-1)) {
+ int err = errno;
+ string errtxt = ErrorString(err);
+@@ -564,7 +590,7 @@ bool OsLayer::AllocateTestMem(int64 length, uint64 paddr_base) {
+ // Do a full mapping here otherwise.
+ shmaddr = mmap64(NULL, length, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
+- shm_object, NULL);
++ shm_object, 0);
+ if (shmaddr == reinterpret_cast<void*>(-1)) {
+ int err = errno;
+ string errtxt = ErrorString(err);
+--
+2.0.0
+
diff --git a/dev-util/stressapptest/files/stressapptest-1.0.6-pthread-test.patch b/dev-util/stressapptest/files/stressapptest-1.0.6-pthread-test.patch
new file mode 100644
index 000000000000..31036b423cda
--- /dev/null
+++ b/dev-util/stressapptest/files/stressapptest-1.0.6-pthread-test.patch
@@ -0,0 +1,136 @@
+From 2cc58e88b26e13e87a36439d7a7e7b44b4a1e47e Mon Sep 17 00:00:00 2001
+From: "nick.j.sanders" <nick.j.sanders@93e54ea4-8218-11de-8aaf-8d8425684b44>
+Date: Wed, 9 Jan 2013 21:13:13 +0000
+Subject: [PATCH] Allow ./configure for cross compile
+
+Fix regression from BARRIER detect change.
+
+
+git-svn-id: http://stressapptest.googlecode.com/svn/trunk@36 93e54ea4-8218-11de-8aaf-8d8425684b44
+---
+ configure | 49 +++++++------------------------------------
+ configure.ac | 21 +------------------
+ src/stressapptest_config.h.in | 3 +++
+ 3 files changed, 11 insertions(+), 62 deletions(-)
+
+diff --git a/configure b/configure
+index 12bc16b..8c10c52 100755
+--- a/configure
++++ b/configure
+@@ -5064,6 +5064,13 @@ if test "$ac_res" != no; then :
+
+ fi
+
++ac_fn_c_check_type "$LINENO" "pthread_barrier_t" "ac_cv_type_pthread_barrier_t" "$ac_includes_default"
++if test "x$ac_cv_type_pthread_barrier_t" = x""yes; then :
++
++$as_echo "#define HAVE_PTHREAD_BARRIERS 1" >>confdefs.h
++
++fi
++
+ for ac_header in libaio.h
+ do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libaio.h" "ac_cv_header_libaio_h" "$ac_includes_default"
+@@ -5201,48 +5208,6 @@ if test "$ac_res" != no; then :
+ fi
+
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_barrier" >&5
+-$as_echo_n "checking for pthread_barrier... " >&6; }
+-if test "${ac_cv_func_pthread_barrier+set}" = set; then :
+- $as_echo_n "(cached) " >&6
+-else
+- if test "$cross_compiling" = yes; then :
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error "cannot run test program while cross compiling
+-See \`config.log' for more details." "$LINENO" 5; }
+-else
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+- #include <pthread.h>
+- int main(void)
+- {
+- pthread_barrier_t t;
+- return 0;
+- }
+-
+-_ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
+- ac_cv_func_pthread_barrier=yes
+-else
+- ac_cv_func_pthread_barrier=no
+-
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+- conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
+-
+-
+-fi
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_pthread_barrier" >&5
+-$as_echo "$ac_cv_func_pthread_barrier" >&6; }
+-if test "$ac_cv_func_pthread_barrier" = "yes"; then
+-
+-$as_echo "#define HAVE_PTHREAD_BARRIER 1" >>confdefs.h
+-
+-fi
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+diff --git a/configure.ac b/configure.ac
+index aba8791..ca10966 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -107,31 +107,12 @@ AC_HEADER_STDC
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h], [], [AC_MSG_FAILURE([Missing some header files.])])
+ AC_CHECK_HEADERS([pthread.h])
+ AC_SEARCH_LIBS([pthread_create], [pthread])
++AC_CHECK_TYPE([pthread_barrier_t], AC_DEFINE(HAVE_PTHREAD_BARRIERS, [1], [Define to 1 if the system has `pthread_barrier'.]))
+ AC_CHECK_HEADERS([libaio.h])
+ AC_SEARCH_LIBS([io_setup], [aio])
+ AC_CHECK_HEADERS([sys/shm.h])
+ AC_SEARCH_LIBS([shm_open], [rt])
+
+-AC_MSG_CHECKING(for pthread_barrier)
+-AC_CACHE_VAL(
+- ac_cv_func_pthread_barrier,
+- AC_TRY_RUN(
+- [
+- #include <pthread.h>
+- int main(void)
+- {
+- pthread_barrier_t t;
+- return 0;
+- }
+- ],
+- ac_cv_func_pthread_barrier=yes,
+- ac_cv_func_pthread_barrier=no
+- )
+-)
+-AC_MSG_RESULT($ac_cv_func_pthread_barrier)
+-if test "$ac_cv_func_pthread_barrier" = "yes"; then
+- AC_DEFINE(HAVE_PTHREAD_BARRIER, [1], [Define to 1 if the system has `pthread_barrier'.])
+-fi
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_HEADER_STDBOOL
+diff --git a/src/stressapptest_config.h.in b/src/stressapptest_config.h.in
+index 97f306e..5412df4 100644
+--- a/src/stressapptest_config.h.in
++++ b/src/stressapptest_config.h.in
+@@ -53,6 +53,9 @@
+ /* Define to 1 if you have the `posix_memalign' function. */
+ #undef HAVE_POSIX_MEMALIGN
+
++/* Define to 1 if the system has `pthread_barrier'. */
++#undef HAVE_PTHREAD_BARRIERS
++
+ /* Define to 1 if you have the <pthread.h> header file. */
+ #undef HAVE_PTHREAD_H
+
+--
+2.0.0
+
diff --git a/dev-util/stressapptest/metadata.xml b/dev-util/stressapptest/metadata.xml
new file mode 100644
index 000000000000..0947421cbd38
--- /dev/null
+++ b/dev-util/stressapptest/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>vapier@gentoo.org</email>
+ <description>do whatever</description>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-util/stressapptest/stressapptest-1.0.4.ebuild b/dev-util/stressapptest/stressapptest-1.0.4.ebuild
new file mode 100644
index 000000000000..26dbb5264750
--- /dev/null
+++ b/dev-util/stressapptest/stressapptest-1.0.4.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+MY_P="${P}_autoconf"
+DESCRIPTION="Stressful Application Test"
+HOMEPAGE="http://code.google.com/p/stressapptest/"
+SRC_URI="http://stressapptest.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cpuid-pic.patch
+ sed -i \
+ '/CXXFLAGS/s:-O3 -funroll-all-loops -funroll-loops::' \
+ configure || die
+}
+
+src_install() {
+ default
+ doman "${ED}"/usr/share/doc/${PN}/${PN}.1
+ rm -rf "${ED}"/usr/share/doc # only installs COPYING & man page
+}
diff --git a/dev-util/stressapptest/stressapptest-1.0.6-r1.ebuild b/dev-util/stressapptest/stressapptest-1.0.6-r1.ebuild
new file mode 100644
index 000000000000..b9d24b5def79
--- /dev/null
+++ b/dev-util/stressapptest/stressapptest-1.0.6-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils autotools
+
+MY_P="${P}_autoconf"
+DESCRIPTION="Stressful Application Test"
+HOMEPAGE="http://code.google.com/p/stressapptest/"
+SRC_URI="http://stressapptest.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-autotools.patch
+ epatch "${FILESDIR}"/${P}-pthread-test.patch
+ epatch "${FILESDIR}"/${P}-misc-fixes.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-default-optimizations
+}
diff --git a/dev-util/stressapptest/stressapptest-1.0.6-r2.ebuild b/dev-util/stressapptest/stressapptest-1.0.6-r2.ebuild
new file mode 100644
index 000000000000..377acc713edb
--- /dev/null
+++ b/dev-util/stressapptest/stressapptest-1.0.6-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils autotools
+
+MY_P="${P}_autoconf"
+DESCRIPTION="Stressful Application Test"
+HOMEPAGE="http://code.google.com/p/stressapptest/"
+SRC_URI="http://stressapptest.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-autotools.patch
+ epatch "${FILESDIR}"/${P}-pthread-test.patch
+ epatch "${FILESDIR}"/${P}-misc-fixes.patch
+ epatch "${FILESDIR}"/${P}-channel-hash.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-default-optimizations
+}
diff --git a/dev-util/stressapptest/stressapptest-1.0.6.ebuild b/dev-util/stressapptest/stressapptest-1.0.6.ebuild
new file mode 100644
index 000000000000..2e592b1e24d7
--- /dev/null
+++ b/dev-util/stressapptest/stressapptest-1.0.6.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+MY_P="${P}_autoconf"
+DESCRIPTION="Stressful Application Test"
+HOMEPAGE="http://code.google.com/p/stressapptest/"
+SRC_URI="http://stressapptest.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed -i \
+ '/CXXFLAGS/s:-O3 -funroll-all-loops -funroll-loops::' \
+ configure || die
+}
+
+src_install() {
+ default
+ doman "${ED}"/usr/share/doc/${PN}/${PN}.1
+ rm -rf "${ED}"/usr/share/doc # only installs COPYING & man page
+}
diff --git a/dev-util/stressapptest/stressapptest-1.0.7_p1.ebuild b/dev-util/stressapptest/stressapptest-1.0.7_p1.ebuild
new file mode 100644
index 000000000000..8dcd88928ac5
--- /dev/null
+++ b/dev-util/stressapptest/stressapptest-1.0.7_p1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This is the 1.0.7 release:
+# https://code.google.com/p/stressapptest/source/detail?r=44
+# With the one follow up fix applied (hence the p1).
+
+EAPI="4"
+
+inherit flag-o-matic
+
+DESCRIPTION="Stressful Application Test"
+HOMEPAGE="http://code.google.com/p/stressapptest/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~x86"
+IUSE="debug"
+
+RDEPEND="dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ # Matches the configure & sat.cc logic
+ use debug || append-cppflags -DNDEBUG -DCHECKOPTS
+ econf --disable-default-optimizations
+}