Ejemplo n.º 1
0
Timer::Timer()
{
	init();
	calcLatency();
	start();
}
Ejemplo n.º 2
0
int updateStatisticsCache(statsCache* sCache ,
                          const char* msgCategoryName ,
                          long         numBytesRecieved,
                          long        timeSecs,
                          long        timeMicroSecs,
                          double      cLatency,
                          struct timeval tv)
{
    int ret;
    perfData *mPData = NULL;
    double latency = 0;

    if(timeSecs != 0 || timeMicroSecs != 0)
       calcLatency(timeSecs,timeMicroSecs,&latency,tv);
    else
       latency=cLatency;
                                                                                
    if(sCache->mNumMsg>0 && sCache->mSymbolTable)
    {
        /* More than one category*/
        mPData = 
            (perfData*) wtable_lookup (sCache->mSymbolTable,msgCategoryName);
        /* If category doesn't already exist*/
        if (!mPData)
        {
            /* Then create & init*/
            mPData = (perfData*)calloc(1,sizeof(perfData));    
            initPerfData(mPData,sCache->mOutfile,msgCategoryName);
        }        
    }
    else
    {
        /* No categories */
        mPData = sCache->mPData;
    }

    /* Update statistics for period    */
    mPData->mMsgCountP++;
    mPData->mByteCountP += (double)numBytesRecieved;
    
    /* change to get rid of spurious results*/
    /*    if (latency > 0) */
    if (/*latency >0  &&*/ latency<999999999)
    {
        mPData->mLatMsgCountP++;
        mPData->mLatAccumP += latency;
        if (latency < mPData->mMinLatencyP)
        {
            mPData->mMinLatencyP = latency;
        }
        if (latency > mPData->mMaxLatencyP)
        {
            mPData->mMaxLatencyP = latency;
        }
        mPData->mLatSquareP += (latency*latency);
    }     

    /* Update table in structure if more than one category*/
    if(sCache->mNumMsg>0)
    {
        ret=
        wtable_insert(sCache->mSymbolTable,msgCategoryName, (void*) mPData);
        if(ret>0)
        {
            /*error in insert*/    
        }  
             
    }

    sCache->mNumMessages++; 
    sCache->mNumBytes+=numBytesRecieved;
    return STATS_OK;
}
Ejemplo n.º 3
0
DDGNode::DDGNode(inst_t instruction, int no) :
	instruction(instruction), instructionNumber(no), destReg(INVALID_REG),
	rootNode(true), latency(calcLatency()), height(latency)
{
	initRegisterInfo();
}