]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-01-16 05:04:53 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 16 Jan 2004 05:04:53 +0000 (05:04 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 16 Jan 2004 05:04:53 +0000 (05:04 +0000)
started plugin proc_stat which should parse /proc/stat
which again is a paint in the a**
thinking over implementation methods of delta functions
(CPU load, ...)

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@314 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

Makefile.am
Makefile.in
cfg.c
filter.c
hash.c
hash.h
lcd4linux.conf.sample
plugin.c
plugin_proc_stat.c [new file with mode: 0644]
system.c

index da198e3c59aa8d2b11e87876adac92bf2d124009..44755d790c16ca8478a3bf076da2fc44431e401e 100644 (file)
@@ -32,6 +32,7 @@ plugin_string.c \
 plugin_cfg.c \
 plugin_uname.c \
 plugin_loadavg.c \
+plugin_proc_stat.c \
 plugin_cpuinfo.c \
 plugin_meminfo.c \
 plugin_i2c_sensors.c \
index 4389cfcc9fe89070433e1c87a71917f31b8f774d..40bda22c7c4cb06221e1b6a28078057cfcb14b49 100644 (file)
@@ -106,7 +106,7 @@ lcd4linux_LDADD = @DRIVERS@ @DRVLIBS@
 #remove next line for liblcd4linux
 lcd4linux_DEPENDENCIES = @DRIVERS@
 
-lcd4linux_SOURCES =  lcd4linux.c pid.c pid.h hash.c hash.h parser.c parser.h processor.c processor.h layout.c layout.h timer.c timer.h evaluator.c evaluator.h widget.c widget.h widget_text.c plugin.c plugin.h plugin_math.c plugin_string.c plugin_cfg.c plugin_uname.c plugin_loadavg.c plugin_cpuinfo.c plugin_meminfo.c plugin_i2c_sensors.c plugin_xmms.c system.c system.h isdn.c isdn.h wifi.c wifi.h mail.c mail.h seti.c seti.h battery.c battery.h dvb.c dvb.h filter.c filter.h exec.c exec.h expr.c expr.h mail2.c socket.c socket.h imon.c imon.h display.c display.h drv.c drv.h debug.c debug.h cfg.c cfg.h lock.c lock.h pixmap.c pixmap.h bar.c bar.h icon.c icon.h fontmap.c fontmap.h udelay.c udelay.h
+lcd4linux_SOURCES =  lcd4linux.c pid.c pid.h hash.c hash.h parser.c parser.h processor.c processor.h layout.c layout.h timer.c timer.h evaluator.c evaluator.h widget.c widget.h widget_text.c plugin.c plugin.h plugin_math.c plugin_string.c plugin_cfg.c plugin_uname.c plugin_loadavg.c plugin_proc_stat.c plugin_cpuinfo.c plugin_meminfo.c plugin_i2c_sensors.c plugin_xmms.c system.c system.h isdn.c isdn.h wifi.c wifi.h mail.c mail.h seti.c seti.h battery.c battery.h dvb.c dvb.h filter.c filter.h exec.c exec.h expr.c expr.h mail2.c socket.c socket.h imon.c imon.h display.c display.h drv.c drv.h debug.c debug.h cfg.c cfg.h lock.c lock.h pixmap.c pixmap.h bar.c bar.h icon.c icon.h fontmap.c fontmap.h udelay.c udelay.h
 
 
 #liblcd4linux_la_DEPENDENCIES = @DRIVERS@
@@ -151,14 +151,14 @@ parser.$(OBJEXT) processor.$(OBJEXT) layout.$(OBJEXT) timer.$(OBJEXT) \
 evaluator.$(OBJEXT) widget.$(OBJEXT) widget_text.$(OBJEXT) \
 plugin.$(OBJEXT) plugin_math.$(OBJEXT) plugin_string.$(OBJEXT) \
 plugin_cfg.$(OBJEXT) plugin_uname.$(OBJEXT) plugin_loadavg.$(OBJEXT) \
-plugin_cpuinfo.$(OBJEXT) plugin_meminfo.$(OBJEXT) \
-plugin_i2c_sensors.$(OBJEXT) plugin_xmms.$(OBJEXT) system.$(OBJEXT) \
-isdn.$(OBJEXT) wifi.$(OBJEXT) mail.$(OBJEXT) seti.$(OBJEXT) \
-battery.$(OBJEXT) dvb.$(OBJEXT) filter.$(OBJEXT) exec.$(OBJEXT) \
-expr.$(OBJEXT) mail2.$(OBJEXT) socket.$(OBJEXT) imon.$(OBJEXT) \
-display.$(OBJEXT) drv.$(OBJEXT) debug.$(OBJEXT) cfg.$(OBJEXT) \
-lock.$(OBJEXT) pixmap.$(OBJEXT) bar.$(OBJEXT) icon.$(OBJEXT) \
-fontmap.$(OBJEXT) udelay.$(OBJEXT)
+plugin_proc_stat.$(OBJEXT) plugin_cpuinfo.$(OBJEXT) \
+plugin_meminfo.$(OBJEXT) plugin_i2c_sensors.$(OBJEXT) \
+plugin_xmms.$(OBJEXT) system.$(OBJEXT) isdn.$(OBJEXT) wifi.$(OBJEXT) \
+mail.$(OBJEXT) seti.$(OBJEXT) battery.$(OBJEXT) dvb.$(OBJEXT) \
+filter.$(OBJEXT) exec.$(OBJEXT) expr.$(OBJEXT) mail2.$(OBJEXT) \
+socket.$(OBJEXT) imon.$(OBJEXT) display.$(OBJEXT) drv.$(OBJEXT) \
+debug.$(OBJEXT) cfg.$(OBJEXT) lock.$(OBJEXT) pixmap.$(OBJEXT) \
+bar.$(OBJEXT) icon.$(OBJEXT) fontmap.$(OBJEXT) udelay.$(OBJEXT)
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -185,10 +185,10 @@ DEP_FILES =  .deps/BeckmannEgle.P .deps/Crystalfontz.P .deps/Cwlinux.P \
 .deps/mail.P .deps/mail2.P .deps/parport.P .deps/parser.P .deps/pid.P \
 .deps/pixmap.P .deps/plugin.P .deps/plugin_cfg.P .deps/plugin_cpuinfo.P \
 .deps/plugin_i2c_sensors.P .deps/plugin_loadavg.P .deps/plugin_math.P \
-.deps/plugin_meminfo.P .deps/plugin_string.P .deps/plugin_uname.P \
-.deps/plugin_xmms.P .deps/processor.P .deps/seti.P .deps/socket.P \
-.deps/system.P .deps/timer.P .deps/udelay.P .deps/widget.P \
-.deps/widget_text.P .deps/wifi.P
+.deps/plugin_meminfo.P .deps/plugin_proc_stat.P .deps/plugin_string.P \
+.deps/plugin_uname.P .deps/plugin_xmms.P .deps/processor.P .deps/seti.P \
+.deps/socket.P .deps/system.P .deps/timer.P .deps/udelay.P \
+.deps/widget.P .deps/widget_text.P .deps/wifi.P
 SOURCES = $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES)
 OBJECTS = $(lcd4linux_OBJECTS)
 
diff --git a/cfg.c b/cfg.c
index df7fa7906aeafabd419277f081a5ba3c7d8280fe..e604d0fe5aafd9acc8aabff9ec5504cf2d79bc92 100644 (file)
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.27 2004/01/14 11:33:00 reinelt Exp $^
+/* $Id: cfg.c,v 1.28 2004/01/16 05:04:53 reinelt Exp $^
  *
  * config file stuff
  *
  *
  *
  * $Log: cfg.c,v $
+ * Revision 1.28  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.27  2004/01/14 11:33:00  reinelt
  * new plugin 'uname' which does what it's called
  * text widget nearly finished
@@ -306,9 +312,9 @@ static void cfg_add (char *section, char *key, char *val, int lock)
   entry=bsearch(buffer, Config, nConfig, sizeof(ENTRY), c_lookup);
   
   if (entry!=NULL) {
-    free (buffer);
     if (entry->lock>lock) return;
-    debug ("Warning: key '%s': value '%s' overwritten with '%s'", buffer, entry->val, val);
+    debug ("Warning: key <%s>: value <%s> overwritten with <%s>", buffer, entry->val, val);
+    free (buffer);
     if (entry->val) free (entry->val);
     entry->val=dequote(strdup(val));
     return;
index 53d04720bd9603aecfc5bf8c9f6100e635fd20ea..df5dcf67f070ee4d027cf60682644a4de220dd82 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -1,4 +1,4 @@
-/* $Id: filter.c,v 1.9 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: filter.c,v 1.10 2004/01/16 05:04:53 reinelt Exp $
  *
  *  smooth and damp functions
  *
  *
  *
  * $Log: filter.c,v $
+ * Revision 1.10  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.9  2004/01/09 04:16:06  reinelt
  * added 'section' argument to cfg_get(), but NULLed it on all calls by now.
  *
@@ -110,7 +116,7 @@ double smooth(char *name, int period, double value)
       slots=2;
     else if (slots>SLOTS)
       slots=SLOTS;
-
+    
     nFilter++;
     Filter=realloc(Filter, nFilter*sizeof(FILTER));
     Filter[i].name=strdup(name);
@@ -132,7 +138,7 @@ double smooth(char *name, int period, double value)
   
   t = SECONDS(Filter[i].time[0]) - SECONDS(Filter[i].time[Filter[i].slots-1]);
   v = Filter[i].value[0]-Filter[i].value[Filter[i].slots-1];
-
+  
   if (t==0.0 || v<0.0)
     return 0;
   else
diff --git a/hash.c b/hash.c
index 02f0f65ccd708be0097ac980d99ee5e66d588d50..fb9e8c1b57d23ae690c840ced1e8e78b89c878c9 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -1,4 +1,4 @@
-/* $Id: hash.c,v 1.1 2004/01/13 10:03:01 reinelt Exp $
+/* $Id: hash.c,v 1.2 2004/01/16 05:04:53 reinelt Exp $
  *
  * hashes (associative arrays)
  *
  *
  *
  * $Log: hash.c,v $
+ * Revision 1.2  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.1  2004/01/13 10:03:01  reinelt
  * new util 'hash' for associative arrays
  * new plugin 'cpuinfo'
@@ -56,6 +62,16 @@ static int hash_lookup_f (const void *a, const void *b)
 }
 
 
+// bsearch compare function for filter entries
+static int filter_lookup_f (const void *a, const void *b)
+{
+  char *key=(char*)a;
+  FILTER_ITEM *item=(FILTER_ITEM*)b;
+
+  return strcmp(key, item->key);
+}
+
+
 // qsort compare function for hash tables
 static int hash_sort_f (const void *a, const void *b)
 {
@@ -66,6 +82,17 @@ static int hash_sort_f (const void *a, const void *b)
 }
 
 
+// qsort compare function for filter tables
+static int filter_sort_f (const void *a, const void *b)
+{
+  FILTER_ITEM *ha=(FILTER_ITEM*)a;
+  FILTER_ITEM *hb=(FILTER_ITEM*)b;
+
+  return strcasecmp(ha->key, hb->key);
+}
+
+
+
 // insert a key/val pair into the hash table
 // the tbale will be searched linearly if the entry 
 // does already exist, for the table may not be sorted.
@@ -92,7 +119,7 @@ void hash_set (HASH *Hash, char *key, char *val)
 }
 
 
-void *hash_get (HASH *Hash, char *key)
+char *hash_get (HASH *Hash, char *key)
 {
   HASH_ITEM *Item;
   
@@ -122,8 +149,75 @@ void hash_destroy (HASH *Hash)
     // free hash table
     free (Hash->Items);
   }
-
+  
   Hash->nItems=0;
   Hash->sorted=0;
   Hash->Items=NULL;
 }
+
+
+// insert a key/val pair into the filter table
+// the tbale will be searched linearly if the entry 
+// does already exist, for the table may not be sorted.
+// the table will be flagged 'unsorted' afterwards
+void filter_set (FILTER *Filter, char *key, char *val)
+{
+  int i;
+
+  // entry already exists?
+  for (i=0;i<Filter->nItems; i++) {
+    if (strcmp(key, Filter->Items[i].key)==0) {
+      // if (Filter->Items[i].val) free (Filter->Items[i].val);
+      // Filter->Items[i].val=strdup(val);
+      return;
+    }
+  }
+  
+  // add entry
+  Filter->sorted=0;
+  Filter->nItems++;
+  Filter->Items=realloc(Filter->Items,Filter->nItems*sizeof(FILTER_ITEM));
+  Filter->Items[i].key=strdup(key);
+
+  
+  Filter->Items[i].Slots=strdup(val);
+}
+
+
+double filter_get (FILTER *Filter, char *key)
+{
+  FILTER_ITEM *Item;
+  
+  if (!Filter->sorted) {
+    qsort(Filter->Items, Filter->nItems, sizeof(FILTER_ITEM), filter_sort_f);
+    Filter->sorted=1;
+  }
+  
+  Item=bsearch(key, Filter->Items, Filter->nItems, sizeof(FILTER_ITEM), filter_lookup_f);
+  if (Item==NULL) return 0.0;
+  if (Item->Slots==NULL) return 0.0;
+  return Item->Slots[0].val;
+  
+}
+
+
+void filter_destroy (FILTER *Filter)
+{
+  int i;
+
+  if (Filter->Items) {
+    
+    // free all entries
+    for (i=0;i<Filter->nItems; i++) {
+      if (Filter->Items[i].key)   free (Filter->Items[i].key);
+      if (Filter->Items[i].Slots) free (Filter->Items[i].Slots);
+    }
+    
+    // free filter table
+    free (Filter->Items);
+  }
+  
+  Filter->nItems=0;
+  Filter->sorted=0;
+  Filter->Items=NULL;
+}
diff --git a/hash.h b/hash.h
index ff857191e88b8928bad6475c5a18110b8766324c..90cf7606e2d79895c53b4f637441087bc8b19329 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -1,4 +1,4 @@
-/* $Id: hash.h,v 1.1 2004/01/13 10:03:01 reinelt Exp $
+/* $Id: hash.h,v 1.2 2004/01/16 05:04:53 reinelt Exp $
  *
  * hashes (associative arrays)
  *
  *
  *
  * $Log: hash.h,v $
+ * Revision 1.2  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.1  2004/01/13 10:03:01  reinelt
  * new util 'hash' for associative arrays
  * new plugin 'cpuinfo'
 #ifndef _HASH_H_
 #define _HASH_H_
 
-
-typedef struct HASH_ITEM {
+typedef struct {
   char *key;
   char *val;
 } HASH_ITEM;
 
-typedef struct HASH {
-  int       nItems;
+
+typedef struct {
   int       sorted;
+  int       nItems;
   HASH_ITEM *Items;
 } HASH;
 
 
+typedef struct {
+  struct timeval time;
+  double val;
+} FILTER_SLOT;
+
+typedef struct {
+  char        *key;
+  int         nSlots;
+  FILTER_SLOT *Slots;
+} FILTER_ITEM;
+
+typedef struct {
+  int         sorted;
+  int         nItems;
+  FILTER_ITEM *Items;
+} FILTER;
+
 void  hash_set     (HASH *Hash, char *key, char *val);
-void *hash_get     (HASH *Hash, char *key);
+char *hash_get     (HASH *Hash, char *key);
 void  hash_destroy (HASH *Hash);
 
+void   filter_set     (FILTER *Filter, char *key, double val);
+double filter_get     (FILTER *Filter, char *key);
+void   filter_destroy (FILTER *Filter);
+
 #endif
index fdd34d3ae084ca9b29f93fd8db5460675d9feefe..7d48af38783918f150c10bd17e497428819f38ca 100644 (file)
@@ -2,7 +2,7 @@ Display LK204 {
     Driver 'MatrixOrbital'
     Model 'LK204-24-USB'
     Port '/dev/usb/tts/0'
-#    Port '/dev/tts/0'
+    Port '/dev/tts/0'
     Speed 19200
     Contrast 256/2
 }
index 4fc6de332b840219ed7a6aa5c67bfb93eb0e977a..2d381ba855ea37aec566140c181e8384a500fa30 100644 (file)
--- a/plugin.c
+++ b/plugin.c
@@ -1,4 +1,4 @@
-/* $Id: plugin.c,v 1.12 2004/01/15 04:29:45 reinelt Exp $
+/* $Id: plugin.c,v 1.13 2004/01/16 05:04:53 reinelt Exp $
  *
  * plugin handler for the Evaluator
  *
  *
  *
  * $Log: plugin.c,v $
+ * Revision 1.13  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.12  2004/01/15 04:29:45  reinelt
  * moved lcd4linux.conf.sample to *.old
  * lcd4linux.conf.sample with new layout
@@ -114,6 +120,7 @@ int plugin_init_string (void);
 int plugin_init_cfg (void);
 int plugin_init_uname (void);
 int plugin_init_loadavg (void);
+int plugin_init_proc_stat (void);
 int plugin_init_cpuinfo (void);
 int plugin_init_meminfo (void);
 int plugin_init_i2c_sensors (void);
@@ -127,6 +134,7 @@ int plugin_init (void)
   plugin_init_cfg();
   plugin_init_uname();
   plugin_init_loadavg();
+  plugin_init_proc_stat();
   plugin_init_cpuinfo();
   plugin_init_meminfo();
   // MR: segfaults here
diff --git a/plugin_proc_stat.c b/plugin_proc_stat.c
new file mode 100644 (file)
index 0000000..1e7ec0b
--- /dev/null
@@ -0,0 +1,146 @@
+/* $Id: plugin_proc_stat.c,v 1.1 2004/01/16 05:04:53 reinelt Exp $
+ *
+ * plugin for /proc/stat parsing
+ *
+ * Copyright 2003 Michael Reinelt <reinelt@eunet.at>
+ * Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
+ *
+ * This file is part of LCD4Linux.
+ *
+ * LCD4Linux is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * LCD4Linux is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * $Log: plugin_proc_stat.c,v $
+ * Revision 1.1  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
+ */
+
+/* 
+ * exported functions:
+ *
+ * int plugin_init_proc_stat (void)
+ *  adds functions to access /proc/stat
+ *
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/time.h>
+
+#include "debug.h"
+#include "plugin.h"
+#include "hash.h"
+
+
+static HASH Stat = { 0, 0, NULL };
+
+static int renew(int msec)
+{
+  static struct timeval end = {0, 0};
+  struct timeval now;
+
+  // update every 10 msec
+  gettimeofday(&now, NULL);
+  if (now.tv_sec==end.tv_sec?now.tv_usec<end.tv_usec:now.tv_sec<end.tv_sec) {
+    return 0;
+  }
+  end.tv_sec  = now.tv_sec;
+  end.tv_usec = now.tv_usec + 1000*msec;
+  while (end.tv_usec > 1000000) {
+    end.tv_usec -= 1000000;
+    end.tv_sec++;
+  }
+  return 1;
+}
+
+
+static int parse_proc_stat (void)
+{
+  FILE *stream;
+  
+  // update every 10 msec
+  if (!renew(10)) return 0;
+  
+  // destroy previous hash table
+  hash_destroy (&Stat);
+
+  stream=fopen("/proc/stat", "r");
+  if (stream==NULL) {
+    error ("fopen(/proc/stat) failed: %s", strerror(errno));
+    return -1;
+  }
+  
+  while (!feof(stream)) {
+    char buffer[256];
+    fgets (buffer, sizeof(buffer), stream);
+
+    if (strncmp(buffer, "cpu", 3)==0) {
+      unsigned long v1, v2, v3, v4;
+      debug ("Michi: buffer=<%s>", buffer);
+      if (sscanf(buffer+4, " %lu %lu %lu %lu", &v1, &v2, &v3, &v4)==4) {
+       debug ("Michi: v1=<%ld> v2=<%ld> v3=<%ld> v4=<%ld>", v1, v2, v3, v4);
+      }
+    } 
+    else if (strncmp(buffer, "page ", 5)==0) {
+      
+    } 
+    else if (strncmp(buffer, "swap ", 5)==0) {
+    } 
+    else if (strncmp(buffer, "intr ", 5)==0) {
+    } 
+    else if (strncmp(buffer, "disk_io:", 8)==0) {
+    } 
+    else if (strncmp(buffer, "ctxt ", 5)==0) {
+    } 
+    else if (strncmp(buffer, "btime ", 5)==0) {
+    } 
+    else if (strncmp(buffer, "processes ", 5)==0) {
+    } 
+    else {
+      error ("unknown line <%s> from /proc/stat");
+    }
+  }
+  fclose (stream);
+  return 0;
+}
+
+static void my_proc_stat (RESULT *result, RESULT *arg1)
+{
+  char *key, *val;
+  
+  parse_proc_stat();
+
+  key=R2S(arg1);
+  val="";
+  
+  SetResult(&result, R_STRING, ""); 
+}
+
+
+int plugin_init_proc_stat (void)
+{
+  AddFunction ("stat", 1, my_proc_stat);
+  return 0;
+}
+
index 7fc0919e71c833e5cd9260cf0857eb23aa3df797..fe49ca7eeef7aea4fd65a7585503384775cdd7aa 100644 (file)
--- a/system.c
+++ b/system.c
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.32 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: system.c,v 1.33 2004/01/16 05:04:53 reinelt Exp $
  *
  * system status retreivement
  *
  *
  *
  * $Log: system.c,v $
+ * Revision 1.33  2004/01/16 05:04:53  reinelt
+ * started plugin proc_stat which should parse /proc/stat
+ * which again is a paint in the a**
+ * thinking over implementation methods of delta functions
+ * (CPU load, ...)
+ *
  * Revision 1.32  2004/01/09 04:16:06  reinelt
  * added 'section' argument to cfg_get(), but NULLed it on all calls by now.
  *
@@ -556,7 +562,7 @@ int Busy (double *user, double *nice, double *system, double *idle)
   d3=smooth("cpu_sys",  500, v3);
   d4=smooth("cpu_idle", 500, v4);
   d5=d1+d2+d3+d4;
+  
   if (d5!=0.0) {
     *user=(d1+d2)/d5;
     *nice=d2/d5;