1 #ifndef FastTimerService_h
2 #define FastTimerService_h
12 #if defined(__APPLE__) || defined(__MACH__)
13 #include <mach/clock.h>
14 #include <mach/mach.h>
15 #endif // defined(__APPLE__) || defined(__MACH__)
21 #include <unordered_map>
266 template <
typename T>
class PathMap :
public std::unordered_map<std::string, T> {};
267 template <
typename T>
class ModuleMap :
public std::unordered_map<edm::ModuleDescription const *, T> {};
413 #if defined(__APPLE__) || defined (__MACH__)
414 clock_serv_t m_clock_port;
415 #endif // defined(__APPLE__) || defined(__MACH__)
419 #if defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0
423 #if defined(__APPLE__) || defined (__MACH__)
424 mach_timespec_t timespec;
425 clock_get_time(m_clock_port, ×pec);
426 stamp.tv_sec = timespec.tv_sec;
427 stamp.tv_nsec = timespec.tv_nsec;
428 #endif // defined(__APPLE__) || defined(__MACH__)
429 #endif // defined(_POSIX_TIMERS) && _POSIX_TIMERS >= 0
432 void start(std::pair<struct timespec, struct timespec> &
times)
const
437 void stop(std::pair<struct timespec, struct timespec> &
times)
const
445 if (second.tv_nsec > first.tv_nsec)
446 return (
double) (second.tv_sec - first.tv_sec) + (
double) (second.tv_nsec - first.tv_nsec) / (
double) 1e9;
448 return (
double) (second.tv_sec - first.tv_sec) - (
double) (first.tv_nsec - second.tv_nsec) / (
double) 1e9;
452 double delta(
const std::pair<struct timespec, struct timespec> &
times)
454 return delta(times.first, times.second);
462 #endif // ! FastTimerService_h
void prePathBeginRun(std::string const &)
std::pair< struct timespec, struct timespec > m_timer_path
const double m_dqm_eventtime_resolution
TProfile * m_dqm_byls_all_endpaths
const bool m_enable_dqm_byluminosity
const uint32_t m_dqm_ls_range
double queryModuleTimeByType(const std::string &) const
ModuleMap< ModuleInfo * > m_fast_moduletypes
TProfile * m_dqm_byls_source
bool m_enable_timing_modules
TProfile * m_dqm_nproc_byls_all_paths
double queryEventTime() const
std::pair< struct timespec, struct timespec > m_timer_event
const clockid_t m_timer_id
TProfile * m_dqm_byls_presource
const double m_dqm_luminosity_resolution
double m_summary_postsource
TProfile * m_dqm_nproc_byls_presource
TH1F * m_dqm_nproc_presource
double queryModuleTimeByLabel(const std::string &) const
TH1F * m_dqm_nproc_interpaths
TProfile * m_dqm_byluminosity_interpaths
TProfile * m_dqm_nproc_byluminosity_source
void preProcessEvent(edm::EventID const &, edm::Timestamp const &)
double summary_postmodules
const bool m_enable_dqm_bypath_counters
void postProcessEvent(edm::Event const &, edm::EventSetup const &)
const bool m_skip_first_path
double m_summary_presource
std::string const * m_last_path
TProfile * m_dqm_nproc_byls_interpaths
TProfile * m_dqm_nproc_byluminosity_postsource
void postModule(edm::ModuleDescription const &)
const bool m_enable_dqm_bypath_exclusive
double queryPathTotalTime(const std::string &) const
std::unordered_map< std::string, ModuleInfo > m_moduletypes
static double delta(const std::pair< struct timespec, struct timespec > ×)
const double m_dqm_pathtime_range
std::string const * m_first_endpath
const edm::InputTag m_luminosity_label
PathInfo * m_current_path
TProfile * m_dqm_byluminosity_presource
TH1F * m_dqm_nproc_all_paths
void setNumberOfProcesses(unsigned int)
std::pair< struct timespec, struct timespec > m_timer_endpaths
TProfile * m_dqm_nproc_byluminosity_presource
double queryEndPathsTime() const
TProfile * m_dqm_nproc_byluminosity_event
U second(std::pair< T, U > const &p)
TProfile * m_dqm_nproc_byluminosity_all_paths
TProfile * m_dqm_byls_postsource
TProfile * m_dqm_byls_interpaths
void preModuleBeginJob(edm::ModuleDescription const &)
const bool m_enable_dqm_bynproc
double querySourceTime() const
bool m_enable_timing_paths
void stop(std::pair< struct timespec, struct timespec > ×) const
std::pair< struct timespec, struct timespec > m_timer_paths
TProfile * m_dqm_byluminosity_postsource
const bool m_enable_dqm_byls
const double m_dqm_moduletime_resolution
TProfile * m_dqm_byluminosity_source
void preModule(edm::ModuleDescription const &)
TProfile * m_dqm_nproc_byluminosity_all_endpaths
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
std::string const * m_first_path
TProfile * m_dqm_nproc_byls_source
TProfile * m_dqm_nproc_byls_all_endpaths
std::string const * m_last_endpath
double queryPathActiveTime(const std::string &) const
void start(std::pair< struct timespec, struct timespec > ×) const
PathMap< PathInfo > m_paths
struct timespec m_timer_first_module
const bool m_enable_dqm_bypath_details
double m_summary_all_endpaths
TH1F * m_dqm_nproc_source
const bool m_enable_dqm_bypath_overhead
TProfile * m_dqm_nproc_byls_event
const std::string m_dqm_path
TProfile * m_dqm_byluminosity_all_endpaths
std::unordered_map< std::string, ModuleInfo > m_modules
TProfile * m_dqm_nproc_byls_postsource
ModuleMap< ModuleInfo * > m_fast_modules
const bool m_enable_dqm_bymodule
TH1F * m_dqm_nproc_postsource
const double m_dqm_moduletime_range
TProfile * m_dqm_byluminosity_all_paths
bool m_enable_timing_exclusive
double queryModuleTime(const edm::ModuleDescription &) const
double m_summary_all_paths
TProfile * m_dqm_paths_exclusive_time
double m_summary_interpaths
double currentModuleTime() const
TProfile * m_dqm_byls_all_paths
TH1F * m_dqm_all_endpaths
double queryPathsTime() const
const bool m_enable_timing_summary
const bool m_enable_dqm_bymoduletype
std::pair< struct timespec, struct timespec > m_timer_module
const bool m_enable_dqm_summary
double summary_premodules
TProfile * m_dqm_byls_event
void gettime(struct timespec &stamp) const
const bool m_enable_dqm_bypath_total
void fillPathMap(std::string const &name, std::vector< std::string > const &modules)
const bool m_enable_dqm_bypath_active
unsigned int m_summary_events
void postProcessPath(std::string const &, edm::HLTPathStatus const &)
const std::vector< unsigned int > m_supported_processes
TProfile * m_dqm_byluminosity_event
std::vector< ModuleInfo * > modules
TProfile * m_dqm_paths_active_time
const double m_dqm_luminosity_range
TH1F * m_dqm_nproc_all_endpaths
double summary_intermodules
TProfile * m_dqm_paths_total_time
TH1F * dqm_module_counter
TProfile * m_dqm_nproc_byluminosity_interpaths
double currentEventTime() const
void preProcessPath(std::string const &)
std::pair< struct timespec, struct timespec > m_timer_source
static double delta(const struct timespec &first, const struct timespec &second)
TProfile * m_dqm_paths_interpaths
void preBeginRun(edm::RunID const &, edm::Timestamp const &)
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
double currentPathTime() const