示例#1
0
文件: traceAddEvent.C 项目: jimix/k42
    void Dump() {
	const char *countName[] = {
	    "FCMDefault::mapPage()                     ",
	    "FCMDefault::getPageInternal()             ",
	    "FCMComputation::mapPage()                 ",
	    "FCMComputation::getPageInternal()         ",
	    "FCMComputation::getPageInternal_PARENT    ",
	    "FCMComputation::getPageInternal_CHILD     ",
	    "FCMComputation::forkCopy()                ",
	    "FCMComputation::forkCollapse()            ",
	    "FCMDefaultMultiRep::mapPage()             ",
	    "FCMDefaultMultiRep::getPageInternal()     ",
	    "FCMCRW::mapPage()                         ",
	    "ExceptionLocal_PgfltHandler()             ",
	    "FCMCommon LOCK CONTENTION                 ",
	    "NFS_RPC_ACQUIRE                           ",
	    "NFS_RPC_BLOCKED                           ",
	    "NFS_RPC_OP				       ",
	    "Linux syscall			       ",
            "FCMDefault::startFillPage()               ",
            "FCMDefault::startFillPage():ZeroFill      ",
	    "FCMDefault::findOrAllocatePageAndLock     ",
	    "FCMDefault::findOrAllocatePageAndLock:allc",

	    "---ERR-THIS-IS-MAX---"
	};

	//for (int i = 0; i < TraceAutoCount::MAX; i++) {
	for (int i = 0; i < 0; i++) {
	    DO_PRINTF("%s", countName[i]);
	    DO_PRINTF("time=%lld, num=%lld\n", time[i], num[i]);
	}
    }
示例#2
0
文件: traceAddEvent.C 项目: jimix/k42
int
main(int argc, char *argv[])
{
    NativeProcess();

    VPNum numbVPs, vp;
    SysStatus rc;
    char *str;
    uval turnTraceOn = 2; // Default do nothing to the trace Mask

    numbVPs = DREFGOBJ(TheProcessRef)->ppCount();
    passert((numbVPs < MAX_CPUS), err_printf("too many vps\n"));

    BlockBarrier bar(numbVPs);

    if (argc < 2) {
	str = "User-level DEFAULT event [0|1]";
    } else {
	str = argv[1];
    }
    if (argc == 3) {
	if (argv[2][0] == '0') turnTraceOn = 0;
	if (argv[2][0] == '1') turnTraceOn = 1;
    }

    err_printf("Inserting event [%s] on all VPs...\n", str);

    // create vps
    for (vp = 1; vp < numbVPs; vp++) {
	rc = ProgExec::CreateVP(vp);
	passert(_SUCCESS(rc), err_printf("ProgExec::CreateVP failed (0x%lx)\n", rc));
    }

    PFStat pfStats[numbVPs];

    // start vps
    for (vp = 1; vp < numbVPs; vp++) {
	LaunchChildMsg *const msg =
	    new(Scheduler::GetEnabledMsgMgr()) LaunchChildMsg;
	msg->vp = vp;
	msg->bar = &bar;
	msg->eventStr = str;
	msg->turnTraceOn = turnTraceOn;
	msg->stat = pfStats;
	rc = msg->send(SysTypes::DSPID(0, vp));
	tassert(_SUCCESS(rc), err_printf("send failed\n"));
    }

    // I'm vp 0
    childMain(0, str, &bar, turnTraceOn, pfStats);

    if (turnTraceOn == 0) {
	for (vp = 0; vp < numbVPs; vp++) {
	    DO_PRINTF("VP%ld:\n-----------------\n", vp);
	    pfStats[vp].Dump();
	}
    }
}
示例#3
0
static INT32 DO_table_rearrange(DB_TABLE *t, UINT8 *buf)
{
	UINT16 i;
	UINT16 node_num = 0;
	
	DO_PRINTF("DO_table_rearrange():before rearrange node num = %d!\n", t->node_num);
	
	for(i = 0; i < t->node_num; i++)
	{
		/*for table rearrange, node id MSB=0xFF is deleted node*/
		if(t->table_buf[i].node_id[NODE_ID_SIZE-1] != 0xFF)
		{
			MEMCPY(buf+node_num*sizeof(NODE_IDX_PARAM), (UINT8 *)&t->table_buf[i],  sizeof(NODE_IDX_PARAM));
			node_num++;
		}

	}
	DO_PRINTF("after table rearrange ,valid node num = %d!\n", node_num);
	MEMCPY((UINT8 *)t->table_buf, buf, node_num*sizeof(NODE_IDX_PARAM));
	t->node_num = node_num;

	return DB_SUCCES;

}