ATLAS Offline Software
PageAccessControlSvc.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 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 
49 class PageAccessControlSvc : public extends<AthService, IPageAccessControlSvc> {
50 public:
51 
53  PageAccessControlSvc( const std::string& name, ISvcLocator* pSvcLocator ) ATLAS_CTORDTOR_NOT_THREAD_SAFE;
54 
56  virtual ~PageAccessControlSvc() {}
57 
59 
60  virtual bool startMonitoring();
63  virtual bool stopMonitoring();
65  virtual bool accessed(const void* address) const;
67  virtual void report() const;
70  virtual bool controlPage(const void* address) {
71  return m_accessControl.forbidPage(address);
72  }
74 
75 
77 
78  virtual StatusCode initialize();
79  virtual StatusCode finalize();
80 
82 
83 
84 private:
85  struct sigaction m_saveSEGVaction;
88  BooleanProperty m_autoMonitor;
89 };
90 
91 
92 #endif
IPageAccessControlSvc.h
PageAccessControlSvc::m_accessControl
PageAccessControl m_accessControl
Definition: PageAccessControlSvc.h:86
PageAccessControlSvc::finalize
virtual StatusCode finalize()
Definition: PageAccessControlSvc.cxx:47
PageAccessControl
Definition: PageAccessControl.h:27
PageAccessControlSvc::m_saveSEGVaction
struct sigaction m_saveSEGVaction
the default action for SIGSEGV
Definition: PageAccessControlSvc.h:85
PageAccessControlSvc::controlPage
virtual bool controlPage(const void *address)
Definition: PageAccessControlSvc.h:70
PtrAccessSEGVHandler
Definition: PtrAccessSEGVHandler.h:28
PageAccessControlSvc::~PageAccessControlSvc
virtual ~PageAccessControlSvc()
Destructor.
Definition: PageAccessControlSvc.h:56
PtrAccessSEGVHandler.h
This class provides a handle function that logs the addresses that had an access violation....
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
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
PageAccessControlSvc::report
virtual void report() const
In baseline implementation, controlled via PageAccessControlSvc.OutputLevel
Definition: PageAccessControlSvc.cxx:56
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:88
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:87
PageAccessControlSvc
Service to monitor access to memory pages.
Definition: PageAccessControlSvc.h:49
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.