Add programmatic interface for data produced by cpuuse
Summary
Purpose
Currently, the data produced by the 'cpuuse' shell command is output via a printer visitor which makes it hard to consume programmatically as it requires parsing the resulting string. This functionality could be recreated in an application, but it would be better to provide this directly to reduce copying.
Result
The end result of this feature request should be a cpu_usage_visitor (cpuusagereport.c) that is broken into 2 pieces:
- a visitor that creates the per-task dataset and provides it to a callback
- a printer callback compatible with the new visitor
This would need documentation updates since it provides new public interfaces. This would also need a new test in the testsuite.