GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
loadplay(1) FreeBSD General Commands Manual loadplay(1)

loadplay
CPU load player

loadplay -h

loadplay [-i file] [-o file] command [...]

The loadplay 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.

The following options are supported:
, --help
Show usage and exit.
, --input file
Read load recording from file instead of stdin.
, --output file
Output statistics to file instead of stdout.

The loadplay command injects the library “libloadplay.so” into command. This library simulates the load from the input and outputs load statistics.

The first line of output contains column headings, columns are separated by a single space.

The Following columns are present, columns containing %d occur for each core simulated:

The simulation progress in 0.001 second resolution.
The recorded clock frequency, sampled at the end of the frame.
The recorded load in 0.1 MHz resolution.
The simulated clock frequency set by the host process, sampled at the end of the frame.
The simulated load in 0.1 MHz resolution.

There 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.

The 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:

The sysctl 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) loadplay is core agnostic. Meaning that any core may have a .freq and .freq_levels sysctl handle. Due to this flexibility load recordings may in part or wholly be fabricated to test artificial loads or systems and features that do not yet exist. E.g. it is possible to offer a .freq handle for each core or fabricate new .freq_levels.

If setup succeeds a simulation thread is started that reads the remaining input lines, simulates the load and updates the kern.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 kern.cp_times. The host process reads this data and adjusts the clock frequencies, which in turn affects the next frame.

After reading the last line of input the simulation thread sends a SIGINT to the process to cause it to terminate.

If set the file named is used for input instead of stdin. This only affects the input of loadplay, the host process is not affected.
If set the file named is used for output instead of stdout. This only affects the output of loadplay, the host process is not affected.
Used to inject the library “libloadplay.so” into the host process.
Is set to the same path loadplay was called through. Remains untouched if the path does not contain a ‘/’ character.

I.e. calling “obj/loadplay” will set “LD_LIBRARY_PATH=obj”, calling “loadplay” will not.

This behaviour facilitates running test builds of loadplay and the library “libloadplay.so” without performing an install.

/usr/local/lib/libloadplay.so
A library injected into command via the LD_PRELOAD environment variable.

Play a load recording with loadplay:
> 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 output simultaneously into two different files:

> loadplay -i loads/freq_tracking.load -o load.csv powerd++ -f > load.out

Capture and display loadplay output:

> 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

loadrec(1), powerd(8), powerd++(8), rtld(1), signal(3), tee(1)

Implementation and manual by Dominic Fandrey <kami@freebsd.org>
March 5, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.