@@ -26,10 +26,10 @@ namespace SST {
2626namespace Profile {
2727
2828
29- class ClockHandlerProfileTool : public HandlerProfileToolAPI
29+ class ClockHandlerProfileTool : public ProfileTool , public Clock ::HandlerBase::AttachPoint
3030{
3131public:
32- SST_ELI_REGISTER_PROFILETOOL_DERIVED_API (SST::Profile::ClockHandlerProfileTool, SST::HandlerProfileToolAPI , Params&)
32+ SST_ELI_REGISTER_PROFILETOOL_DERIVED_API (SST::Profile::ClockHandlerProfileTool, SST::Profile::ProfileTool , Params&)
3333
3434 SST_ELI_DOCUMENT_PARAMS (
3535 { " level" , " Level at which to track profile (global, type, component, subcomponent)" , " type" },
@@ -39,8 +39,13 @@ class ClockHandlerProfileTool : public HandlerProfileToolAPI
3939
4040 ClockHandlerProfileTool (const std::string& name, Params& params);
4141
42+ // Default implementations of attach point functions for profile
43+ // tools that don't use them
44+ void beforeHandler (uintptr_t UNUSED (key), const Cycle_t& UNUSED(cycle)) override {}
45+ void afterHandler (uintptr_t UNUSED (key), const bool& UNUSED(remove)) override {}
46+
4247protected:
43- std::string getKeyForHandler (const HandlerMetaData & mdata);
48+ std::string getKeyForHandler (const AttachPointMetaData & mdata);
4449
4550 Profile_Level profile_level_;
4651};
@@ -66,9 +71,9 @@ class ClockHandlerProfileToolCount : public ClockHandlerProfileTool
6671
6772 virtual ~ClockHandlerProfileToolCount () {}
6873
69- uintptr_t registerHandler (const HandlerMetaData & mdata) override ;
74+ uintptr_t registerHandler (const AttachPointMetaData & mdata) override ;
7075
71- void handlerStart (uintptr_t key) override ;
76+ void beforeHandler (uintptr_t key, const Cycle_t& cycle ) override ;
7277
7378 void outputData (FILE* fp) override ;
7479
@@ -96,11 +101,11 @@ class ClockHandlerProfileToolTime : public ClockHandlerProfileTool
96101
97102 virtual ~ClockHandlerProfileToolTime () {}
98103
99- uintptr_t registerHandler (const HandlerMetaData & mdata) override ;
104+ uintptr_t registerHandler (const AttachPointMetaData & mdata) override ;
100105
101- void handlerStart (uintptr_t UNUSED (key)) override { start_time_ = T::now (); }
106+ void beforeHandler (uintptr_t UNUSED (key), const Cycle_t& UNUSED(cycle )) override { start_time_ = T::now (); }
102107
103- void handlerEnd (uintptr_t key) override
108+ void afterHandler (uintptr_t key, const bool & UNUSED (remove) ) override
104109 {
105110 auto total_time = T::now () - start_time_;
106111 clock_data_t * entry = reinterpret_cast <clock_data_t *>(key);
0 commit comments