/* * --------------------- OP NB DERIVED FUNCTION * * NB data is only guaranteed reliable for load operations * that miss in L1 and L2 cache. NB data arrives too late * to be reliable for store operations */ void CaPerfTranslator::trans_ibs_op_nb(struct ibs_op_sample* trans_op, gtUInt32 selected_flag, CpuProfileProcess* pProc, gtUInt64 ldAddr, gtUInt32 funcSize, CpuProfileModule* pMod, gtUInt64 ip, gtUInt32 pid, gtUInt32 tid, gtUInt32 cpu, gtUInt32 os, gtUInt32 usr, gtUInt32 count, const FunctionSymbolInfo* pFuncInfo) { // In per-process mode, ignore this sample if it does not belong to the target pid if (! _isTargetPid(pid)) { return; } /* Preliminary check */ if ((selected_flag) == 0) { return; } if (!IBS_OP_IBS_LD_OP(trans_op)) { return; } if (!IBS_OP_IBS_DC_MISS(trans_op)) { return; } if (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0) { return; } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by local processor */ { AGG_IBS_COUNT(DE_IBS_NB_LOCAL, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE) { if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by remote processor */ { AGG_IBS_COUNT(DE_IBS_NB_REMOTE, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_L3) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_01(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_LOCAL_L3, count); } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_CACHE) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_02(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_LOCAL_CACHE, count); } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_CACHE) { if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_02(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_REMOTE_CACHE, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_DRAM) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_03(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_LOCAL_DRAM, count); } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_DRAM) { if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_03(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_REMOTE_DRAM, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_OTHER) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_07(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_LOCAL_OTHER, count); } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_OTHER) { if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && IBS_OP_NB_IBS_REQ_SRC_07(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_REMOTE_OTHER, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_CACHE_STATE_M) { if (IBS_OP_NB_IBS_REQ_SRC_02(trans_op) && !IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_CACHE_STATE_M, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_CACHE_STATE_O) { if (IBS_OP_NB_IBS_REQ_SRC_02(trans_op) && IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) { AGG_IBS_COUNT(DE_IBS_NB_CACHE_STATE_O, count) ; } } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_LOCAL_LATENCY) { if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by local processor */ AGG_IBS_COUNT(DE_IBS_NB_LOCAL_LATENCY, IBS_OP_DC_MISS_LATENCY(trans_op)); } CHECK_OP_NB_SELECTED_FLAG(DE_IBS_NB_REMOTE_LATENCY) { if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by remote processor */ AGG_IBS_COUNT(DE_IBS_NB_REMOTE_LATENCY, IBS_OP_DC_MISS_LATENCY(trans_op)); } }
/* * --------------------- OP NB DERIVED FUNCTION * * NB data is only guaranteed reliable for load operations * that miss in L1 and L2 cache. NB data arrives too late * to be reliable for store operations */ void trans_ibs_op_nb (struct transient * trans, unsigned int selected_flag, unsigned int size) { struct ibs_op_sample * trans_op = ((struct ibs_sample*)(trans->ext))->op; unsigned int i, j, mask = 1; /* Preliminary check */ if (!IBS_OP_IBS_LD_OP(trans_op)) return; if (!IBS_OP_IBS_DC_MISS(trans_op)) return; if (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0) return; for (i = IBS_OP_NB_BASE, j =0 ; i <= IBS_OP_NB_END && j < size ; i++, mask = mask << 1) { if ((selected_flag & mask) == 0) continue; j++; switch (i) { case DE_IBS_NB_LOCAL: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by local processor */ AGG_IBS_EVENT(DE_IBS_NB_LOCAL) ; break; case DE_IBS_NB_REMOTE: if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by remote processor */ AGG_IBS_EVENT(DE_IBS_NB_REMOTE) ; break; case DE_IBS_NB_LOCAL_L3: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x1)) AGG_IBS_EVENT(DE_IBS_NB_LOCAL_L3); break; case DE_IBS_NB_LOCAL_CACHE: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x2)) AGG_IBS_EVENT(DE_IBS_NB_LOCAL_CACHE); break; case DE_IBS_NB_REMOTE_CACHE: if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x2)) AGG_IBS_EVENT(DE_IBS_NB_REMOTE_CACHE) ; break; case DE_IBS_NB_LOCAL_DRAM: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x3)) AGG_IBS_EVENT(DE_IBS_NB_LOCAL_DRAM); break; case DE_IBS_NB_REMOTE_DRAM: if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x3)) AGG_IBS_EVENT(DE_IBS_NB_REMOTE_DRAM) ; break; case DE_IBS_NB_LOCAL_OTHER: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x7)) AGG_IBS_EVENT(DE_IBS_NB_LOCAL_OTHER); break; case DE_IBS_NB_REMOTE_OTHER: if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op) && (IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x7)) AGG_IBS_EVENT(DE_IBS_NB_REMOTE_OTHER) ; break; case DE_IBS_NB_CACHE_STATE_M: if ((IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x2) && !IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) AGG_IBS_EVENT(DE_IBS_NB_CACHE_STATE_M) ; break; case DE_IBS_NB_CACHE_STATE_O: if ((IBS_OP_NB_IBS_REQ_SRC(trans_op) == 0x2) && IBS_OP_NB_IBS_CACHE_HIT_ST(trans_op)) AGG_IBS_EVENT(DE_IBS_NB_CACHE_STATE_O) ; break; case DE_IBS_NB_LOCAL_LATENCY: if (!IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by local processor */ AGG_IBS_COUNT(DE_IBS_NB_LOCAL_LATENCY, IBS_OP_DC_MISS_LATENCY(trans_op)); break; case DE_IBS_NB_REMOTE_LATENCY: if (IBS_OP_NB_IBS_REQ_DST_PROC(trans_op)) /* Request was serviced by remote processor */ AGG_IBS_COUNT(DE_IBS_NB_REMOTE_LATENCY, IBS_OP_DC_MISS_LATENCY(trans_op)); break; default: break; } } }