python - monitor Core utilization in Solaris Sparc -


i trying read sparc hw counter using following command:

cpustat -c instr_cnt .1 

this command running forever (for time until interrupted user). sample output is:

   time cpu event      pic1      1.011   0  tick      6450    1.011   1  tick      9681    1.011   2  tick      2015    1.012   3  tick       535    1.012   4  tick       615    1.012   5  tick      7513    1.012   6  tick       615    1.013   7  tick      5187    1.013   8  tick       615    1.013   9  tick       615    1.013  10  tick       615    1.014  11  tick     60077    1.014  12  tick       438    1.014  13  tick       615    1.014  14  tick       615    1.015  15  tick       615    1.015  16  tick       615    1.015  17  tick       438    1.016  18  tick       615    1.016  19  tick       615  ^c 

now trying every 4 cpu's in core (each core has 4 cpus), add number in pic1 , average them. once average reaches threshold number, want load balancing.

i think logic is: put elements line 2 in array, , add every 4 of them. looking output like:

**core#      average# of inst   utilization (#ofinst/cpu_cycle_persec)**    core_0         xxxxxxxx            10%    core_1         xxxxxxxx            20%     , on.... 

i novice in coding , if me simple direction this, great. can done in shell/python.

thanks in advance.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -