Exemplo n.º 1
0
void Dumper::Initialize(
    PhysicalResourceArray<Core>& coreList,
    PhysicalResourceArray<Thread>& threadList 
){
    LoadParam();

    m_dumpEnabled = false;

    if( m_dumpEachThread ){
        for( int i = 0; i < threadList.GetSize(); i++ ){
            Thread* thread = threadList[i];
            ThreadDumper dumper;
            String suffix = "t" + boost::lexical_cast<String>(i);
            CreateThreadDumper( &dumper, suffix, coreList );
            m_dumperMap[thread] = dumper;
        }
    }
    else if( m_dumpEachCore ){
        for( int i = 0; i < coreList.GetSize(); i++ ){
            Core* core = coreList[i];

            ThreadDumper dumper;
            String suffix = "c" + boost::lexical_cast<String>(i);
            CreateThreadDumper( &dumper, suffix, coreList );

            for( int j = 0; j < core->GetThreadCount(); j++ ){
                Thread* thread = core->GetThread(j);
                m_dumperMap[thread] = dumper;
            }
        }
    }
    else{
        ThreadDumper dumper;
        CreateThreadDumper( &dumper, "", coreList );
        for( int i = 0; i < threadList.GetSize(); i++ ){
            Thread* thread = threadList[i];
            m_dumperMap[thread] = dumper;
        }
    }
}