Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
loadplay(1)		FreeBSD	General	Commands Manual		   loadplay(1)

NAME
     loadplay -- CPU load player

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

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

   OPTIONS
     The following options are supported:

     -h, --help
	     Show usage	and exit.

     -i, --input file
	     Read load recording from file instead of stdin.

     -o, --output file
	     Output statistics to file instead of stdout.

USAGE NOTES
     The loadplay command is a shell script that injects libloadplay.so	into
     command.  This library simulates the load from the	input and outputs load
     statistics.  If command generates output on stdout, it will be mixed into
     the load statistics. So powerd(8) should be run without the -v flag and
     powerd++(8) without the -f	flag.

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

     time[s]
	     The simulation progress in	seconds.

     cpu.%d.freq[MHz]
	     The current clock speed rating.

     cpu.%d.recload
	     The load as recorded, a value in the range	[0, 1.0].

     cpu.%d.load
	     The load under the	current	clock speed. This value	may go above
	     1.0, because the current speed rating may be too low to consume
	     the load.	In this	case the unconsumed load (i.e. everything
	     above 1.0)	spills over to the next	simulation frame.

     max(freqs)[MHz]
	     The highest clock speed in	the output line.

     sum(recloads)
	     The sum of	recorded loads in in the output	line, a	value in the
	     range [0, ncpu].

     max(recloads)
	     The highest recorded load in this output line, a value in the
	     range [0, 1.0].

     sum(loads)
	     The sum of	loads according	to the current clock speed in the out-
	     put line.

     max(loads)
	     The highest load according	to the current clock speed in the out-
	     put line.

   SAMPLING
     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.  Note that the	max()
     columns must be recreated in this case.

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

     +o	 sysctl(3), sysctlnametomib(3),	sysctlbyname(3)

     +o	 daemon(3)

     +o	 geteuid(2)

     +o	 pidfile_open(3), pidfile_write, pidfile_close(3), pidfile_remove(3),
	 pidfile_fileno(3)

   INITIALISATION
     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 hijacked 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.

   SIMULATION
     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 hijacked process happens solely through the sysctl
     table. The	simulation reads the recorded loads and	the current core fre-
     quencies to update	kern.cp_times.	The hijacked process reads this	data
     and adjusts the clock frequencies,	which in turn affects the next frame.

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

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

SEE ALSO
     loadrec(1), powerd(8), powerd++(8), rtld(1), signal(3)

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

FreeBSD	Ports 11.2	       19 October, 2016		    FreeBSD Ports 11.2

NAME | SYNOPSIS | DESCRIPTION | USAGE NOTES | IMPLEMENTATION | FILES | SEE ALSO | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=loadplay&sektion=1&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help