ATLAS Offline Software
Loading...
Searching...
No Matches
ProfilerService.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef PERFMONGPERFTOOLS_PROFILERSERVICE_H
8#define PERFMONGPERFTOOLS_PROFILERSERVICE_H
9
10// STL include(s):
11#include <string>
12
13// Gaudi/Athena include(s):
14#include "GaudiKernel/ServiceHandle.h"
15#include "GaudiKernel/IIncidentListener.h"
16#include "GaudiKernel/IIncidentSvc.h"
18
19// Local include(s):
21
22namespace GPT {
23
33 class ProfilerService : public extends<AthService,
34 IProfilerSvc,
35 IIncidentListener> {
36
37 public:
39 ProfilerService( const std::string& name, ISvcLocator* svcloc );
41 virtual ~ProfilerService();
42
44 virtual StatusCode initialize() override;
46 virtual StatusCode finalize() override;
47
49 virtual StatusCode startCPUProfiling( const std::string& filename ) override;
51 virtual StatusCode stopCPUProfiling() override;
53 virtual bool isCPUProfilingRunning() const override;
54
56 virtual void handle( const Incident& inc ) override;
57
58 private:
61
67 std::string m_profFileName;
68
72 std::string m_fileName;
73
76
77 }; // class IProfilerSvc
78
79} // namespace GPT
80
81#endif // PERFMONGPERFTOOLS_PROFILERSERVICE_H
virtual ~ProfilerService()
Destructor.
bool m_running
Is the CPU profiling running at the moment?
virtual StatusCode stopCPUProfiling() override
Stop the GPT profiling.
virtual StatusCode finalize() override
Standard Gaudi finalization function.
virtual bool isCPUProfilingRunning() const override
Is the GPT profiling running at the moment?
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
int m_initEvent
Property: Event in which non-controlled profiling should start.
std::string m_fileName
Name of the current profile file.
ProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
virtual StatusCode startCPUProfiling(const std::string &filename) override
Start GPT profiling.
virtual void handle(const Incident &inc) override
Function handling incoming incidents.
int m_processedEvents
Number of events processed so far.
bool m_controlledProfiling
Property: Is profiling controlled from the outside?
virtual StatusCode initialize() override
Standard Gaudi initialization function.
std::string m_profFileName
Property: Profile file name in non-controlled profiling.