#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for stressapptest 1.0.0_autoconf.
+# Generated by GNU Autoconf 2.61 for stressapptest 1.0.1_autoconf.
#
-# Report bugs to <opensource@gmail.com>.
+# Report bugs to <opensource@google.com>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='stressapptest'
PACKAGE_TARNAME='stressapptest'
-PACKAGE_VERSION='1.0.0_autoconf'
-PACKAGE_STRING='stressapptest 1.0.0_autoconf'
-PACKAGE_BUGREPORT='opensource@gmail.com'
+PACKAGE_VERSION='1.0.1_autoconf'
+PACKAGE_STRING='stressapptest 1.0.1_autoconf'
+PACKAGE_BUGREPORT='opensource@google.com'
ac_unique_file="src/"
# Factoring default headers for most tests.
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures stressapptest 1.0.0_autoconf to adapt to many kinds of systems.
+\`configure' configures stressapptest 1.0.1_autoconf to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of stressapptest 1.0.0_autoconf:";;
+ short | recursive ) echo "Configuration of stressapptest 1.0.1_autoconf:";;
esac
cat <<\_ACEOF
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <opensource@gmail.com>.
+Report bugs to <opensource@google.com>.
_ACEOF
ac_status=$?
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-stressapptest configure 1.0.0_autoconf
+stressapptest configure 1.0.1_autoconf
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by stressapptest $as_me 1.0.0_autoconf, which was
+It was created by stressapptest $as_me 1.0.1_autoconf, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
-# Checking for target cpu and setting custom configuration
-# for the different platforms
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+# Checking for target cpu and setting custom configuration
+# for the different platforms
{ echo "$as_me:$LINENO: checking target system type" >&5
echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
if test "${ac_cv_target+set}" = set; then
;;
esac
+_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")
+ OS_VERSION=linux
+
+cat >>confdefs.h <<\_ACEOF
+#define STRESSAPPTEST_OS_LINUX
+_ACEOF
+
+ ;;
+ "Darwin")
+ OS_VERSION=macosx
+
+cat >>confdefs.h <<\_ACEOF
+#define STRESSAPPTEST_OS_DARWIN
+_ACEOF
+
+ ;;
+ "FreeBSD")
+ OS_VERSION=bsd
+
+cat >>confdefs.h <<\_ACEOF
+#define STRESSAPPTEST_OS_BSD
+_ACEOF
+
+ ;;
+ "NetBSD")
+ OS_VERSION=bsd
+
+cat >>confdefs.h <<\_ACEOF
+#define STRESSAPPTEST_OS_BSD
+_ACEOF
+
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: $_os operating system is not suitable to build dmake!" >&5
+echo "$as_me: error: $_os operating system is not suitable to build dmake!" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
am__api_version='1.10'
# Find a good install program. We prefer a C program (faster),
# Define the identity of the package.
PACKAGE='stressapptest'
- VERSION='1.0.0_autoconf'
+ VERSION='1.0.1_autoconf'
cat >>confdefs.h <<_ACEOF
# Checks for programs.
+# Don't generate CXXFLAGS defaults: if CXXFLAGS are unset
+# AC_PROG_CXX will override them with unwanted defaults.
+CXXFLAGS="$CXXFLAGS"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to opensource@gmail.com ##
-## ----------------------------------- ##
+## ------------------------------------ ##
+## Report this to opensource@google.com ##
+## ------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to opensource@gmail.com ##
-## ----------------------------------- ##
+## ------------------------------------ ##
+## Report this to opensource@google.com ##
+## ------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by stressapptest $as_me 1.0.0_autoconf, which was
+This file was extended by stressapptest $as_me 1.0.1_autoconf, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-stressapptest config.status 1.0.0_autoconf
+stressapptest config.status 1.0.1_autoconf
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
AC_PREREQ(2.61)
-AC_INIT(stressapptest, 1.0.0_autoconf, opensource@gmail.com)
+AC_INIT(stressapptest, 1.0.1_autoconf, opensource@google.com)
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
# Checking for target cpu and setting custom configuration
# for the different platforms
AC_CANONICAL_TARGET
;;
esac
+_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")
+ OS_VERSION=linux
+ AC_DEFINE([STRESSAPPTEST_OS_LINUX],[],
+ [Defined if the target OS is Linux])
+ ;;
+ "Darwin")
+ OS_VERSION=macosx
+ AC_DEFINE([STRESSAPPTEST_OS_DARWIN],[],
+ [Defined if the target OS is OSX])
+ ;;
+ "FreeBSD")
+ OS_VERSION=bsd
+ AC_DEFINE([STRESSAPPTEST_OS_BSD],[],
+ [Defined if the target OS is BSD based])
+ ;;
+ "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
+
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADER([src/stressapptest_config.h])
# Checks for programs.
+# Don't generate CXXFLAGS defaults: if CXXFLAGS are unset
+# AC_PROG_CXX will override them with unwanted defaults.
+CXXFLAGS="$CXXFLAGS"
AC_PROG_CXX
AC_PROG_CC
AC_MSG_RESULT([$timestamp])
AC_DEFINE_UNQUOTED([STRESSAPPTEST_TIMESTAMP],
- "$username @ $hostname on $timestamp",
+ "$username @ $hostname on $timestamp",
[Timestamp when ./configure was executed])
#Default cxxflags
pthread_header="#include<pthread.h>"
pthread_body="pthread_create(0,0,0,0)"
# Check if compile with no extra argument
-AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
+AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
pthread_arg="")
if test x"$pthread_arg" = x"not_available"; then
bkp_LDFLAGS="$LDFLAGS"
for altheader in -pthread; do
LDFLAGS="$bkp_LDFLAGS $altheader"
- AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM($pthread_header, $pthread_body)],
pthread_arg="$altheader")
LDFLAGS="$bkp_LDFLAGS"
done
queue_metric_ = kTouch;
{ // Init all the page locks.
- for (int64 i = 0; i < q_size_; i++)
- pthread_mutex_init(&(pagelocks_[i]), NULL);
+ for (int64 i = 0; i < q_size_; i++) {
+ pthread_mutex_init(&(pagelocks_[i]), NULL);
+ // Pages start out owned (locked) by Sat::InitializePages.
+ // A locked state indicates that the page state is unknown,
+ // and the lock should not be aquired. As InitializePages creates
+ // the page records, they will be inserted and unlocked, at which point
+ // they are ready to be aquired and filled by worker threads.
+ sat_assert(pthread_mutex_lock(&(pagelocks_[i])) == 0);
+ }
}
{ // Init the random number generator.
// Copyright 2006 Google Inc. All Rights Reserved.
-// Author: nsanders
-//
-// os.cc : os and machine specific implementation
-// Copyright 2006 Google Inc.
-// for open source release under GPL
+// Author: nsanders, menderico
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+// os.cc : os and machine specific implementation
// This file includes an abstracted interface
// for linux-distro specific and HW specific
// interfaces.
// Machine type detected. Can we implement all these functions correctly?
bool OsLayer::IsSupported() {
+ if (kOpenSource) {
+ // There are no explicitly supported systems in open source version.
+ return true;
+ }
+
// This is the default empty implementation.
- // SAT won't really run correctly.
+ // SAT won't report full error information.
return false;
}
inline static void FastFlush(void *vaddr) {
#ifdef STRESSAPPTEST_CPU_PPC
asm volatile("dcbf 0,%0; sync" : : "r" (vaddr));
-#else
+#elif defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
// Put mfence before and after clflush to make sure:
// 1. The write before the clflush is committed to memory bus;
// 2. The read after the clflush is hitting the memory bus.
asm volatile("mfence");
asm volatile("clflush (%0)" :: "r" (vaddr));
asm volatile("mfence");
+#else
+ #warning "Unsupported CPU type: Unable to force cache flushes."
#endif
}
inline static uint64 GetTimestamp(void) {
uint64 tsc;
#ifdef STRESSAPPTEST_CPU_PPC
- uint32 tbl, tbu, temp;
- __asm __volatile(
- "1:\n"
- "mftbu %2\n"
- "mftb %0\n"
- "mftbu %1\n"
- "cmpw %2,%1\n"
- "bne 1b\n"
- : "=r"(tbl), "=r"(tbu), "=r"(temp)
- :
- : "cc");
-
- tsc = (static_cast<uint64>(tbu) << 32) | static_cast<uint64>(tbl);
-#else
+ uint32 tbl, tbu, temp;
+ __asm __volatile(
+ "1:\n"
+ "mftbu %2\n"
+ "mftb %0\n"
+ "mftbu %1\n"
+ "cmpw %2,%1\n"
+ "bne 1b\n"
+ : "=r"(tbl), "=r"(tbu), "=r"(temp)
+ :
+ : "cc");
+
+ tsc = (static_cast<uint64>(tbu) << 32) | static_cast<uint64>(tbl);
+#elif defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
datacast_t data;
__asm __volatile("rdtsc" : "=a" (data.l32.l), "=d"(data.l32.h));
tsc = data.l64;
-
+#else
+ #warning "Unsupported CPU type: your build may not function correctly"
+ tsc = 0;
#endif
return (tsc);
}
return "open source release";
}
+static const bool kOpenSource = true;
#else
+static const bool kOpenSource = false;
#include "googlesattypes.h"
#endif
// Workaround to allow 32/64 bit conversion
/* Defined if the target CPU is x86_64 */
#undef STRESSAPPTEST_CPU_X86_64
+/* Defined if the target OS is BSD based */
+#undef STRESSAPPTEST_OS_BSD
+
+/* Defined if the target OS is OSX */
+#undef STRESSAPPTEST_OS_DARWIN
+
+/* Defined if the target OS is Linux */
+#undef STRESSAPPTEST_OS_LINUX
+
/* Timestamp when ./configure was executed */
#undef STRESSAPPTEST_TIMESTAMP
// stress the system
#include <errno.h>
-#include <malloc.h>
#include <pthread.h>
#include <sched.h>
#include <signal.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <linux/unistd.h> // for gettid
+
// For size of block device
#include <sys/ioctl.h>
#include <linux/fs.h>
// Syscalls
// Why ubuntu, do you hate gettid so bad?
#if !defined(__NR_gettid)
-# define __NR_gettid 224
+ #define __NR_gettid 224
#endif
#define gettid() syscall(__NR_gettid)
// Get HW core ID from cpuid instruction.
inline int apicid(void) {
int cpu;
-#ifdef STRESSAPPTEST_CPU_PPC
- cpu = 0;
-#else
+#if defined(STRESSAPPTEST_CPU_X86_64) || defined(STRESSAPPTEST_CPU_I686)
__asm __volatile("cpuid" : "=b" (cpu) : "a" (1) : "cx", "dx");
+#else
+ #warning "Unsupported CPU type: unable to determine core ID."
+ cpu = 0;
#endif
return (cpu >> 24);
}
pass_ = 0;
page_io_ = true;
crc_page_ = -1;
+ local_page_ = NULL;
}
// If file thread used bounce buffer in memory, account for the extra
(error->vaddr), 1);
logprintf(priority,
- "%s: miscompare on CPU %d(%x) at %p(0x%llx:%s): "
+ "%s: miscompare on CPU %d(0x%x) at %p(0x%llx:%s): "
"read:0x%016llx, reread:0x%016llx expected:0x%016llx\n",
message,
apic_id,
// Report parseable error.
if (priority < 5) {
logprintf(priority,
- "%s: Tag from %p(0x%llx:%s) (%s) miscompare on CPU %d(%x) at "
- "%p(0x%llx:%s): "
+ "%s: Tag from %p(0x%llx:%s) (%s) "
+ "miscompare on CPU %d(0x%x) at %p(0x%llx:%s): "
"read:0x%016llx, reread:0x%016llx expected:0x%016llx\n",
message,
error->tagvaddr, error->tagpaddr,
tag_dimm_string,
- read_error?"read error":"write error",
+ read_error ? "read error" : "write error",
apic_id,
cpumask,
error->vaddr,
blocksize,
currentblock * blocksize, 0);
if (errorcount == 0) {
- logprintf(0, "Process Error: CrcCopyPage CRC mismatch %s != %s, "
+ int apic_id = apicid();
+ uint32 cpumask = CurrentCpus();
+ logprintf(0, "Process Error: CPU %d(0x%x) CrcCopyPage "
+ "CRC mismatch %s != %s, "
"but no miscompares found on second pass.\n",
+ apic_id, cpumask,
crc.ToHexString().c_str(),
expectedcrc->ToHexString().c_str());
+ struct ErrorRecord er;
+ er.actual = sourcemem[0];
+ er.expected = 0x0;
+ er.vaddr = sourcemem;
+ ProcessError(&er, 0, "Hardware Error");
}
}
}
return 1;
}
-
-
// Memory invert work loop. Execute until marked done.
int InvertThread::Work() {
struct page_entry src;
return true;
}
-
-
// Get memory for an incoming data transfer..
bool FileThread::PagePrepare() {
// We can only do direct IO to SAT pages if it is normal mem.
// Init a local buffer if we need it.
if (!page_io_) {
- local_page_ = static_cast<void*>(memalign(512, sat_->page_length()));
- if (!local_page_) {
- logprintf(0, "Process Error: disk thread memalign returned 0\n");
+ int result = posix_memalign(&local_page_, 512, sat_->page_length());
+ if (result) {
+ logprintf(0, "Process Error: disk thread posix_memalign "
+ "returned %d (fail)\n",
+ result);
status_ += 1;
return false;
}
return 0;
// Loop until done.
- int result = 1;
int64 loops = 0;
// Init a local buffer for storing data.
- void *local_page = static_cast<void*>(memalign(512, sat_->page_length()));
- if (!local_page) {
- logprintf(0, "Process Error: Net Slave thread memalign returned 0\n");
+ void *local_page = NULL;
+ int result = posix_memalign(&local_page, 512, sat_->page_length());
+ if (result) {
+ logprintf(0, "Process Error: net slave posix_memalign "
+ "returned %d (fail)\n",
+ result);
status_ += 1;
- return 0;
+ return false;
}
struct page_entry page;
}
pages_copied_ = loops;
- status_ = result;
+ // No results provided from this type of thread.
+ status_ = 1;
// Clean up.
CloseSocket(sock);
"Log: Completed %d: network slave thread status %d, "
"%d pages copied\n",
thread_num_, status_, pages_copied_);
- return result;
+ return status_;
}
// Thread work loop. Execute until marked finished.
aio_ctx_ = 0;
block_table_ = block_table;
update_block_table_ = 1;
+
+ block_buffer_ = NULL;
}
DiskThread::~DiskThread() {
// Allocate a block buffer aligned to 512 bytes since the kernel requires it
// when using direst IO.
- block_buffer_ = memalign(kBufferAlignment, write_block_size_);
- if (block_buffer_ == NULL) {
+
+ int result = posix_memalign(&block_buffer_, kBufferAlignment,
+ sat_->page_length());
+ if (result) {
CloseDevice(fd);
logprintf(0, "Process Error: Unable to allocate memory for buffers "
- "for disk %s (thread %d).\n",
- device_name_.c_str(), thread_num_);
- return 0;
+ "for disk %s (thread %d) posix memalign returned %d.\n",
+ device_name_.c_str(), thread_num_, result);
+ status_ += 1;
+ return false;
}
if (io_setup(5, &aio_ctx_)) {