28class ClockHandlerProfileTool :
public ProfileTool,
public Clock::HandlerBase::AttachPoint
33 SST_ELI_DOCUMENT_PARAMS(
34 {
"level",
"Level at which to track profile (global, type, component, subcomponent)",
"type" },
37 enum class Profile_Level { Global, Type,
Component, Subcomponent };
39 ClockHandlerProfileTool(
const std::string& name,
Params& params);
43 void beforeHandler(uintptr_t UNUSED(key),
const Cycle_t& UNUSED(cycle))
override {}
44 void afterHandler(uintptr_t UNUSED(key),
const bool& UNUSED(remove))
override {}
49 Profile_Level profile_level_;
88class ClockHandlerProfileToolTime :
public ClockHandlerProfileTool
102 ClockHandlerProfileToolTime(
const std::string& name,
Params& params);
104 virtual ~ClockHandlerProfileToolTime() {}
108 void beforeHandler(uintptr_t UNUSED(key),
const Cycle_t& UNUSED(cycle))
override { start_time_ = T::now(); }
110 void afterHandler(uintptr_t key,
const bool& UNUSED(remove))
override
112 auto total_time = T::now() - start_time_;
113 clock_data_t* entry =
reinterpret_cast<clock_data_t*
>(key);
114 entry->time += std::chrono::duration_cast<std::chrono::nanoseconds>(total_time).count();
118 void outputData(FILE* fp)
override;
121 typename T::time_point start_time_;
122 std::map<std::string, clock_data_t> times_;