#include <FPEAuditor.h>
|
| FPEAuditor (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor. More...
|
|
virtual | ~FPEAuditor () |
| Destructor. More...
|
|
virtual StatusCode | initialize () override |
| Gaudi hooks. More...
|
|
virtual StatusCode | finalize () override |
|
virtual void | before (StandardEventType evt, INamedInterface *comp) override |
|
virtual void | after (StandardEventType evt, INamedInterface *comp, const StatusCode &sc) override |
|
virtual void | before (IAuditor::CustomEventTypeRef evt, INamedInterface *caller) override |
| Audit the start of a custom "event". More...
|
|
virtual void | before (IAuditor::CustomEventTypeRef evt, const std::string &caller) override |
| Audit the start of a custom "event" for callers that do not implement the INamedInterface . More...
|
|
virtual void | after (IAuditor::CustomEventTypeRef evt, INamedInterface *caller, const StatusCode &sc) override |
| Audit the end of a custom "event". More...
|
|
virtual void | after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc) override |
| Audit the end of a custom "event" for callers that do not implement the INamedInterface . More...
|
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 33 of file FPEAuditor.h.
◆ FpeNode_t
◆ FpeStack_t
◆ anonymous enum
Enumerator |
---|
FPEAUDITOR_OVERFLOW | |
FPEAUDITOR_INVALID | |
FPEAUDITOR_DIVBYZERO | |
FPEAUDITOR_ARRAYSIZE | |
Definition at line 109 of file FPEAuditor.h.
◆ FPEAuditor()
FPEAuditor::FPEAuditor |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor.
Definition at line 63 of file FPEAuditor.cxx.
71 "Flag to configure, how many stack traces in case of FPE are printed. "
72 "Default: Zero, just report that FPE has happened. "
73 "After collecting the stacktrace, the code has to modify the mcontext_t "
74 "struct to ignore FPEs for the rest of the processing of the algorithm/service "
75 "This part is highly non-portable!" );
77 declareProperty(
"Nstacklines",
m_Nstacklines,
"Limit how deep we dive into the stack");
◆ ~FPEAuditor()
FPEAuditor::~FPEAuditor |
( |
| ) |
|
|
virtual |
◆ add_fpe_node()
void FPEAuditor::add_fpe_node |
( |
| ) |
|
|
private |
add an fpe node
Definition at line 292 of file FPEAuditor.cxx.
295 int raised = fetestexcept(FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
299 feclearexcept(FE_ALL_EXCEPT);
308 FPEAudit::mask_fpe();
◆ after() [1/3]
void FPEAuditor::after |
( |
CustomEventTypeRef |
evt, |
|
|
const std::string & |
caller, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overridevirtual |
Audit the end of a custom "event" for callers that do not implement the INamedInterface
.
Definition at line 200 of file FPEAuditor.cxx.
◆ after() [2/3]
virtual void FPEAuditor::after |
( |
IAuditor::CustomEventTypeRef |
evt, |
|
|
INamedInterface * |
caller, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
inlineoverridevirtual |
Audit the end of a custom "event".
Definition at line 74 of file FPEAuditor.h.
77 {
return this->
after (
evt, caller->name(),
sc); }
◆ after() [3/3]
void FPEAuditor::after |
( |
StandardEventType |
evt, |
|
|
INamedInterface * |
comp, |
|
|
const StatusCode & |
sc |
|
) |
| |
|
overridevirtual |
◆ before() [1/3]
virtual void FPEAuditor::before |
( |
IAuditor::CustomEventTypeRef |
evt, |
|
|
const std::string & |
caller |
|
) |
| |
|
overridevirtual |
Audit the start of a custom "event" for callers that do not implement the INamedInterface
.
◆ before() [2/3]
virtual void FPEAuditor::before |
( |
IAuditor::CustomEventTypeRef |
evt, |
|
|
INamedInterface * |
caller |
|
) |
| |
|
inlineoverridevirtual |
Audit the start of a custom "event".
Definition at line 62 of file FPEAuditor.h.
64 {
return this->
before (
evt, caller->name()); }
◆ before() [3/3]
void FPEAuditor::before |
( |
StandardEventType |
evt, |
|
|
INamedInterface * |
comp |
|
) |
| |
|
overridevirtual |
◆ finalize()
StatusCode FPEAuditor::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode FPEAuditor::initialize |
( |
| ) |
|
|
overridevirtual |
◆ InstallHandler()
void FPEAuditor::InstallHandler |
( |
| ) |
|
|
private |
Definition at line 117 of file FPEAuditor.cxx.
123 ATH_MSG_WARNING(
"Collecting stack traces for FPES is not supported on aarch64");
128 struct sigaction act;
129 memset(&act, 0,
sizeof act);
130 act.sa_sigaction = FPEAudit::fpe_sig_action;
131 act.sa_flags = SA_SIGINFO;
132 if ( sigaction(SIGFPE, &act, &FPEAudit::s_oldactHandler) != 0 )
134 ATH_MSG_WARNING (
"Printing stacktraces on FPE requested, but unable to install signal handler ! Switched off !");
140 FPEAudit::unmask_fpe();
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ pop_fpe_node()
void FPEAuditor::pop_fpe_node |
( |
| ) |
|
|
private |
pop an fpe node
Definition at line 313 of file FPEAuditor.cxx.
317 throw std::runtime_error(
"inconsistent fpe-stack");
329 FPEAudit::unmask_fpe();
◆ report_fpe()
void FPEAuditor::report_fpe |
( |
const std::string & |
step, |
|
|
const std::string & |
caller |
|
) |
| |
|
private |
report fpes which happened during step 'step' on behalf of 'caller'
Definition at line 211 of file FPEAuditor.cxx.
215 int raised = fetestexcept(FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
218 std::stringstream evStr;
219 const EventContext& ctx = Gaudi::Hive::currentContext();
221 evStr <<
" on event " << ctx.eventID().event_number();
224 if (raised & FE_OVERFLOW) {
235 this->
msg(MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
242 if (raised & FE_INVALID) {
254 this->
msg(MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
260 if (raised & FE_DIVBYZERO) {
271 this->
msg(MSG::INFO) <<
"FPE stacktrace " << j <<
" :\n";
285 fprintf(
stderr,
"too many SIGFPE detected, will be uninstalling signal handler\n");
◆ UninstallHandler()
void FPEAuditor::UninstallHandler |
( |
| ) |
|
|
private |
Definition at line 150 of file FPEAuditor.cxx.
155 feclearexcept(FE_ALL_EXCEPT);
157 FPEAudit::mask_fpe();
◆ m_CountFPEs
◆ m_env
The FP environment before we initialize.
Definition at line 124 of file FPEAuditor.h.
◆ m_nexceptions
std::atomic<int> FPEAuditor::m_nexceptions |
|
private |
◆ m_Nstacklines
unsigned int FPEAuditor::m_Nstacklines =100 |
|
private |
◆ m_NstacktracesOnFPE
unsigned int FPEAuditor::m_NstacktracesOnFPE =0 |
|
private |
◆ s_fpe_stack
a stack of FPE exceptions which have been raised
Definition at line 107 of file FPEAuditor.h.
The documentation for this class was generated from the following files: