36class ClockHandlerProfileTool :
public ProfileTool,
public Clock::HandlerBase::AttachPoint
41 SST_ELI_DOCUMENT_PARAMS(
42 {
"level",
"Level at which to track profile (global, type, component, subcomponent)",
"type" },
45 enum class Profile_Level { Global, Type,
Component, Subcomponent };
47 ClockHandlerProfileTool(
const std::string& name,
Params& params);
51 void beforeHandler(uintptr_t UNUSED(key),
const Cycle_t& UNUSED(cycle))
override {}
52 void afterHandler(uintptr_t UNUSED(key),
const bool& UNUSED(remove))
override {}
57 Profile_Level profile_level_;
96class ClockHandlerProfileToolTime :
public ClockHandlerProfileTool
110 ClockHandlerProfileToolTime(
const std::string& name,
Params& params);
112 virtual ~ClockHandlerProfileToolTime() {}
116 void beforeHandler(uintptr_t UNUSED(key),
const Cycle_t& UNUSED(cycle))
override { start_time_ = T::now(); }
118 void afterHandler(uintptr_t key,
const bool& UNUSED(remove))
override
120 auto total_time = T::now() - start_time_;
121 clock_data_t* entry =
reinterpret_cast<clock_data_t*
>(key);
122 entry->time += std::chrono::duration_cast<std::chrono::nanoseconds>(total_time).count();
129 typename T::time_point start_time_;
130 std::map<std::string, clock_data_t> times_;