当前位置: 首页>>代码示例>>C++>>正文


C++ IOService::getBusyState方法代码示例

本文整理汇总了C++中IOService::getBusyState方法的典型用法代码示例。如果您正苦于以下问题:C++ IOService::getBusyState方法的具体用法?C++ IOService::getBusyState怎么用?C++ IOService::getBusyState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOService的用法示例。


在下文中一共展示了IOService::getBusyState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: db_dumpiojunk

void db_dumpiojunk( const IORegistryPlane * plane )
{
    IORegistryEntry *		next;
    IORegistryIterator * 	iter;
    OSOrderedSet *		all;
    char			format[] = "%xxxs";
    IOService *			service;

    iter = IORegistryIterator::iterateOver( plane );

    all = iter->iterateAll();
    if( all) {
        dbugprintf("Count %d\n", all->getCount() );
        all->release();
    } else dbugprintf("Empty\n");

    iter->reset();
    while( (next = iter->getNextObjectRecursive())) {
		snprintf(format + 1, sizeof(format) - 1, "%ds", 2 * next->getDepth( plane ));
		dbugprintf( format, "");
		dbugprintf( "%s", next->getName( plane ));
		if( (next->getLocation( plane )))
				dbugprintf("@%s", next->getLocation( plane ));
		dbugprintf(" <class %s", next->getMetaClass()->getClassName());
			if( (service = OSDynamicCast(IOService, next)))
				dbugprintf(", busy %ld", service->getBusyState());
		dbugprintf( ">\n");
    }
    iter->release();
}
开发者ID:SbIm,项目名称:xnu-env,代码行数:30,代码来源:IOKitDebug.cpp

示例2: IOPrintPlane

void IOPrintPlane( const IORegistryPlane * plane )
{
    IORegistryEntry *		next;
    IORegistryIterator * 	iter;
    OSOrderedSet *		all;
    char			format[] = "%xxxs";
    IOService *			service;

    iter = IORegistryIterator::iterateOver( plane );
    assert( iter );
    all = iter->iterateAll();
    if( all) {
        DEBG("Count %d\n", all->getCount() );
        all->release();
    } else
	DEBG("Empty\n");

    iter->reset();
    while( (next = iter->getNextObjectRecursive())) {
	snprintf(format + 1, sizeof(format) - 1, "%ds", 2 * next->getDepth( plane ));
	DEBG( format, "");
	DEBG( "\033[33m%s", next->getName( plane ));
	if( (next->getLocation( plane )))
            DEBG("@%s", next->getLocation( plane ));
	DEBG("\033[0m <class %s", next->getMetaClass()->getClassName());
        if( (service = OSDynamicCast(IOService, next)))
            DEBG(", busy %ld", (long) service->getBusyState());
	DEBG( ">\n");
//	IOSleep(250);
    }
    iter->release();
}
开发者ID:SbIm,项目名称:xnu-env,代码行数:32,代码来源:IOKitDebug.cpp

示例3: IOMalloc

void
OWCDumpIORegistry::dumpIORegistry (void *argument)
{
	IOSleep (DUMP_DELAY_SECONDS * 1000);
		
	IORegistryIterator *iter = IORegistryIterator::iterateOver (gIOServicePlane, kIORegistryIterateRecursively);
	if (iter == NULL) return;
	
	int maxBufferSize = 2048;
	char *buffer = (char *) IOMalloc (maxBufferSize);
	if (buffer == NULL) return;
	
	OSSerialize *s = OSSerialize::withCapacity (maxBufferSize);
	if (s == NULL) return;
	
	IORegistryEntry *object = iter->getCurrentEntry ();
	while (object) {
		s->clearText ();
		
		int busyState = 0;
		IOService *ios = OSDynamicCast (IOService, object);
		if (ios) busyState = ios->getBusyState ();
					
		int pathSize = maxBufferSize;
		object->getPath (buffer, &pathSize, gIOServicePlane);
		kprintf ("\n--> %s <%s> (%d, %d)\n", buffer, object->getMetaClass ()->getClassName (), object->getRetainCount (), busyState);
		
		if (object->serializeProperties (s)) {
			kprintf ("%s\n", s->text ());
		} else {
			kprintf ("serializeProperties failed\n");
		}
		
		object = iter->getNextObject ();
	} 
	
	IOFree (buffer, maxBufferSize);
	s->release ();
	iter->release ();
}
开发者ID:OpenDarwin-CVS,项目名称:XPostFacto,代码行数:40,代码来源:OWCDumpIORegistry.cpp


注:本文中的IOService::getBusyState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。