make test mini script

Link to this paste: http://bugs.dragonflybsd.org/pastes/450

Added by tuxillo 4 months ago.
Syntax: Plain Text

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
antonioh@andromeda:~$ cat /tmp/check_build.sh
#! /bin/sh
makejobs=0
ccjobs=0
logfile=/tmp/makebug_$(date +'%H%M')
ncpu=$(sysctl hw.ncpu | cut -w -f 2)
maxccjobs=$(expr ${ncpu} + 1)

while true
do
        makejobs=$(ps -o comm | grep -c ^make)
        ccjobs=$(ps -o comm | grep -c -e ^cc1 -e ^cc1plus)
        echo "makejobs=${makejobs} ccjobs=${ccjobs}"
        if [ ${ccjobs} -gt ${maxccjobs} ]; then
                echo "Warning: maxccjobs (${maxccjobs}) exceeded!"
        fi
        echo "makejobs=${makejobs} ccjobs=${ccjobs}" >> ${logfile}
        sleep 2
done

Download