|
NAMEloadplay —
CPU load player
SYNOPSIS
DESCRIPTIONTheloadplay command replays a load recording created
with
loadrec(1).
The command can either be
powerd(8)
or
powerd++(8),
compatibility with other tools has not been tested.
OPTIONSThe following options are supported:USAGE NOTESTheloadplay command injects the
library “libloadplay.so” into
command. This library simulates the load from the input
and outputs load statistics.
OUTPUTThe first line of output contains column headings, columns are separated by a single space.The Following columns are present, columns containing
SAMPLINGThere is one sample for each recorded line. The duration of each frame depends on the recording, which defaults to 25 ms. At this sample rate loads are dominated by noise, so a gliding average should be applied to any load columns for further use, such as plotting.IMPLEMENTATION NOTESThe injected libloadplay.so works by intercepting system function calls and substituting the host environment with the recording. To achieve this the following function calls are intercepted:
INITIALISATIONThesysctl family of functions is backed by a table that
is initialised from the header of the load recording. If the heading is
incomplete the setup routines print a message on
stderr. All the following intercepted function calls
will return failure, ensuring that the host process is unable to operate and
terminates.
Like
powerd++(8)
and
loadrec(1)
SIMULATIONIf setup succeeds a simulation thread is started that reads the remaining input lines, simulates the load and updates thekern.cp_times entry in the thread safe sysctl table.
For each frame a line of output with load statistics is produced.
Interaction with the host process happens solely through the
sysctl table. The simulation reads the recorded loads and the current core
frequencies to update FINALISATIONAfter reading the last line of input the simulation thread sends aSIGINT to the process to cause it to terminate.
ENVIRONMENT
FILES
EXAMPLESPlay a load recording withloadplay :
> loadplay -i loads/freq_tracking.load powerd++ time[s] cpu.0.rec.freq[MHz] cpu.0.rec.load[MHz] cpu.0.run.freq[MHz] cpu.0.run.load[MHz] cpu.1.rec.freq[MHz] cpu.1.rec.load[MHz] cpu.1.run.freq[MHz] cpu.1.run.load[MHz] cpu.2.rec.freq[MHz] cpu.2.rec.load[MHz] cpu.2.run.freq[MHz] cpu.2.run.load[MHz] cpu.3.rec.freq[MHz] cpu.3.rec.load[MHz] cpu.3.run.freq[MHz] cpu.3.run.load[MHz] 0.025 1700 1700.0 1700 1700.0 1700 0.0 1700 0.0 1700 1700.0 1700 1700.0 1700 850.0 1700 850.0 0.050 1700 1700.0 1700 1700.0 1700 1700.0 1700 1700.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.075 1700 566.7 1700 566.6 1700 1700.0 1700 1700.0 1700 0.0 1700 0.0 1700 566.7 1700 566.6 0.100 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.125 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.150 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.175 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.200 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.225 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.250 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 0.275 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 1700 0.0 Capture load and > loadplay -i loads/freq_tracking.load -o load.csv powerd++ -f > load.out Capture and display > loadplay -i loads/freq_tracking.load -o load.csv powerd++ -f | tee load.out power: online, load: 527 MHz, cpu0.freq: 1700 MHz, wanted: 1405 MHz power: online, load: 459 MHz, cpu0.freq: 1400 MHz, wanted: 1224 MHz power: online, load: 502 MHz, cpu0.freq: 1200 MHz, wanted: 1338 MHz power: online, load: 548 MHz, cpu0.freq: 1300 MHz, wanted: 1461 MHz power: online, load: 704 MHz, cpu0.freq: 1500 MHz, wanted: 1877 MHz power: online, load: 750 MHz, cpu0.freq: 1900 MHz, wanted: 2000 MHz power: online, load: 805 MHz, cpu0.freq: 2000 MHz, wanted: 2146 MHz power: online, load: 772 MHz, cpu0.freq: 2200 MHz, wanted: 2058 MHz power: online, load: 574 MHz, cpu0.freq: 2000 MHz, wanted: 1530 MHz power: online, load: 515 MHz, cpu0.freq: 1500 MHz, wanted: 1373 MHz SEE ALSOloadrec(1), powerd(8), powerd++(8), rtld(1), signal(3), tee(1)AUTHORSImplementation and manual by Dominic Fandrey <kami@freebsd.org>
Visit the GSP FreeBSD Man Page Interface. |