ATLAS Offline Software
PageAccessControlSvc.h
Go to the documentation of this file.
1 // dear emacs, this is -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef ATHENASERVICES_PAGEACCESSCONTROLSVC_H
8 #define ATHENASERVICES_PAGEACCESSCONTROLSVC_H
9 
16 #include <signal.h> /*sigaction*/
17 
18 // Package includes
20 
21 // FrameWork includes
26 #include "Gaudi/Property.h" /*BooleanProperty*/
27 
28 // Forward declarations
29 template <class TYPE> class SvcFactory;
30 
52  public AthService {
53 public:
54 
56  PageAccessControlSvc( const std::string& name, ISvcLocator* pSvcLocator ) ATLAS_CTORDTOR_NOT_THREAD_SAFE;
57 
59  virtual ~PageAccessControlSvc() {}
60 
62 
63  virtual bool startMonitoring();
66  virtual bool stopMonitoring();
68  virtual bool accessed(const void* address) const;
70  virtual void report() const;
73  virtual bool controlPage(const void* address) {
74  return m_accessControl.forbidPage(address);
75  }
77 
78 
80 
81  virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
82  virtual StatusCode initialize();
83  virtual StatusCode finalize();
84 
86 
87 
88 private:
89  struct sigaction m_saveSEGVaction;
92  BooleanProperty m_autoMonitor;
93 };
94 
95 
96 #endif
IPageAccessControlSvc.h
Interface to a service that monitors memory page accesses.
PageAccessControlSvc::m_accessControl
PageAccessControl m_accessControl
Definition: PageAccessControlSvc.h:90
PageAccessControlSvc::finalize
virtual StatusCode finalize()
Definition: PageAccessControlSvc.cxx:47
SvcFactory
Definition: AthCnvSvc.h:28
PageAccessControl
Definition: PageAccessControl.h:27
PageAccessControlSvc::m_saveSEGVaction
struct sigaction m_saveSEGVaction
the default action for SIGSEGV
Definition: PageAccessControlSvc.h:89
PageAccessControlSvc::controlPage
virtual bool controlPage(const void *address)
control access to the page containing address
Definition: PageAccessControlSvc.h:73
PtrAccessSEGVHandler
Definition: PtrAccessSEGVHandler.h:28
PageAccessControlSvc::~PageAccessControlSvc
virtual ~PageAccessControlSvc()
Destructor.
Definition: PageAccessControlSvc.h:59
PtrAccessSEGVHandler.h
This class provides a handle function that logs the addresses that had an access violation....
IPageAccessControlSvc
Interface to a service that monitors memory page accesses.
Definition: IPageAccessControlSvc.h:30
PageAccessControlSvc::stopMonitoring
virtual bool stopMonitoring()
Definition: PageAccessControlSvc.cxx:31
PageAccessControl.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
PageAccessControlSvc::accessed
virtual bool accessed(const void *address) const
has this pointer been accessed (read/written)
Definition: PageAccessControlSvc.cxx:36
PageAccessControlSvc::initialize
virtual StatusCode initialize()
Definition: PageAccessControlSvc.cxx:40
PageAccessControlSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
Definition: PageAccessControlSvc.cxx:61
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
PageAccessControlSvc::report
virtual void report() const
In baseline implementation, controlled via PageAccessControlSvc.OutputLevel
Definition: PageAccessControlSvc.cxx:75
PageAccessControlSvc::startMonitoring
virtual bool startMonitoring()
In baseline implementation, protect pages and install a SEGV handler that counts the number of access...
Definition: PageAccessControlSvc.cxx:19
PageAccessControlSvc::m_autoMonitor
BooleanProperty m_autoMonitor
start on init, stop on finalize
Definition: PageAccessControlSvc.h:92
PageAccessControlSvc::PageAccessControlSvc
PageAccessControlSvc(const std::string &name, ISvcLocator *pSvcLocator) ATLAS_CTORDTOR_NOT_THREAD_SAFE
Standard GAUDI constructor.
Definition: PageAccessControlSvc.cxx:8
PageAccessControlSvc::m_SEGVHandler
PtrAccessSEGVHandler m_SEGVHandler
Definition: PageAccessControlSvc.h:91
PageAccessControlSvc
Service to monitor access to memory pages.
Definition: PageAccessControlSvc.h:52
AthService.h
ATLAS_CTORDTOR_NOT_THREAD_SAFE
#define ATLAS_CTORDTOR_NOT_THREAD_SAFE
Definition: checker_macros.h:213
checker_macros.h
Define macros for attributes used to control the static checker.