loadrec(1)

NAME
loadrec - CPU load recorder

SYNOPSIS
loadrec -h
loadrec [-v] [-d ival] [-p ival] [-o file]

DESCRIPTION
The loadrec command performs a recording of the current load. The purpose is to reproduce this load to test different powerd(8) and powerd++(8) configurations under identical load conditions using loadplay(1).

  ARGUMENTS
The following argument types can be given:

ival
    A time interval can be given in seconds or milliseconds.
        s, ms
    An interval without a unit is treated as milliseconds.

file
    A file name.

  OPTIONS
The following options are supported:

-h, --help
    Show usage and exit.

-v, --verbose
    Be verbose and produce initial diagnostics on stderr.

-d, --duration ival
    The duration of the recording session, defaults to 30 seconds.

-p, --poll ival
    The polling interval to take load samples at, defaults to 25 milliseconds.

-o, --output file
    The output file to write the load to.

USAGE NOTES
To create reproducible results set a fixed CPU frequency below the threshold at which the turbo mode is activated. E.g. an Intel(R) Core(TM) i7-4500U CPU supports the following frequency settings:

    > sysctl dev.cpu.0.freq_levels
    dev.cpu.0.freq_levels: 2401/15000 2400/15000 2300/14088 2200/13340 2000/11888 1900/11184 1800/10495 1700/9680 1500/8372 1400/7738 1300/7119 1200/6511 1100/5789 900/4643 800/4090 768/3550

Supposedly the first mode, which is off by 1 MHz, invokes the turbo mode. However all modes down to 1800 MHz actually invoke the turbo mode for this model. The only way to determine this is by benchmarking the steppings to find out that there is a huge performance step between 1700 and 1800 MHz and that all the modes above 1700 MHz show the exact same performance (given similar thermal conditions).

So in order to produce a usable measurement for this CPU the clock needs to be set to 1700 MHz or lower (higher is better to be able to record a wider range of loads):

    # service powerd++ stop
    Stopping powerdxx.
    Waiting for PIDS: 63574.
    # powerd++ -M1700

Run loadrec for a brief time to test it:

    > loadrec -d.25s
    usr.app.powerdxx.loadrec.features=1
    hw.machine=amd64
    hw.model=Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
    hw.ncpu=4
    hw.acpi.acline=1
    dev.cpu.0.freq=768
    dev.cpu.0.freq_levels=2401/15000 2400/15000 2300/14088 2200/13340 2000/11888 1900/11184 1800/10495 1700/9680 1500/8372 1400/7738 1300/7119 1200/6511 1100/5789 900/4643 800/4090 768/3550
    0 768 768 768 768 728001 0 278439 54957 10215972 753315 0 245117 7838 10270972 767662 0 241991 37110 10230545 772745 0 235729 10307 10258490
    25 768 768 768 768 0 0 0 0 3 2 0 0 0 1 0 0 0 0 3 0 0 0 0 4
    25 768 768 768 768 0 0 0 0 3 1 0 0 0 2 0 0 0 0 3 1 0 0 0 2
    25 768 768 768 768 0 0 1 0 2 1 0 2 0 0 0 0 0 0 3 0 0 1 0 2
    25 768 768 768 768 3 0 0 0 1 1 0 2 0 1 1 0 3 0 0 2 0 2 0 0
    25 768 768 768 768 0 0 0 0 3 0 0 1 0 2 0 0 0 0 3 3 0 0 0 0
    25 768 768 768 768 0 0 0 0 3 0 0 0 0 3 0 0 0 0 3 2 0 1 0 0
    25 768 768 768 768 0 0 0 0 3 0 0 0 0 3 0 0 0 0 3 2 0 1 0 0
    25 768 768 768 768 2 0 0 0 1 1 0 1 0 1 0 0 2 0 1 2 0 1 0 0
    25 768 768 768 768 0 0 0 0 4 1 0 2 0 1 0 0 0 0 4 0 0 1 0 2
    25 768 768 768 768 0 0 0 0 3 2 0 1 0 0 0 0 0 0 3 0 0 0 0 4

Printing the load creates significant load itself, so for the actual measurement the output should be written to a file. Create your workload and start your measurement:

    > loadrec -o video-session.load

On the example setup loadrec produces a load of 0.001 (i.e. 0.1%), so its effect on the measurement is negligible.

SEE ALSO
cpufreq(4), loadplay(1), powerd(8), powerd++(8), sysctl(8)

AUTHORS
Implementation and manual by Dominic Fandrey <kami@freebsd.org>