WaitCounterDynamicBackend.h 662 B

123456789101112131415161718192021
  1. #pragma once
  2. #include <cstdint>
  3. #include <string_view>
  4. namespace c10::monitor::detail {
  5. struct WaitCounterDynamicBackend {
  6. void* self{nullptr};
  7. intptr_t (*start)(void* self, int64_t nowUs){nullptr};
  8. void (*stop)(void* self, int64_t nowUs, intptr_t ctx){nullptr};
  9. void (*destroy)(void* self){nullptr};
  10. };
  11. using WaitCounterDynamicBackendInit =
  12. void (*)(WaitCounterDynamicBackend*, const char* key, std::size_t keyLen);
  13. // This name needs to be updated if anything in the API above is changed.
  14. constexpr std::string_view kWaitCounterDynamicBackendInitFn =
  15. "c10_monitor_wait_counter_dynamic_backend_init_v1";
  16. } // namespace c10::monitor::detail