IOCLASSCOUNT(8) | System Manager's Manual | IOCLASSCOUNT(8) |
ioclasscount
ioclasscount |
[--track] [--leaks] [--maps=PID] [--site=SITE] [--reset] [--start] [--stop] [--exclude] [--size=BYTES] [--capsize=BYTES] [--tag=tag] [--zsize=BYTES] [classname] [...] |
ioclasscount
displays the instance counts
of OSObject-based C++ classes in the kernel, incremented by the number of
direct
subclasses that have an instance count of at least 1. For example, if
IONetworkController is not directly instantiated, but its direct subclass
IOEthernetController has any instances, then IONetworkController's instance
count will be at least 1; if another direct subclass such as IOFWController
has any instances, then IONetworkController's instance count will be at
least 2; and so on. (This modification of instance counts prevents unloading
of kexts defining superclasses that have no instances, but whose subclasses
in other kexts have instances.)
If classes are specified, instance counts are printed as a comma-separated list in the order specified. If no classes are specified, instance counts for all classes are printed, one per line of output and sorted by name.
This information is useful for tracking leaks. Instance counts can also found in the root of the IORegistry in the “IOKitDiagnostics” property.
DEVELOPMENT or DEBUG kernels support collecting backtraces on IOMemoryDescriptor mapping and wiring of memory, and, when running with boot-arg io=0x00400000, on object allocation and calls to IOMalloc*. With boot-arg io=0x02400000, capturing backtraces is enabled at startup.
The following operands are available:
--start
--stop
--reset
--track
--maps
=pid--site
=site--leaks
--exclude
--size
=n--capsize
=n--tag
=tag--zsize
=nDisplay instance counts for IOPCIDevice and AppleTestPCI:
/usr/sbin/ioclasscount
IOPCIDevice AppleTestPCI
Start collecting backtraces for everything:
Display backtraces and allocation sizes for everything:
Display all backtraces and allocation sizes collected for OSData & OSSymbol:
Display all backtraces and allocation sizes collected except for OSSymbol, IOMalloc*, IOMemoryDescriptor mapping and wiring (names from IOKitDebug.h):
November 6, 2008 | Darwin |