diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/back_mc_rdo_to_rdoftk_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/back_mc_rdo_to_rdoftk_grid.sh index b486e784668d5402d53dccd3699e93ee6d489d3b..0a520e75594a03f49b027de308db740202e5c79a 100755 --- a/Trigger/TrigValidation/TrigAnalysisTest/test/back_mc_rdo_to_rdoftk_grid.sh +++ b/Trigger/TrigValidation/TrigAnalysisTest/test/back_mc_rdo_to_rdoftk_grid.sh @@ -32,6 +32,6 @@ TrigFTKTM64SM1Un_tf.py --inputRDOFile=${DS} --runNumber="410000" --outputRDO_FT echo "art-result: $? athena" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log echo "art-result: ${PIPESTATUS[0]} CheckLog" diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/exec_art_triganalysistest_post.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/exec_art_triganalysistest_post.sh index 81f0fcbc531556ded74876649896f322bfe13981..7d5229eef31b47cca48d3153d41e8151a55fdc11 100755 --- a/Trigger/TrigValidation/TrigAnalysisTest/test/exec_art_triganalysistest_post.sh +++ b/Trigger/TrigValidation/TrigAnalysisTest/test/exec_art_triganalysistest_post.sh @@ -23,7 +23,7 @@ export TDT_LOG=${JOB_LOG%%.*}.TrigDecTool.${JOB_LOG#*.} athena.py -c 'fileList=["AOD.pool.root"]' -b TrigAnalysisTest/testAthenaTrigAOD_TrigDecTool.py 2>&1 | tee ${TDT_LOG} echo "art-result: ${PIPESTATUS[0]} ${TDT_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${TDT_LOG} 2>&1 | tee checklog.TrigDecTool.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${TDT_LOG} 2>&1 | tee checklog.TrigDecTool.log echo "art-result: ${PIPESTATUS[0]} CheckLog.TrigDecTool" echo "##############################" @@ -32,7 +32,7 @@ export EDM_LOG=${JOB_LOG%%.*}.TrigEDMCheck.${JOB_LOG#*.} athena.py -c 'fileList=["AOD.pool.root"]' -b TrigAnalysisTest/testAthenaTrigAOD_TrigEDMCheck.py 2>&1 | tee ${EDM_LOG} echo "art-result: ${PIPESTATUS[0]} ${EDM_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${EDM_LOG} 2>&1 | tee checklog.TrigEDMCheck.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${EDM_LOG} 2>&1 | tee checklog.TrigEDMCheck.log echo "art-result: ${PIPESTATUS[0]} CheckLog.TrigEDMCheck" echo "##############################" @@ -41,7 +41,7 @@ export EDMAUX_LOG=${JOB_LOG%%.*}.TrigEDMAuxCheck.${JOB_LOG#*.} athena.py -c 'fileList=["AOD.pool.root"]' -b TrigAnalysisTest/testAthenaTrigAOD_TrigEDMAuxCheck.py 2>&1 | tee ${EDMAUX_LOG} echo "art-result: ${PIPESTATUS[0]} ${EDMAUX_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${EDMAUX_LOG} 2>&1 | tee checklog.TrigEDMAuxCheck.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${EDMAUX_LOG} 2>&1 | tee checklog.TrigEDMAuxCheck.log echo "art-result: ${PIPESTATUS[0]} CheckLog.TrigEDMAuxCheck" echo "################################" @@ -50,9 +50,9 @@ export TRIGHLTMON_LOG=${JOB_LOG%%.*}.TrigHLTMon.${JOB_LOG#*.} TrigHLTMon_tf.py --inputAODFile AOD.pool.root --outputHISTFile myHIST.root 2>&1 | tee ${TRIGHLTMON_LOG} echo "art-result: ${PIPESTATUS[0]} ${TRIGHLTMON_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${TRIGHLTMON_LOG} 2>&1 | tee checklog.TrigHLTMon.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${TRIGHLTMON_LOG} 2>&1 | tee checklog.TrigHLTMon.log echo "art-result: ${PIPESTATUS[0]} CheckLog.TrigHLTMon" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats log.HLTMon 2>&1 | tee checklog.HLTMon.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats log.HLTMon 2>&1 | tee checklog.HLTMon.log echo "art-result: ${PIPESTATUS[0]} CheckLog.HLTMon" echo "################################" @@ -61,7 +61,7 @@ export HLTMON_LOG=${JOB_LOG%%.*}.HLTMonitoring.${JOB_LOG#*.} athena.py -c 'fileList=["ESD.pool.root"]' -b TrigAnalysisTest/testAthenaTrigESD_HLTMonitoring.py 2>&1 | tee ${HLTMON_LOG} echo "art-result: ${PIPESTATUS[0]} ${HLTMON_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${HLTMON_LOG} 2>&1 | tee checklog.HLTMonitoring.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${HLTMON_LOG} 2>&1 | tee checklog.HLTMonitoring.log echo "art-result: ${PIPESTATUS[0]} CheckLog.HLTMonitoring" mv histo.root expert-monitoring.root if [ -f ${REF_FOLDER}/expert-monitoring.root ]; then @@ -82,7 +82,7 @@ else athena.py -c 'TestType="RSegamma";useCONDBR2=False;' -b TrigAnalysisTest/testAthenaTrigAODtoAOD_TrigNavSlimming.py 2>&1 | tee ${SLIM_LOG} echo "art-result: ${PIPESTATUS[0]} ${SLIM_LOG%.*}" echo $(date "+%FT%H:%M %Z")" Running checklog" - timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${SLIM_LOG} 2>&1 | tee checklog.TrigNavSlimming.log + timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${SLIM_LOG} 2>&1 | tee checklog.TrigNavSlimming.log echo "art-result: ${PIPESTATUS[0]} CheckLog.TrigNavSlimming" fi diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_primaries_rdotobstoesd_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_primaries_rdotobstoesd_build.sh index c8b67615824095df92c2f37992d143edc304b603..42e6f8290478ae0fe48dbc3843f6e8f192812fbd 100755 --- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_primaries_rdotobstoesd_build.sh +++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_primaries_rdotobstoesd_build.sh @@ -16,7 +16,7 @@ export JOBOPTION="TrigAnalysisTest/testAthenaTrigRDOtoBS.py" source exec_athena_art_trigger_validation.sh echo $(date "+%FT%H:%M %Z")" Running checklog for ${JOB_LOG}" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog_BS.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog_BS.log echo "art-result: ${PIPESTATUS[0]} CheckLog BS" diff --git a/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf b/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf index 8433d9f7776decdecdd1d987036e73eb4f5258d6..256d59952dbf28541d99901da1921ebcf35e2c56 100644 --- a/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf +++ b/Trigger/TrigValidation/TrigP1Test/Testing/checklogTrigP1Test.conf @@ -86,9 +86,6 @@ ignore '.*ipc::CorbaSystemException ERROR.*' ignore '.*TDAQ_ERS_FATAL.*' ignore '.*TDAQ_ERS_ERROR.*' -# Message from check_log.pl itself -ignore '.*ERROR or FATAL messages in.*' - # This is the default config file for check_log ignore 'ImportError: No module named MuonDQAMonFlags.MuonDQAFlags' ignore 'IGNORE TRF_UNKNOWN ATHENA ERRORS MODE: ON' diff --git a/Trigger/TrigValidation/TrigValTools/bin/check_log.pl b/Trigger/TrigValidation/TrigValTools/bin/check_log.pl index cc7ddf0ac67299b385e5b408e8e1382a4d020efe..5ea9402bc2d560fbf7494cbc413943e0a7772efb 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/check_log.pl +++ b/Trigger/TrigValidation/TrigValTools/bin/check_log.pl @@ -11,6 +11,9 @@ main(); exit 0; sub main(){ + print "$prog: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; + print "$prog: !! WARNING: This perl script is deprecated, please use check_log.py instead !!\n"; + print "$prog: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; parse_options(); # command line options parse_config(); # config file scan_logfile(); diff --git a/Trigger/TrigValidation/TrigValTools/bin/check_log.py b/Trigger/TrigValidation/TrigValTools/bin/check_log.py index b6487bace3a83afbfb001c6452a56a8a8a1beb19..2360c2141d7df33f0deaf88d19b62fea12751de2 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/check_log.py +++ b/Trigger/TrigValidation/TrigValTools/bin/check_log.py @@ -12,26 +12,44 @@ desc = 'Tool to check for error messages in a log file. By default ERROR, FATAL provide patterns of lines to exclude from this check - known problems or false positives. \ If no config file is provided, all errors will be shown.' -errorRegex = ["^ERROR | ERROR | FATAL |CRITICAL |ABORT_CHAIN", -"^Exception\:|^Caught signal|^Core dump|Traceback|Shortened traceback|stack trace|^Algorithm stack\:|inconsistent use of tabs and spaces in indentation\ -|glibc detected|tcmalloc\: allocation failed|athenaHLT.py\: error|HLTMPPU.*Child Issue|There was a crash|illegal instruction|failure loading library|Cannot allocate memory"] - -#Get list of all builtin Python errors +# Error keywords +errorRegex = [ + '^ERROR ', ' ERROR ', ' FATAL ', 'CRITICAL ', 'ABORT_CHAIN', + '^Exception\:', + '^Caught signal', + '^Core dump', + 'Traceback', + 'Shortened traceback', + 'stack trace', + '^Algorithm stack\:', + 'inconsistent use of tabs and spaces in indentation', + 'glibc detected', + 'tcmalloc\: allocation failed', + 'athenaHLT.py\: error', + 'HLTMPPU.*Child Issue', + 'There was a crash', + 'illegal instruction', + 'failure loading library', + 'Cannot allocate memory', + 'in state: CONTROLREADY$', + '^\s*missing data: ', + '^\s*can be produced by alg(s): ' +] + +# Add list of all builtin Python errors builtins = dir(locals()['__builtins__']) -pythonErrors = "" -for builtin in builtins: - if "Error" in builtin: - pythonErrors += builtin + "|" - -#Remove final "|" -pythonErrors = pythonErrors[:-1] - -errorRegex.append(pythonErrors) - - - -traceback = ['Traceback|Shortened traceback|^Algorithm stack|Thread .*0x'] - +builtinErrors = [b for b in builtins if 'Error' in b] +errorRegex.extend(builtinErrors) + +# Traceback keywords +traceback = [ + 'Traceback', + 'Shortened traceback', + '^Algorithm stack', + '^#\d+\s*0x\w+ in ' +] + +# Warning keywords warningRegex = ['WARNING '] def main(): @@ -84,7 +102,9 @@ def parseConfig(): print('Ignoring warnings/error patterns defined in ' + args.config) for aline in configFile: if 'ignore' in aline: - line = aline.strip('ignore').strip().strip("'") + line = aline.strip('ignore').strip() + if line.startswith('\'') and line.endswith('\''): + line = line[1:-1] ignorePattern.append(line) noConfig = False except: @@ -110,14 +130,13 @@ def scanLogfile(): for line in logFile: #Tracing only makes sense for errors if args.errors == True and re.search(tPattern,line): - #if re.search(tPattern,line): tracing = True - resultsA.append('\n') elif line =='\n': tracing = False if re.search(msgLevels,line): resultsA.append(line) elif tracing: + # This currently prints all lines after a traceback even if they don't belong to traceback resultsA.append(line) if args.showexcludestats and not noConfig: diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py index b7845951bcad4507625f3b0455a86eb58868d2c7..db0fa585e60d3ddc4d20528e4465bf0544658ad5 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/CheckSteps.py @@ -206,7 +206,7 @@ class CheckLogStep(Step): def __init__(self, name): super(CheckLogStep, self).__init__(name) - self.executable = 'check_log.pl' + self.executable = 'check_log.py' self.log_file = None self.check_errors = True self.check_warnings = False @@ -228,8 +228,8 @@ class CheckLogStep(Step): self.log_file = test.exec_steps[0].name+'.log' else: self.log_file = 'athena.log' - if not self.check_errors: - self.args += ' --noerrors' + if self.check_errors: + self.args += ' --errors' if self.check_warnings: self.args += ' --warnings' if self.check_errors and not self.check_warnings: diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py index a169b908c982b1be6af8ef65612a770f1cb0cbfa..399d536ed48505d0e5cb5c489a8da8f1134eb76d 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/Step.py @@ -78,7 +78,7 @@ class Step(object): parent = psutil.Process(pid) backtrace = '' for proc in [parent] + parent.children(recursive=True): - backtrace += '\nBacktrace for {} PID {}:\n'.format(proc.name(), proc.pid) + backtrace += '\nTraceback for {} PID {}:\n'.format(proc.name(), proc.pid) backtrace += subprocess.check_output('$ROOTSYS/etc/gdb-backtrace.sh {}'.format(proc.pid), stderr=subprocess.STDOUT, shell=True) backtrace_list[0] = backtrace diff --git a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh index 8554fbed41c3234bed6c8327aa56811e984055fb..7ad7aab2551cafee3bce9fa6762f01cbca36503a 100755 --- a/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh +++ b/Trigger/TrigValidation/TriggerTest/test/exec_art_triggertest_post.sh @@ -39,11 +39,11 @@ if [ "${ATH_RETURN}" -ne "0" ] && [ -n "${gitlabTargetBranch}" ]; then fi echo $(date "+%FT%H:%M %Z")" Running checklog for errors" -timeout 5m check_log.pl --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log +timeout 5m check_log.py --errors --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} 2>&1 | tee checklog.log echo "art-result: ${PIPESTATUS[0]} CheckLog" echo $(date "+%FT%H:%M %Z")" Running checklog for warnings" -timeout 5m check_log.pl --config checklogTriggerTest.conf --noerrors --warnings --showexcludestats ${JOB_LOG} >warnings.log 2>&1 +timeout 5m check_log.py --warnings --config checklogTriggerTest.conf --showexcludestats ${JOB_LOG} >warnings.log 2>&1 ### PERFMON diff --git a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt index 6a41b5c3311fb994b7a7bedd797ed098191d973c..57cd6f574470be9c7050b35b014ebb2a35273799 100644 --- a/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenu/CMakeLists.txt @@ -18,7 +18,7 @@ atlas_install_xmls( data/*.dtd data/*.xml ) atlas_add_test( generateMenu SCRIPT scripts/testMenu.sh PROPERTIES TIMEOUT 500 - POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf generateMenu.log" + POST_EXEC_SCRIPT "check_log.py --errors --config checklogTriggerTest.conf generateMenu.log" ) # Disabled in master as missing the required fixes to the menu presetn in 21.1 (TM, Aug 2018) @@ -29,12 +29,12 @@ atlas_add_test( generateMenu SCRIPT scripts/testMenu.sh if( NOT "${CMAKE_PROJECT_NAME}" STREQUAL "AthDerivation" ) atlas_add_test ( checkL1Menu SCRIPT scripts/checkL1Menu.sh - POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf checkL1Menu.log" ) + POST_EXEC_SCRIPT "check_log.py --errors --config checklogTriggerTest.conf checkL1Menu.log" ) endif() atlas_add_test( checkMenuPrimaries SCRIPT scripts/checkMenuPrimaries.py PROPERTIES TIMEOUT 200 - POST_EXEC_SCRIPT "check_log.pl --config checklogTriggerTest.conf checkMenuPrimaries.log" + POST_EXEC_SCRIPT "check_log.py --errors --config checklogTriggerTest.conf checkMenuPrimaries.log" ) # Function to create lowest-unprescaled lists