54 std::to_string(time_ps) +
")");
60 std::lock_guard<std::mutex> lock(sync);
68 std::lock_guard<std::mutex> lock(sync);
71 [&](
const auto &unknown)
73 for (const auto &rm : remove_triggers)
75 if (unknown.second == rm.second)
85 if (!unknown_triggers.empty())
87 for (
auto &it : unknown_triggers)
89 if (it.first.check(time_ps,
this))
103bool Injector::instructionAccurateCallback(
uint64_t time_ps)
107 std::to_string(time_ps) +
")");
109 return cycleAccurateCallback(time_ps);
111#if CXX0X_UP_SUPPORTED
116bool operator==(
const std::shared_ptr<T> &p1,
const T *
const &p2)
118 return p1.get() == p2;
122std::string Injector::getInjectorPath()
125 ptr iptr = getParentInjector();
143 std::cout <<
"Injector::getInjectorPath: Failed to find injector" << std::endl;
162 path = name +
"::" + path;
170 std::cout <<
"Injector::getInjectorPath: Failed to find injector" << std::endl;
187 ", fault_id=" + std::to_string(fault_id) +
")");
188#if CXX0X_UP_SUPPORTED
189 std::lock_guard<std::mutex> lock(sync);
193 if (acceleratedTrigger(t, fault_id))
200 pending_triggers.push_back(std::pair<Trigger, int32_t>(t, fault_id));
201 has_pending_triggers =
true;
208 ", fault_id=" + std::to_string(fault_id) +
")");
209#if CXX0X_UP_SUPPORTED
210 std::lock_guard<std::mutex> lock(sync);
212 remove_triggers.push_back(std::pair<Trigger, int32_t>(t, fault_id));
213 has_remove_triggers =
true;
219 t.
toString() +
", fault_id=" + std::to_string(fault_id) +
")");
contains an action class that describes actions associated with a fault
contains the fault container class that stores triggers and actions for fault injection
contains the fault injector interface class.
general configuration and logging
contains the stressor class that loads and activates faults.
contains the Trigger class that defines conditions under which actions of a Fault need to be applied.
static __inline__ uint64_t
static __inline__ int32_t
virtual ptr getParentInjector()=0
get a the parent injector (root returns 0).
virtual void freeFastFieldAccessPtr(void *)
MUST be called to cleanup a pointer acquired with fastFieldAccessPtr() default implementation is nop.
virtual bool needsCallbacks()
bool has_pending_triggers
virtual ptr getSubInjector(const std::string &name)=0
get a sub injector.
std::list< std::pair< Trigger, int32_t > > remove_triggers
Triggers to synchronously remove on next callback (prio over pending)
virtual std::list< std::string > listSubInjectors()=0
list all sub injectors.
std::list< std::pair< Trigger, int32_t > > unknown_triggers
Triggers to look at in callbacks.
virtual bool cycleAccurateCallback(uint64_t time_ps)
std::list< std::pair< Trigger, int32_t > > pending_triggers
Triggers which were just added.
static bool firedTrigger(const Trigger &firedTrigger, int32_t fault_id, Injector *injector, uint64_t time_ps)
Checks if the given trigger is valid and calls applyAction.
std::string toString() const
operator<< can be used.
void log(Verbosity level, std::string msg)
write log message at the given level.