sampling_provider.cc 433 B

1234567891011121314151617181920
  1. #include "sampling_provider.h"
  2. #include "simulator.h"
  3. #include "config.hpp"
  4. #include "log.h"
  5. #include "instr_count_sampling.h"
  6. SamplingProvider*
  7. SamplingProvider::create()
  8. {
  9. String sampling_type = Sim()->getCfg()->getString("sampling/type");
  10. if (sampling_type == "instr_count")
  11. {
  12. return new InstrCountSampling();
  13. }
  14. else
  15. {
  16. LOG_PRINT_ERROR("Unexpected sampling type '%s'", sampling_type.c_str());
  17. }
  18. }