From 77b663b4f3217746ec5eeaca21d0096a1285a014 Mon Sep 17 00:00:00 2001 From: Vicente Date: Mon, 17 Jun 2013 16:21:20 +0200 Subject: [PATCH] CPU: Wrong CPU Load %. --- release/src/router/httpd/cpuinfo.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/release/src/router/httpd/cpuinfo.c b/release/src/router/httpd/cpuinfo.c index 6acc91b74b..5ceafb79c2 100644 --- a/release/src/router/httpd/cpuinfo.c +++ b/release/src/router/httpd/cpuinfo.c @@ -11,6 +11,9 @@ struct occupy unsigned int nice; unsigned int system; unsigned int idle; + unsigned int io; + unsigned int irq; + unsigned int sirq; }; void trim( char *str) @@ -143,8 +146,8 @@ static void cal_occupy (struct occupy *o, struct occupy *n) double id, sd; double scale; - od = (double) (o->user + o->nice + o->system + o->idle); - nd = (double) (n->user + n->nice + n->system + n->idle); + od = (double) (o->user + o->nice + o->system + o->idle + o->io + o->irq + o->sirq); + nd = (double) (n->user + n->nice + n->system + n->idle + n->io + n->irq + n->sirq); scale = 100.0 / (float)(nd-od); id = (double) (n->user - o->user); sd = (double) (n->system - o->system); @@ -162,8 +165,8 @@ static void get_occupy (struct occupy *o) for(n=0;n