Skip to content

How to Create a Custom Fault Injector

Udit kumar agarwal edited this page Sep 18, 2022 · 3 revisions
  1. Under < LLFI_SRC_ROOT >/runtime_lib, create a class that is the child of class HardwareFaultInjector or class SoftwareFaultInjector. You have to implement the injectFault(long llfi_index, unsigned size, unsigned fi_bit,char *buf) in your class.

  2. Register the class with RegisterFaultInjector(). In the registration, you also provide the name to find the fault injector.

  3. Build the < LLFI_SRC_ROOT >/runtime_lib by adding the created file(s) to CMakeLists.txt in that directory, and go to the < LLFI_DST_ROOT > and run make

  4. run the fault injection executable with the custom fault injector. You need to use the option fi_type=<name given in step 2> in llfi.config.runtime.txt to invoke the custom fault injector.

  5. There are some sample fault injectors in < LLFI_SRC_ROOT >/runtime_lib/CommonFaultInjectors.cpp. Play it first to get an idea.

Clone this wiki locally