wlauto.instrumentation.coreutil package

Module contents

class wlauto.instrumentation.coreutil.Calculator(cores, threshold, context)[source]

Bases: object

Read /proc/stat and dump data into proc.txt which is parsed to generate coreutil.csv Sample output from ‘proc.txt’

----------------------------------------------------------------------
cpu  9853753 51448 3248855 12403398 4241 111 14996 0 0 0
cpu0 1585220 7756 1103883 4977224 552 97 10505 0 0 0
cpu1 2141168 7243 564347 972273 504 4 1442 0 0 0
cpu2 1940681 7994 651946 1005534 657 3 1424 0 0 0
cpu3 1918013 8833 667782 1012249 643 3 1326 0 0 0
cpu4 165429 5363 50289 1118910 474 0 148 0 0 0
cpu5 1661299 4910 126654 1104018 480 0 53 0 0 0
cpu6 333642 4657 48296 1102531 482 2 55 0 0 0
cpu7 108299 4691 35656 1110658 448 0 41 0 0 0
----------------------------------------------------------------------
Description:

1st column  : cpu_id( cpu0, cpu1, cpu2,......)
Next all column represents the amount of time, measured in units of USER_HZ
2nd column  : Time spent in user mode
3rd column  : Time spent in user mode with low priority
4th column  : Time spent in system mode
5th column  : Time spent in idle task
6th column  : Time waiting for i/o to compelete
7th column  : Time servicing interrupts
8th column  : Time servicing softirqs
9th column  : Stolen time is the time spent in other operating systems
10th column : Time spent running a virtual CPU
11th column : Time spent running a niced guest

----------------------------------------------------------------------------

Procedure to calculate instantaneous CPU utilization:

  1. Subtract two consecutive samples for every column( except 1st )
  2. Sum all the values except “Time spent in idle task”
  3. CPU utilization(%) = ( value obtained in 2 )/sum of all the values)*100
calculate()[source]
calculate_core_utilization()[source]

Calculates CPU utilization

calculate_total_active()[source]

Read proc.txt file and calculate ‘self.active’ and ‘self.total’

generate_csv(context)[source]

generates coreutil.csv

idle_time_index = 3
class wlauto.instrumentation.coreutil.CoreUtilization(device, **kwargs)[source]

Bases: wlauto.core.instrumentation.Instrument

aliases = AC([])
artifacts = AC([])
core_modules = []
description = "\n Measures CPU core activity during workload execution in terms of the percentage of time a number\n of cores were utilized above the specfied threshold.\n\n This workload generates ``coreutil.csv`` report in the workload's output directory. The report is\n formatted as follows::\n\n <threshold,1core,2core,3core,4core\n 18.098132,38.650248000000005,10.736180000000001,3.6809760000000002,28.834312000000001\n\n Interpretation of the result:\n\n - 38.65% of total time only single core is running above or equal to threshold value\n - 10.736% of total time two cores are running simultaneously above or equal to threshold value\n - 3.6809% of total time three cores are running simultaneously above or equal to threshold value\n - 28.8314% of total time four cores are running simultaneously above or equal to threshold value\n - 18.098% of time all core are running below threshold value.\n\n ..note : This instrument doesn't work on ARM big.LITTLE IKS implementation\n\n "
finalize(*args, **kwargs)
initialize(*args, **kwargs)
kind = 'instrument'
name = 'coreutil'
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'threshold', 'constraint': <function <lambda>>, 'default': 50, 'allowed_values': None, 'global_alias': None, 'override': False})"])
setup(context)[source]

Calls ProcCollect class

start(context)[source]

Starts collecting data once the workload starts

stop(context)[source]

Stops collecting data once the workload stops

update_result(context)[source]

updates result into coreutil.csv

validate(*args, **kwargs)
class wlauto.instrumentation.coreutil.ProcCollect(device, logger, out_dir)[source]

Bases: threading.Thread

Dumps data into proc.txt

run()[source]
stop()[source]

Executed once the workload stops