Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e257ae3 in mainline for kernel/generic/src/time/clock.c


Ignore:
Timestamp:
2010-03-31T13:42:17Z (12 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master
Children:
0655d64
Parents:
944f2cab
Message:

Counting CPU busy and idle clock ticks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/time/clock.c

    r944f2cab re257ae3  
    137137        size_t missed_clock_ticks = CPU->missed_clock_ticks;
    138138        unsigned int i;
     139
     140        /* Account lost ticks to CPU usage */
     141        if (CPU->idle) {
     142                ASSERT(missed_clock_ticks == 0);
     143                CPU->idle_ticks++;
     144        } else {
     145                CPU->busy_ticks += missed_clock_ticks + 1;
     146        }
     147        CPU->idle = false;
    139148
    140149        /*
Note: See TracChangeset for help on using the changeset viewer.