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(); }
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(); }