hogs

List the processes that are hogging the CPU

Syntax:

hogs [options] [pids ...]

Runs on:

Neutrino

Options:

-n
Show the names of processes (hogs always displays the process IDs).
-p priority
Run hogs at the given priority (default: the same as the parent process).
-s sec
Sleep this long between updates (default: 3 seconds).
-% num
Show only processes that consume this percentage or more CPU. You can use this option to reduce the amount of output.

Description:

The hogs utility displays a list of processes in descending order by percentage of CPU usage (i.e. it shows who's hogging the processor). It loops forever, sleeping between updates.

The format of the output is tabular, and includes:

PID
The ID of the process being reported.
NAME
The name of the process (included only if you specify the -n option).
MSEC
The number of milliseconds for which this process has been running since the last iteration.
PIDS
The amount of time that the process ran in this iteration, as a percentage of the times of all the other processes running.
SYSTEM
The amount of time that the process ran in this iteration, as a percentage of the iteration time.

Note:
  • The SYSTEM column is incorrect on multicore systems; the numbers in this column will add up to (roughly) the number of processors times 100%. Use the top utility instead.
  • The numbers from hogs are approximate. For more precise data, use tracelogger and the System Analysis Toolkit (see the SAT User's Guide).

Examples:

Display the processes that are using 10% or more of the CPU. Include the name of the processes:

$ hogs -n -% 10
PID             NAME  MSEC  PIDS SYSTEM
1                     2023   78%    67%
8200       devb-eide   384   14%    12%

1                     2456   80%    81%
8200       devb-eide   357   11%    11%

1                     2369   87%    78%

This sample includes three iterations.

See also:

pidin, ps, top, tracelogger

System Analysis Toolkit User's Guide

Fine-Tuning Your System in the Neutrino User's Guide