/debug/prof
/debug/prof is the IOSU device node for the Wii U's IO profiler API. It provides statistics about the percentage of IO bandwidth consumed by each of the determined IO channels. To measure an operation, a profiling checkpoint should be started just before it begins and end the checkpoint when it finishes. The profiler reports the I/O activity that occurred during that interval. The application can then either stop profiling or start another checkpoint to measure the next operation. The library is only available in DEV or TEST mode and not available in PROD mode.
It does not measure IO bus or DMA bandwidth directly — it works by sampling the kernel's per-thread CPU scheduler profiler and attributing those samples to running process IDs, mapping to a set of profiler channel IDs. The reported "percentage IO bandwidth" for a channel is really that channel's owning process's share of profiled scheduler activity during the measured interval.
The PPC shim RPL for this IOS node is nio_prof.rpl (see this page for further info).
PID to IO Channel Map
| Process ID | Channel ID |
|---|---|
| IOS-USB | IO_CHANNEL_USB |
| IOS-FS | IO_CHANNEL_FS |
| IOS-PAD | IO_CHANNEL_CONTROLLER |
| IOS-NET | IO_CHANNEL_NET |
| IOS-NSEC | IO_CHANNEL_SECIO |
| Default (everything else) | IO_CHANNEL_SYS |
Bandwidth Percentage Calculation
percentBandwidth = (profile sample count attributed to that channel's process) / (elapsed microseconds in the checkpoint) × 100
List of functions
Ioctl
| Command | Function |
|---|---|
| 0x1 | IO_ProfilerStartCheckpoint |
Ioctlv
| Command | Function |
|---|---|
| 0x1 | IO_ProfilerEndCheckpoint |