docs/cpu-load: format the example code.

format the example code.

Signed-off-by: Hui Su <sh_def@163.com>
Link: https://lore.kernel.org/r/20201018170557.GA7670@rlk
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Hui Su 2020-10-19 01:05:57 +08:00 committed by Jonathan Corbet
parent 4fb220da0d
commit bb7a2c6362

View File

@ -66,16 +66,19 @@ will lead to quite erratic information inside ``/proc/stat``::
(void) signr;
stop = 1;
}
static unsigned long hog (unsigned long niters)
{
stop = 0;
while (!stop && --niters);
return niters;
}
int main (void)
{
int i;
struct itimerval it = { .it_interval = { .tv_sec = 0, .tv_usec = 1 },
struct itimerval it = {
.it_interval = { .tv_sec = 0, .tv_usec = 1 },
.it_value = { .tv_sec = 0, .tv_usec = 1 } };
sigset_t set;
unsigned long v[HIST];