"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/linux/cpumeter.h" (11 Jul 2020, 822 Bytes) of package /linux/misc/xosview-1.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cpumeter.h" see the Fossies "Dox" file reference documentation.

    1 //
    2 //  Copyright (c) 1994, 1995, 2004, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
    3 //
    4 //  This file may be distributed under terms of the GPL
    5 //
    6 
    7 #ifndef _CPUMETER_H_
    8 #define _CPUMETER_H_
    9 
   10 #include "fieldmetergraph.h"
   11 #include "xosview.h"
   12 
   13 
   14 class CPUMeter : public FieldMeterGraph {
   15 public:
   16   CPUMeter(XOSView *parent, const char *cpuID = "cpu");
   17   ~CPUMeter(void);
   18 
   19   const char *name(void) const { return "CPUMeter"; }
   20   void checkevent(void);
   21 
   22   void checkResources(void);
   23 
   24   static int countCPUs(void);
   25   static const char *cpuStr(int num);
   26   static int getkernelversion(void);
   27 protected:
   28   int _lineNum;
   29   unsigned long long cputime_[2][10];
   30   int cpuindex_;
   31   int kernel_;
   32   int statfields_;
   33 
   34   void getcputime(void);
   35   int findLine(const char *cpuID);
   36   const char *toUpper(const char *str);
   37 private:
   38 };
   39 
   40 #endif