本文整理汇总了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();
}
示例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();
}
示例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 ();
}