20 info() <<
"initialize" <<
endmsg;
22 for (
const auto& itr : m_pFilter.value() ) {
26 parseFilter( itr, fnc, lib );
30 m_filterfnc.insert( fnc );
35 m_filterlib.insert( lib );
47 info() <<
"reinitialize" <<
endmsg;
56 if ( !m_dat.empty() ) {
58 info() <<
"listing all unchecked return codes:" <<
endmsg;
64 if ( msgLevel(
MSG::DEBUG ) ) debug() <<
"all StatusCode instances where checked" <<
endmsg;
85 const auto len = lib.
length();
86 if ( len >= 3 && lib.
compare( len - 3, 3,
".so" ) == 0 ) {
87 if ( ( len >= 7 && ( lib.
compare( len - 7, 4,
"Dict" ) == 0 || lib.
compare( len - 7, 4,
"Core" ) == 0 ) ) ||
88 ( len >= 8 && lib.
compare( len - 8, 5,
"Cling" ) == 0 ) ) {
91 }
else if ( lib.
rfind(
"Dict.so" ) != std::string::npos || lib.
rfind(
"Cling.so" ) != std::string::npos ||
92 lib.
rfind(
"Core.so" ) != std::string::npos ) {
97 if ( fnc ==
"_PyObject_GC_Malloc" )
return;
99 if ( fnc ==
"PyThread_get_thread_ident" )
return;
100 if ( fnc ==
"local" )
return;
103 const string rlib = lib.
substr( lib.
rfind(
"/" ) + 1 );
105 if ( m_filterfnc.find( fnc ) != m_filterfnc.end() || m_filterlib.find( rlib ) != m_filterlib.end() ) {
111 fatal() <<
"Unchecked StatusCode in " << fnc <<
" from lib " << lib <<
endmsg;
115 string key = fnc + lib;
117 auto itr = m_dat.
find( key );
119 if ( itr != m_dat.end() ) {
120 itr->second.count += 1;
123 const string rlib = lib.substr( lib.rfind(
"/" ) + 1 );
140 os <<
"Num | Function | Source Library" <<
endl;
141 os <<
"----+--------------------------------+-------------------" 142 <<
"-----------------------" <<
endl;
144 for (
const auto& itr : m_dat ) {
145 const auto& dat = itr.second;
148 os.
setf( ios_base::right, ios_base::adjustfield );
153 os.
setf( ios_base::left, ios_base::adjustfield );
157 os.
setf( ios_base::left, ios_base::adjustfield );
172 if ( itr !=
std::end( m_dat ) ) m_dat.erase( itr );
181 if ( itr !=
std::end( m_dat ) ) m_dat.erase( itr );
189 auto loc = str.
find(
"=" );
190 if ( loc == std::string::npos ) {
194 string key = str.
substr( 0, loc );
195 string val = str.
substr( loc + 1 );
199 if ( key ==
"FCN" || key ==
"FNC" ) {
202 }
else if ( key ==
"LIB" ) {
209 warning() <<
"ignoring unknown token in Filter: " << str <<
endmsg;
StatusCode initialize() override
StatusCode reinitialize() override
void parseFilter(const std::string &str, std::string &fnc, std::string &lib)
#define DECLARE_COMPONENT(type)
StatusCode initialize() override
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
void regFnc(const std::string &func, const std::string &lib) override
void filterLib(const std::string &)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void filterFnc(const std::string &)
void list() const override
StatusCode finalize() override