Hello,
New to Shell scripting here.
I am trying to do the following:
- Run a long benchmark program (Don't need to see the outputs to stdout)
- As long as the benchmark is running, run the "cpustat" command with one particular Performance Counter.
- When the (Multi-thread) benchmark is done running, the cpustat command should also stop.
So far I have been trying different things like:
cpustat -c pic0=SB_full,pic1=Instr_cnt 1
./long_multithread_benchmark &
kill -9 `pgrep cpustat`
Also, tried using the "while" loop by checking for the $? of the last command:
./long_benchmark
while [[ $? -neq 0] ]
do
cpustat -c pic0=SB_full,pic1=Instr_cnt 1
done
None of them are working.
Thanks is advance for any suggestions/advice.