Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:46

0001 #!/bin/env python
0002 from __future__ import print_function
0003 import sys
0004 
0005 fileName = sys.argv[1]
0006 
0007 f = open(fileName,'r')
0008 
0009 messageToIgnore = [
0010     'edm::FunctorTask'
0011     ,'edm::FunctorWaitingTask'
0012     ,'edm::ModuleCallingContext::setContext'
0013     ,'edm::SerialTaskQueue::'
0014     ,'edm::SerialTaskQueueChain::'
0015     ,'edm::WaitingTaskList'
0016     ,'edm::Worker::RunModuleTask<'
0017     ,'edm::Worker::beginStream'
0018     ,'edm::eventsetup::EventSetupRecord::getFromProxy'
0019     ,'edm::GlobalSchedule::processOneGlobalAsync'
0020     ,'edm::SerialTaskQueueChain::push'
0021     ,'edm::Worker::doWorkNoPrefetchingAsync'
0022     ,'edm::ServiceRegistry::setContext'
0023     ,'edm::ServiceRegistry::presentToken()'
0024     ,'edm::service::InitRootHandlers::ThreadTracker::on_scheduler_entry'
0025     ,'__TBB_machine_fetchstore4'
0026     ,'__TBB_machine_cmpswp4'
0027     ,'__TBB_machine_fetchstore1'
0028     ,'acquire (spin_rw_mutex.h:118)'
0029     ,'reset_extra_state ('
0030     ,'priority (scheduler_common.h:130)'
0031     ,'edm::service::MessageLogger::'
0032 #    ,'edm::service::MessageLogger::establishModule('
0033 #    ,'edm::Run::Run(edm::RunPrincipal const&,'
0034     ,'edm::service::MessageLogger::unEstablishModule'
0035     ,'tbb::'
0036     ,'edm::RunForOutput::RunForOutput('
0037     ,'edm::stream::EDAnalyzerAdaptor<'
0038     ,'edm::EventSetup::find('
0039     ,'edm::eventsetup::EventSetupRecord::find('
0040     ,'edm::eventsetup::DataKey::operator<('
0041     ,'edm::eventsetup::SimpleStringTag::operator<('
0042     ,'std::__shared_ptr<edm::serviceregistry::ServicesManager'
0043     ,'try_acquire (spin_mutex.h:109)'
0044     ,'edm::Run::Run('
0045     ,'FastTimerService::preStreamBeginRun('
0046     ,'decltype ({parm#1}()) edm::convertException::wrap<bool edm::Worker::runModule'
0047     ,'edm::Worker::reset()'
0048     ,'edm::stream::ProducingModuleAdaptorBase<edm::stream::EDProducerBase>::doStreamBeginLuminosityBlock('
0049     ,'edm::stream::ProducingModuleAdaptorBase<edm::stream::EDFilterBase>::doStreamBeginLuminosityBlock('
0050     ,'edm::LuminosityBlock::LuminosityBlock(edm::LuminosityBlockPrincipal'
0051     ,'edm::StreamSchedule::processOneStreamAsync<'
0052     ,'edm::Worker::doWorkAsync<'
0053     ,'edm::StreamSchedule::processOneEventAsync('
0054     ,'edm::ParentContext::moduleCallingContext()'
0055     ,'edm::ModuleCallingContext::getTopModuleCallingContext'
0056     ,'edm::Event::Event('
0057     ,'edm::Path::workerFinished('
0058     ,'edm::Path::updateCounters('
0059     ,'edm::Path::recordStatus('
0060     ,'FastTimerService::postPathEvent('
0061     ,'edm::hash_detail::isCompactForm_('
0062     ,'edm::InputProductResolver::resolveProduct_'
0063     ,'edm::NoProcessProductResolver::dataValidFromResolver('
0064     ,'edm::DataManagingProductResolver::productWasFetchedAndIsValid_(bool)'
0065     ,'FastTimerService::postModuleEvent('
0066     ,'edm::UnscheduledProductResolver::prefetchAsync_'
0067 #    ,'edm::NoProcessProductResolver::prefetchAsync_'
0068 #    ,'edm::NoProcessProductResolver::resolveProduct_('
0069     ,'edm::NoProcessProductResolver::'
0070     ,'reco::Jet::detectorP4'
0071     ,'edm::EarlyDeleteHelper::moduleRan'
0072     ,'edm::clearLoggedErrorsSummary('
0073     ,'edm::ProductProvenanceRetriever::branchIDToProvenance('
0074     ,'HistogramProbabilityEstimator::probability' #protected by an atomic
0075     ,'edm::EventPrincipal::setLuminosityBlockPrincipal'
0076     ,'edm::DataManagingProductResolver::'
0077 ]
0078 
0079 stackToIgnore = [
0080     'edm::service::MessageLogger::'
0081     ,'edm::MessageSender::ErrorObjDeleter'
0082     ,'edm::Run::runPrincipal() const'
0083     ,'edm::WaitingTaskList::'
0084     ,'edm::EventProcessor::beginJob()'
0085     ,'edm::StreamSchedule::processOneEventAsync'
0086     ,'edm::WorkerManager::resetAll()'
0087     ,'edm::ParentageRegistry::insertMapped('
0088     ,'edm::one::EDFilterBase::doEvent('
0089     ,'edm::one::EDProducerBase'
0090     ,'edm::EventBase::triggerNames_'
0091     ,'edm::EDFilter::doEvent('
0092     ,'edm::EDAnalyzer::doEvent('
0093     ,'edm::one::OutputModuleBase::doEvent'
0094     ,'edm::EDProducer::doEvent'
0095     ,'edm::Principal::clearPrincipal'
0096     ,'edm::RootOutputFile::writeOne'
0097     ,'edm::PrincipalCache::deleteRun('
0098     ,'edm::eventsetup::EventSetupProvider::eventSetupForInstance'
0099     ,'edm::EventPrincipal::clearEventPrincipal()'
0100     ,'FastTimerService::Resources::operator+='
0101     ,'FastTimerService::preSourceEvent(edm::StreamID)'
0102     ,'edm::EventPrincipal::fillEventPrincipal('
0103     ,'edm::InputProductResolver::putProduct_('
0104 ]
0105 
0106 addressesToIgnore = [
0107 #    'edm::eventsetup::makeEventSetupProvider('
0108 #    ,' edm::eventsetup::DataProxy::get('
0109 #    ,'cond::createPayload<'
0110 #    ,'edm::pset::Registry::getMapped('
0111     'is in a rw- anonymous segment' #not sure about this one
0112 #    ,'edm::RootFile::fillRunAuxiliary'
0113     ,'tbb::internal::arena::arena('
0114 #    ,'edm::EventPrincipal::fillEventPrincipal('
0115 #    ,'edm::Principal::addUnscheduledProduct('
0116 #    ,'edm::RootDelayedReader::getProduct_'
0117 #    ,'TBranchElement::GetEntry('
0118 #    ,'edm::Event::put<'
0119 #    ,'edm::stream::EDProducerAdaptorBase::doEvent'
0120 #    ,'edm::stream::EDFilterAdaptorBase::doEvent('
0121 #    ,'edm::EventProcessor::init(' #this may ignore too much, but needed to ignore member data of streams
0122 #    ,'edm::global::EDProducerBase::doEvent'
0123 #    ,'FastTimerService::postBeginJob()'
0124 #    ,'edm::EDProducer::doEvent('
0125 #    ,'_ZN3pat15PackedCandidate27covarianceParameterization_E'
0126 #    ,'edm::RootOutputFile::writeOne'
0127     ,'DQMStore::book'
0128     ,'L1TdeCSCTF::L1TdeCSCTF' #legacy
0129     #,'MeasurementTrackerEventProducer::produce(' #MeasurementTrackerEvent ultimately hits edmNew::DetSetVector's lazy caching of DetSet which is supposed to be thread safe (but may not be?)
0130     ,'std::vector<reco::TrackExtra' #this is the cache in Ref
0131     ,'std::vector<reco::Track'
0132     ,'std::vector<reco::PFConversion'
0133 ]
0134 
0135 addressesToIgnoreIfRead = [
0136     'edm::eventsetup::makeEventSetupProvider('
0137     ,' edm::eventsetup::DataProxy::get('
0138     ,'cond::createPayload<'
0139     ,'edm::pset::Registry::getMapped('
0140 #    ,'is in a rw- anonymous segment' #not sure about this one
0141     ,'edm::RootFile::fillRunAuxiliary'
0142 #    ,'tbb::internal::arena::arena('
0143     ,'edm::EventPrincipal::fillEventPrincipal('
0144     ,'edm::Principal::addUnscheduledProduct('
0145     ,'edm::RootDelayedReader::getProduct_'
0146     ,'TBranchElement::GetEntry('
0147     ,'edm::Event::put<'
0148     ,'edm::stream::EDProducerAdaptorBase::doEvent'
0149     ,'edm::stream::EDFilterAdaptorBase::doEvent('
0150     ,'edm::EventProcessor::init(' #this may ignore too much, but needed to ignore member data of streams
0151     ,'edm::global::EDProducerBase::doEvent'
0152     ,'FastTimerService::postBeginJob()'
0153     ,'edm::EDProducer::doEvent('
0154     ,'_ZN3pat15PackedCandidate27covarianceParameterization_E'
0155     ,'edm::RootOutputFile::writeOne'
0156     ,'BSS segment'
0157     ,'bytes inside data symbol' #this shows the writes but will miss the reads
0158     ,'FSQ::HandlerTemplate' #some function statics
0159 #    ,'DQMStore::book'
0160     ,'TBufferFile::'
0161     ,'edm::service::MessageLogger::'
0162     ,'TClass::GetClass('
0163 ]
0164 
0165 #startOfMessage ='-------------------'
0166 endOfMessage ='-------------------'
0167 startOfMessage = 'Possible data race'
0168 startOfMessageLength = len(startOfMessage)
0169 messageStarted = False
0170 lineCount = 100
0171 buffer = []
0172 maxCount = 20
0173 lookForAddress = False
0174 foundAddress = False
0175 addressCount = 100
0176 possibleDataRaceRead = False
0177 foundStartOfMessage = False
0178 for l in f.readlines():
0179     if l[:2] != '==':
0180         continue
0181     if l.find(endOfMessage) != -1:
0182         foundAddress = False
0183         addressCount = 100
0184     if l.find(startOfMessage) != -1:
0185         lookForAddress = False
0186         foundAddress = False
0187         possibleDataRaceRead = (l.find('data race during read') != -1)
0188         if buffer:
0189             #print buffer
0190             print('---------------------')
0191             for b in buffer:
0192                 print(b[:-1])
0193         
0194         buffer=[l]
0195         lineCount = 0
0196         continue
0197 #    if lineCount == 2:
0198 #        if l.find('data race') == -1:
0199 #            buffer = []
0200 #            lineCount = 100
0201 #        possibleDataRaceRead = (l.find('data race during read') != -1)
0202     if lineCount < maxCount:
0203         skipThis = False
0204         for i in stackToIgnore:
0205             if l.find(i) != -1:
0206                 lineCount = 100
0207                 skipThis = True
0208                 buffer = []
0209                 break
0210         if skipThis:
0211             continue
0212         buffer.append(l)
0213         lineCount +=1
0214         if ' at 0x' in l:
0215             for i in messageToIgnore:
0216                 if l.find(i) != -1:
0217                     buffer = []
0218                     lineCount = 100
0219                     break
0220         if lineCount == 100:
0221             continue
0222         if l.find('Address 0x') != -1:
0223             lookForAddress = True
0224             foundAddress = False
0225             lineCount = 100
0226     if lineCount == maxCount:
0227         lookForAddress = True
0228         foundAddress = False
0229         lineCount = 100
0230     if lookForAddress:
0231         if l.find('Address 0x') != -1:
0232             foundAddress = True
0233             lookForAddress = False
0234             addressCount = 0
0235             lineCount = 100
0236     if foundAddress:
0237         addressCount +=1
0238         if addressCount < maxCount:
0239             buffer.append(l)
0240             for i in addressesToIgnore:
0241                 if l.find(i) != -1:
0242                     buffer = []
0243                     foundAddress = False
0244                     addressCount = 100
0245                     break
0246             if possibleDataRaceRead:
0247                 for i in addressesToIgnoreIfRead:
0248                     if l.find(i) != -1:
0249                         buffer = []
0250                         foundAddress = False
0251                         addressCount = 100
0252                         break
0253             if l[-3:]=="== ":
0254                 foundAddress = False
0255                 addressCount = 100