From ce38da26d03136fa34763751181c48c5e35d1fa4 Mon Sep 17 00:00:00 2001 From: adrian Date: Thu, 17 May 2012 17:36:38 +0000 Subject: [PATCH] Renamed AspectConfig.hpp.in -> FailConfig.hpp.in, updated files accordingly. git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1247 8c4709b5-6ec9-48aa-a5cd-a96041d1645a --- core/SAL/bochs/Breakpoints.ah | 2 +- core/SAL/bochs/GuestSysCom.ah | 2 +- core/SAL/bochs/Interrupt.ah | 2 +- core/SAL/bochs/Interrupt_suppression.ah | 2 +- core/SAL/bochs/Jump.ah | 2 +- core/SAL/bochs/JumpToPreviousCtx.ah | 2 +- core/SAL/bochs/MemAccessBitFlip.ah | 2 +- core/SAL/bochs/MemEvents.ah | 2 +- core/SAL/bochs/Trap.ah | 2 +- core/SAL/bochs/disable_keyboard_interrupt.ah | 2 +- core/SAL/bochs/fireInterrupt.ah | 2 +- core/SAL/bochs/reboot.ah | 2 +- core/SAL/bochs/restore.ah | 2 +- core/SAL/bochs/save.ah | 2 +- core/SAL/bochs/stfu.ah | 2 +- core/config/CMakeLists.txt | 4 +-- ...{AspectConfig.hpp.in => FailConfig.hpp.in} | 6 ++-- .../FaultCoverageExperiment/experiment.hpp | 2 +- .../JumpAndRunExperiment.hpp | 4 +-- core/experiments/attic/MemWriteExperiment.hpp | 4 +-- .../attic/SingleSteppingExperiment.hpp | 4 +-- core/experiments/coolchecksum/experiment.cc | 2 +- core/experiments/fireinterrupt/experiment.cc | 2 +- core/experiments/hscsimple/experiment.cc | 2 +- core/jobserver/JobServer.cc | 33 +++++++++++++++++++ core/jobserver/JobServer.hpp | 27 +++++++++++++-- doc/todo.txt | 2 +- 27 files changed, 88 insertions(+), 34 deletions(-) rename core/config/{AspectConfig.hpp.in => FailConfig.hpp.in} (88%) diff --git a/core/SAL/bochs/Breakpoints.ah b/core/SAL/bochs/Breakpoints.ah index 72e3a7cf..4127884b 100644 --- a/core/SAL/bochs/Breakpoints.ah +++ b/core/SAL/bochs/Breakpoints.ah @@ -1,7 +1,7 @@ #ifndef __BREAKPOINTS_AH__ #define __BREAKPOINTS_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_EVENT_BREAKPOINTS diff --git a/core/SAL/bochs/GuestSysCom.ah b/core/SAL/bochs/GuestSysCom.ah index 4a9db0f1..11e0da1c 100644 --- a/core/SAL/bochs/GuestSysCom.ah +++ b/core/SAL/bochs/GuestSysCom.ah @@ -1,7 +1,7 @@ #ifndef __GUESTSYS_COM_AH__ #define __GUESTSYS_COM_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_EVENT_GUESTSYS diff --git a/core/SAL/bochs/Interrupt.ah b/core/SAL/bochs/Interrupt.ah index 578c3d21..07461cd1 100644 --- a/core/SAL/bochs/Interrupt.ah +++ b/core/SAL/bochs/Interrupt.ah @@ -1,7 +1,7 @@ #ifndef __INTERRUPT_AH__ #define __INTERRUPT_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_EVENT_INTERRUPT diff --git a/core/SAL/bochs/Interrupt_suppression.ah b/core/SAL/bochs/Interrupt_suppression.ah index cc62d4b3..2a74ec53 100644 --- a/core/SAL/bochs/Interrupt_suppression.ah +++ b/core/SAL/bochs/Interrupt_suppression.ah @@ -1,7 +1,7 @@ #ifndef __INTERRUPT_SUPPRESSION_AH__ #define __INTERRUPT_SUPPRESSION_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_SUPPRESS_INTERRUPTS diff --git a/core/SAL/bochs/Jump.ah b/core/SAL/bochs/Jump.ah index a9703d6c..8fecc34a 100644 --- a/core/SAL/bochs/Jump.ah +++ b/core/SAL/bochs/Jump.ah @@ -1,7 +1,7 @@ #ifndef __JUMP_AH__ #define __JUMP_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_EVENT_JUMP diff --git a/core/SAL/bochs/JumpToPreviousCtx.ah b/core/SAL/bochs/JumpToPreviousCtx.ah index ac985c88..52fadf70 100644 --- a/core/SAL/bochs/JumpToPreviousCtx.ah +++ b/core/SAL/bochs/JumpToPreviousCtx.ah @@ -1,7 +1,7 @@ #ifndef __JUMP_TO_PREVIOUS_CTX_AH__ #define __JUMP_TO_PREVIOUS_CTX_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #if 0 // #if defined(CONFIG_SR_RESTORE) || defined(CONFIG_SR_REBOOT) diff --git a/core/SAL/bochs/MemAccessBitFlip.ah b/core/SAL/bochs/MemAccessBitFlip.ah index 9bdbb7b8..46cdfc43 100644 --- a/core/SAL/bochs/MemAccessBitFlip.ah +++ b/core/SAL/bochs/MemAccessBitFlip.ah @@ -1,7 +1,7 @@ #ifndef __MEM_ACCESS_BIT_FLIP_AH__ #define __MEM_ACCESS_BIT_FLIP_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_FI_MEM_ACCESS_BITFLIP diff --git a/core/SAL/bochs/MemEvents.ah b/core/SAL/bochs/MemEvents.ah index 96983e56..e64fd078 100644 --- a/core/SAL/bochs/MemEvents.ah +++ b/core/SAL/bochs/MemEvents.ah @@ -2,7 +2,7 @@ #define __MEM_EVENTS_AH__ #include -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #if defined(CONFIG_EVENT_MEMREAD) || defined(CONFIG_EVENT_MEMWRITE) diff --git a/core/SAL/bochs/Trap.ah b/core/SAL/bochs/Trap.ah index ff020d7d..bc767adf 100644 --- a/core/SAL/bochs/Trap.ah +++ b/core/SAL/bochs/Trap.ah @@ -1,7 +1,7 @@ #ifndef __TRAP_AH__ #define __TRAP_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_EVENT_TRAP diff --git a/core/SAL/bochs/disable_keyboard_interrupt.ah b/core/SAL/bochs/disable_keyboard_interrupt.ah index 94577dc6..a517727b 100644 --- a/core/SAL/bochs/disable_keyboard_interrupt.ah +++ b/core/SAL/bochs/disable_keyboard_interrupt.ah @@ -1,7 +1,7 @@ #ifndef __DISABLE_KEYBOARD_INTERRUPT_AH__ #define __DISABLE_KEYBOARD_INTERRUPT_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_DISABLE_KEYB_INTERRUPTS diff --git a/core/SAL/bochs/fireInterrupt.ah b/core/SAL/bochs/fireInterrupt.ah index 68b60bb5..dc528547 100644 --- a/core/SAL/bochs/fireInterrupt.ah +++ b/core/SAL/bochs/fireInterrupt.ah @@ -1,7 +1,7 @@ #ifndef __FIREINTERRUPT_AH__ #define __FIREINTERRUPT_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_FIRE_INTERRUPTS diff --git a/core/SAL/bochs/reboot.ah b/core/SAL/bochs/reboot.ah index f7e96bff..2b354e8f 100644 --- a/core/SAL/bochs/reboot.ah +++ b/core/SAL/bochs/reboot.ah @@ -1,7 +1,7 @@ #ifndef __REBOOT_AH__ #define __REBOOT_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #include "../SALInst.hpp" #ifdef CONFIG_SR_REBOOT diff --git a/core/SAL/bochs/restore.ah b/core/SAL/bochs/restore.ah index b43f0853..8d91d164 100644 --- a/core/SAL/bochs/restore.ah +++ b/core/SAL/bochs/restore.ah @@ -2,7 +2,7 @@ #define __RESTORE_AH__ #include -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #include "../SALInst.hpp" #ifdef CONFIG_SR_RESTORE diff --git a/core/SAL/bochs/save.ah b/core/SAL/bochs/save.ah index 160eb58b..9402524e 100644 --- a/core/SAL/bochs/save.ah +++ b/core/SAL/bochs/save.ah @@ -1,7 +1,7 @@ #ifndef __SAVE_AH__ #define __SAVE_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_SR_SAVE diff --git a/core/SAL/bochs/stfu.ah b/core/SAL/bochs/stfu.ah index 9d8acba6..31096a54 100644 --- a/core/SAL/bochs/stfu.ah +++ b/core/SAL/bochs/stfu.ah @@ -1,7 +1,7 @@ #ifndef __NONVERBOSE_AH__ #define __NONVERBOSE_AH__ -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #ifdef CONFIG_STFU diff --git a/core/config/CMakeLists.txt b/core/config/CMakeLists.txt index 7eb0f2fc..1d59508f 100644 --- a/core/config/CMakeLists.txt +++ b/core/config/CMakeLists.txt @@ -18,5 +18,5 @@ OPTION(CONFIG_FIRE_INTERRUPTS "Target backend: Fire interrupts" OFF) OPTION(CONFIG_DISABLE_KEYB_INTERRUPTS "Target backend: Suppress keyboard interrupts" OFF) OPTION(CONFIG_FI_MEM_ACCESS_BITFLIP "deprecated something" OFF) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AspectConfig.hpp.in - ${CMAKE_CURRENT_BINARY_DIR}/AspectConfig.hpp) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FailConfig.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/FailConfig.hpp) diff --git a/core/config/AspectConfig.hpp.in b/core/config/FailConfig.hpp.in similarity index 88% rename from core/config/AspectConfig.hpp.in rename to core/config/FailConfig.hpp.in index ea030bac..553bb925 100644 --- a/core/config/AspectConfig.hpp.in +++ b/core/config/FailConfig.hpp.in @@ -1,5 +1,5 @@ -#ifndef __ASPECT_CONFIG_HPP__ - #define __ASPECT_CONFIG_HPP__ +#ifndef __FAIL_CONFIG_HPP__ + #define __FAIL_CONFIG_HPP__ // #define / #undef the following configuration macros to enable/disable the // various event sources, fault injection sinks, and miscellaneous other @@ -28,4 +28,4 @@ // Fault injection #cmakedefine CONFIG_FI_MEM_ACCESS_BITFLIP -#endif /* __ASPECT_CONFIG_HPP__ */ +#endif /* __FAIL_CONFIG_HPP__ */ diff --git a/core/experiments/FaultCoverageExperiment/experiment.hpp b/core/experiments/FaultCoverageExperiment/experiment.hpp index 3fb9a827..059e705b 100644 --- a/core/experiments/FaultCoverageExperiment/experiment.hpp +++ b/core/experiments/FaultCoverageExperiment/experiment.hpp @@ -4,7 +4,7 @@ #include #include -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #include "controller/ExperimentFlow.hpp" #define INST_ADDR_FUNC_START 0x4ae6 diff --git a/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp b/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp index 06e517dc..638e4a24 100644 --- a/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp +++ b/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp @@ -9,11 +9,11 @@ #include "../controller/ExperimentFlow.hpp" #include "../SAL/SALInst.hpp" #include "../SAL/bochs/BochsRegister.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" // Check if aspect dependencies are satisfied: #if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_JUMP) - #error Breakpoint- and jump-events needed! Enable aspects first (see AspectConfig.hpp)! + #error Breakpoint- and jump-events needed! Enable aspects first (see FailConfig.hpp)! #endif using namespace fi; diff --git a/core/experiments/attic/MemWriteExperiment.hpp b/core/experiments/attic/MemWriteExperiment.hpp index 8abf5335..28461c82 100644 --- a/core/experiments/attic/MemWriteExperiment.hpp +++ b/core/experiments/attic/MemWriteExperiment.hpp @@ -8,11 +8,11 @@ #include "../controller/ExperimentFlow.hpp" #include "../SAL/SALInst.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" // Check aspect dependencies: #if !defined(CONFIG_EVENT_CPULOOP) || !defined(CONFIG_EVENT_MEMACCESS) || !defined(CONFIG_SR_SAVE) || !defined(CONFIG_FI_MEM_ACCESS_BITFLIP) - #error Event dependecies not satisfied! Enabled needed aspects in AspectConfig.hpp! + #error Event dependecies not satisfied! Enabled needed aspects in FailConfig.hpp! #endif using namespace fi; diff --git a/core/experiments/attic/SingleSteppingExperiment.hpp b/core/experiments/attic/SingleSteppingExperiment.hpp index 63f7f277..8d22d8c0 100644 --- a/core/experiments/attic/SingleSteppingExperiment.hpp +++ b/core/experiments/attic/SingleSteppingExperiment.hpp @@ -8,12 +8,12 @@ #include "../controller/ExperimentFlow.hpp" #include "../SAL/SALInst.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #include "../SAL/bochs/BochsRegister.hpp" // Check if aspect dependency is satisfied: #ifndef CONFIG_EVENT_CPULOOP - #error Breakpoint-events needed! Enable aspect first (see AspectConfig.hpp)! + #error Breakpoint-events needed! Enable aspect first (see FailConfig.hpp)! #endif using namespace fi; diff --git a/core/experiments/coolchecksum/experiment.cc b/core/experiments/coolchecksum/experiment.cc index f16253db..58393b88 100644 --- a/core/experiments/coolchecksum/experiment.cc +++ b/core/experiments/coolchecksum/experiment.cc @@ -11,7 +11,7 @@ #include "SAL/Memory.hpp" #include "SAL/bochs/BochsRegister.hpp" #include "controller/Event.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" #if COOL_FAULTSPACE_PRUNING #include "plugins/tracing/TracingPlugin.hpp" diff --git a/core/experiments/fireinterrupt/experiment.cc b/core/experiments/fireinterrupt/experiment.cc index 89b65eb5..76bdaed9 100644 --- a/core/experiments/fireinterrupt/experiment.cc +++ b/core/experiments/fireinterrupt/experiment.cc @@ -6,7 +6,7 @@ #include "SAL/bochs/BochsRegister.hpp" #include "controller/Event.hpp" #include "util/Logger.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" // Check if configuration dependencies are satisfied: #if !defined(CONFIG_EVENT_BREAKPOINTS) || !defined(CONFIG_DISABLE_KEYB_INTERRUPTS) || !defined(CONFIG_FIRE_INTERRUPTS) diff --git a/core/experiments/hscsimple/experiment.cc b/core/experiments/hscsimple/experiment.cc index 838ed9be..5dbffbdd 100644 --- a/core/experiments/hscsimple/experiment.cc +++ b/core/experiments/hscsimple/experiment.cc @@ -7,7 +7,7 @@ #include "SAL/bochs/BochsRegister.hpp" #include "controller/Event.hpp" #include "util/Logger.hpp" -#include "config/AspectConfig.hpp" +#include "config/FailConfig.hpp" // Check if configuration dependencies are satisfied: #if !defined(CONFIG_EVENT_BREAKPOINTS) || !defined(CONFIG_SR_RESTORE) || !defined(CONFIG_SR_SAVE) diff --git a/core/jobserver/JobServer.cc b/core/jobserver/JobServer.cc index bbd33f41..8bd34580 100644 --- a/core/jobserver/JobServer.cc +++ b/core/jobserver/JobServer.cc @@ -32,6 +32,8 @@ void JobServer::addParam(ExperimentData* exp){ #endif } +volatile unsigned JobServer::m_DoneCount = 0; + ExperimentData *JobServer::getDone() { // FIXME race condition, need to synchronize with @@ -53,6 +55,34 @@ ExperimentData *JobServer::getDone() #endif } +#ifdef SERVER_PERFORMANCE_MEASURE +void JobServer::measure() +{ + cout << "\n[Server] Logging throughput in \"" << PERFORMANCE_LOG_PATH << "\"..." << endl; + ofstream m_file(PERFORMANCE_LOG_PATH, std::ios::trunc); // overwrite existing perf-logs + if(!m_file.is_open()) { + cerr << "[Server] Perf-logging has been enabled" + << "but I was not able to write the log-file \"" + << PERFORMANCE_LOG_PATH << "\"." << endl; + exit(1); + } + unsigned counter = 0; + + m_file << "time\tthroughput" << endl; + unsigned diff = 0; + while(!m_finish) { + // Format: 1st column (seconds)[TAB]2nd column (throughput) + m_file << counter << "\t" << (m_DoneCount - diff) << endl; + counter += PERFORMANCE_STEPPING_SEC; + diff = m_DoneCount; + sleep(PERFORMANCE_STEPPING_SEC); + } + // NOTE: Summing up the values written in the 2nd column does not + // necessarily yield the number of completed experiments/jobs + // (due to thread-scheduling behaviour -> not sync'd!) +} +#endif // SERVER_PERFORMANCE_MEASURE + #ifndef __puma /** * This is a predicate class for the remove_if operator @@ -260,6 +290,9 @@ void CommThread::receiveExperimentResults(Minion& minion, uint32_t workloadID) if(m_js.m_runningJobs.remove(workloadID, exp)) { // ExperimentData* found SocketComm::rcv_msg(minion.getSocketDescriptor(), exp->getMessage() ); // deserialize results. m_js.m_doneJobs.Enqueue(exp); // Put results in done queue.. + #ifdef SERVER_PERFORMANCE_MEASURE + ++JobServer::m_DoneCount; + #endif } else { // We can receive several results for the same workload id because // we (may) distribute the (running) jobs to a *few* experiment-clients. diff --git a/core/jobserver/JobServer.hpp b/core/jobserver/JobServer.hpp index 61a48c6c..f09daa2e 100644 --- a/core/jobserver/JobServer.hpp +++ b/core/jobserver/JobServer.hpp @@ -19,6 +19,11 @@ #include #endif +// TODO: This should be part of a "server-config". +#define SERVER_PERFORMANCE_MEASURE +#define PERFORMANCE_LOG_PATH "perf.dat" +#define PERFORMANCE_STEPPING_SEC 1 + namespace fi { class CommThread; @@ -49,7 +54,14 @@ class JobServer boost::thread* m_serverThread; #endif // puma - + +#ifdef SERVER_PERFORMANCE_MEASURE + static volatile unsigned m_DoneCount; //! the number of finished jobs +#ifndef __puma + boost::thread* m_measureThread; //! the performance measurement thread +#endif +#endif + //! Atomic counter for Workload IDs. SynchronizedCounter m_counter; //! Map of running jobs (referenced by Workload ID @@ -59,11 +71,14 @@ class JobServer //! List of finished experiment results. SynchronizedQueue m_doneJobs; friend class CommThread; //!< CommThread is allowed access the job queues. - public: - JobServer(int port = 1111) : m_port(port), m_finish(false), m_noMoreExps(false), m_maxThreads(128), m_threadtimeout(0) { + JobServer(int port = 1111) : m_port(port), m_finish(false), m_noMoreExps(false), + m_maxThreads(128), m_threadtimeout(0) { #ifndef __puma m_serverThread = new boost::thread(&JobServer::run, this); // run operator()() in a thread. +#ifdef SERVER_PERFORMANCE_MEASURE + m_measureThread = new boost::thread(&JobServer::measure, this); +#endif #endif }; ~JobServer() @@ -71,6 +86,9 @@ public: #ifndef __puma // Cleanup of m_serverThread, etc. delete m_serverThread; +#ifdef SERVER_PERFORMANCE_MEASURE + delete m_measureThread; +#endif #endif // __puma }; @@ -82,6 +100,9 @@ public: * and listen for connections. */ void run(); +#ifdef SERVER_PERFORMANCE_MEASURE + void measure(); +#endif void sendWork(int sockfd); diff --git a/doc/todo.txt b/doc/todo.txt index 6c3f74bf..a3cfdc46 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -156,7 +156,7 @@ Dokumentation: -> siehe fail/experiments/coolchecksum/experiment.cc FIXME am Ende -> Lösung: Löschliste - ggf. zusammen mit Datenstruktur-Implementierungsdetails-TODO (s.u.) angehen - - AspectConfig.hpp in cmake-config einbinden (genauso behandeln wie experiments.hpp!) + - FailConfig.hpp in cmake-config einbinden (genauso behandeln wie experiments.hpp!) -> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt - variant_config.h in cmake-config einbinden (genauso behandeln wie experiments.hpp!) -> generierte Datei landet in Buildtree, wird nicht mehr eingecheckt