Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-01 23:40:44

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