inst_mode.cc 937 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "log.h"
  2. #include "inst_mode.h"
  3. const char * inst_mode_names[] = {
  4. "INVALID", "DETAILED", "CACHE_ONLY", "FAST_FORWARD"
  5. };
  6. // Instrumentation modes
  7. InstMode::inst_mode_t InstMode::inst_mode_init = InstMode::INVALID;
  8. InstMode::inst_mode_t InstMode::inst_mode_roi = InstMode::INVALID;
  9. InstMode::inst_mode_t InstMode::inst_mode_end = InstMode::INVALID;
  10. // Initial instrumentation mode
  11. InstMode::inst_mode_t InstMode::inst_mode = InstMode::INVALID;
  12. __attribute__((weak)) void
  13. InstMode::updateInstrumentationMode()
  14. {
  15. LOG_PRINT_ERROR("%s: This version of this function should not be called", __FUNCTION__);
  16. }
  17. InstMode::inst_mode_t
  18. InstMode::fromString(const String str)
  19. {
  20. if (str == "cache_only")
  21. return CACHE_ONLY;
  22. else if (str == "detailed")
  23. return DETAILED;
  24. else if (str == "fast_forward")
  25. return FAST_FORWARD;
  26. else
  27. LOG_PRINT_ERROR("Invalid instrumentation mode %s", str.c_str());
  28. }