コード例 #1
0
/*
 * Function: Four  dumpBtreePage(PageID*)
 *
 * Description:
 *  dump routine.
 *
 * Returns:
 *  Error code
 *    some errors caused by function calls
 */
Four dumpBtreePage(
		PageID		*pid,
		KeyDesc		kdesc)
{
	Four e;         /* error number */
	BtreePage *apage;       /* page to dump */
	
	
	e = BfM_GetTrain(pid, (char **)&apage, PAGE_BUF);
	if (e < 0)  ERR(e);
	
	if (kdesc.kpart[0].type == SM_INT){
		if (apage->any.hdr.type & INTERNAL)
			dumpInternal(&(apage->bi), pid, kdesc.kpart[0].type);
		else if (apage->any.hdr.type & LEAF)
			dumpLeaf(&(apage->bl), pid, kdesc.kpart[0].type);
		else if (apage->bo.hdr.type & OVERFLOW)
			dumpOverflow(&(apage->bo), pid);
		else
			ERRB1(eBADBTREEPAGE_BTM, pid, PAGE_BUF);
	}else if (kdesc.kpart[0].type == SM_VARSTRING){
		if (apage->any.hdr.type & INTERNAL)     
			dumpInternal(&(apage->bi), pid, kdesc.kpart[0].type);  
		else if (apage->any.hdr.type & LEAF)       
			dumpLeaf(&(apage->bl), pid, kdesc.kpart[0].type);  
		
		else if (apage->bo.hdr.type & OVERFLOW)     
			dumpOverflow(&(apage->bo), pid);  
		else        
			ERRB1(eBADBTREEPAGE_BTM, pid, PAGE_BUF);
	}
	e = BfM_FreeTrain(pid, PAGE_BUF);
	if (e < 0) ERR(e);
	return(eNOERROR);
}
コード例 #2
0
ファイル: SamplingTool.cpp プロジェクト: WebKitNix/webkitnix
void SamplingRegion::sample()
{
    // Make sure we lock s_current.
    Locker locker;
    
    // Create a spectrum if we don't have one already.
    if (!s_spectrum)
        s_spectrum = new Spectrum<const char*>();
    
    ASSERT(s_currentOrReserved & 1);
    
    // Walk the region stack, and record each region we see.
    SamplingRegion* region = bitwise_cast<SamplingRegion*>(s_currentOrReserved & ~1);
    if (region) {
        for (; region; region = region->m_previous)
            s_spectrum->add(region->m_name);
    } else
        s_noneOfTheAbove++;
    
    if (s_numberOfSamplesSinceDump++ == SamplingThread::s_hertz) {
        s_numberOfSamplesSinceDump = 0;
        dumpInternal();
    }
}
コード例 #3
0
ファイル: SamplingTool.cpp プロジェクト: WebKitNix/webkitnix
void SamplingRegion::dump()
{
    Locker locker;
    
    dumpInternal();
}