statclock: Fix intr% counting on heavily interrupted systems
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 2 Aug 2012 09:26:30 +0000 (17:26 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 2 Aug 2012 09:26:30 +0000 (17:26 +0800)
commit6026c54d859820652639d22385e89f06d26a3437
treed9f6640205f24a5f761e947378e15a5f3219596e
parent3245f71ee9cdb70ffa433534cfd9d0d404bf8794
statclock: Fix intr% counting on heavily interrupted systems

statclock() has high probability to run from crit_exit() on heavily
interrupted systems and 'frame' is NULL in this case, so intr% is
mis-counted as sys%.

To fix this, TDF_INTTHREAD is used to determine whether intr% should
be counted or not, in addition to testing gd_intr_nest_level and
'frame'
sys/cpu/i386/include/cpu.h
sys/cpu/x86_64/include/cpu.h
sys/kern/kern_clock.c