Service to monitor access to memory pages.
More...
#include <PageAccessControlSvc.h>
|
| | PageAccessControlSvc (const std::string &name, ISvcLocator *pSvcLocator) ATLAS_NOT_THREAD_SAFE |
| | Standard GAUDI constructor.
|
| virtual | ~PageAccessControlSvc () |
| | Destructor.
|
| virtual bool | startMonitoring () |
| | In baseline implementation, protect pages and install a SEGV handler that counts the number of accesses to a protected address.
|
| virtual bool | stopMonitoring () |
| virtual bool | accessed (const void *address) const |
| | has this pointer been accessed (read/written)
|
| virtual void | report () const |
| | In baseline implementation, controlled via PageAccessControlSvc.OutputLevel.
|
| virtual bool | controlPage (const void *address) |
Service to monitor access to memory pages.
- Author
- Paolo Calafiura
This service uses
Definition at line 49 of file PageAccessControlSvc.h.
◆ PageAccessControlSvc()
| PageAccessControlSvc::PageAccessControlSvc |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Standard GAUDI constructor.
Definition at line 8 of file PageAccessControlSvc.cxx.
9 :
12{
13
16 "start monitoring on initialize, stop on finalize");
17}
struct sigaction m_saveSEGVaction
the default action for SIGSEGV
BooleanProperty m_autoMonitor
start on init, stop on finalize
PageAccessControl m_accessControl
PtrAccessSEGVHandler m_SEGVHandler
◆ ~PageAccessControlSvc()
| virtual PageAccessControlSvc::~PageAccessControlSvc |
( |
| ) |
|
|
inlinevirtual |
◆ accessed()
| bool PageAccessControlSvc::accessed |
( |
const void * | address | ) |
const |
|
virtual |
◆ controlPage()
| virtual bool PageAccessControlSvc::controlPage |
( |
const void * | address | ) |
|
|
inlinevirtual |
◆ finalize()
| StatusCode PageAccessControlSvc::finalize |
( |
| ) |
|
|
virtual |
Definition at line 47 of file PageAccessControlSvc.cxx.
47 {
51 else sc = StatusCode::FAILURE;
52 }
54}
virtual bool stopMonitoring()
virtual void report() const
In baseline implementation, controlled via PageAccessControlSvc.OutputLevel.
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ initialize()
| StatusCode PageAccessControlSvc::initialize |
( |
| ) |
|
|
virtual |
◆ report()
| void PageAccessControlSvc::report |
( |
| ) |
const |
|
virtual |
In baseline implementation, controlled via PageAccessControlSvc.OutputLevel.
Definition at line 56 of file PageAccessControlSvc.cxx.
56 {
57 msg(MSG::INFO) <<
"Access monitoring report" <<
endmsg;
60 while (i != e) {
61 msg(MSG::DEBUG) <<
"accessed pointer at @" << std::hex << *
i++ <<
endmsg;
62 }
65 while (ia != ea) {
66 msg(MSG::DEBUG) <<
"protected page at @" << std::hex << ia->addr
67 <<
" accessed "<< ia->restored <<
" times" <<
endmsg;
68 ++ia;
69 }
70}
protected_t::const_iterator const_iterator
accessed_t::const_iterator const_iterator
◆ startMonitoring()
| bool PageAccessControlSvc::startMonitoring |
( |
| ) |
|
|
virtual |
In baseline implementation, protect pages and install a SEGV handler that counts the number of accesses to a protected address.
Definition at line 19 of file PageAccessControlSvc.cxx.
19 {
23 sa.sa_sigaction= cPtrAccessSEGVHandler;
24 sa.sa_flags=SA_SIGINFO;
25
26 rc=sigaction(SIGSEGV,&sa,
nullptr);
27 }
29}
◆ stopMonitoring()
| bool PageAccessControlSvc::stopMonitoring |
( |
| ) |
|
|
virtual |
◆ m_accessControl
◆ m_autoMonitor
| BooleanProperty PageAccessControlSvc::m_autoMonitor |
|
private |
◆ m_saveSEGVaction
| struct sigaction PageAccessControlSvc::m_saveSEGVaction |
|
private |
◆ m_SEGVHandler
The documentation for this class was generated from the following files: