-
Notifications
You must be signed in to change notification settings - Fork 1
Implement ptime -m #69
Copy link
Copy link
Open
Labels
Component: ptimeIssues related to ptime(1)Issues related to ptime(1)Priority: MediumNormal priorityNormal priorityType: EnhancementA request, idea, or new functionalityA request, idea, or new functionality
Metadata
Metadata
Assignees
Labels
Component: ptimeIssues related to ptime(1)Issues related to ptime(1)Priority: MediumNormal priorityNormal priorityType: EnhancementA request, idea, or new functionalityA request, idea, or new functionality
The original
ptimehad a-moption to print microstate accounting details. The closest equivalent on Linux is delay accounting, which would give us these statistics:cpu_run_real_totalcpu_run_virtual_totalcpu_delay_totalblkio_delay_totalswapin_delay_totalfreepages_delay_totalthrashing_delay_totalcompact_delay_totalwpcopy_delay_totalirq_delay_totalUnfortunately, Linux delay accounting (
CONFIG_TASK_DELAY_ACCT) is disabled by default to prevent minor performance overhead. It can be enabled at boot via kernel boot options (addingdelayacct) or at runtime usingsysctl kernel.task_delayacct=1to allow tools like to report I/O and CPU wait times. If it is off, we should probably detect this and display a warning. Even if the user turns it on, it only applies to newly started processes, not retroactively to existing processes, so our user interaction should be carefully phrased to set expectations appropriately.