diff options
28 files changed, 5 insertions, 2711 deletions
diff --git a/kcontrol/info/info.cpp b/kcontrol/info/info.cpp index 4539e6dd1..2ca117920 100644 --- a/kcontrol/info/info.cpp +++ b/kcontrol/info/info.cpp @@ -464,8 +464,6 @@ static int GetInfo_ReadfromPipe( TQListView *lBox, const char *FileName, bool Wi #ifdef __linux__ #include "info_linux.cpp" -#elif defined(sgi) && sgi -#include "info_sgi.cpp" #elif defined(__FreeBSD__) || defined (__DragonFly__) #include "info_fbsd.cpp" #elif __NetBSD__ diff --git a/kcontrol/info/memory.cpp b/kcontrol/info/memory.cpp index 950062b2a..593e332a8 100644 --- a/kcontrol/info/memory.cpp +++ b/kcontrol/info/memory.cpp @@ -449,8 +449,6 @@ void KMemoryWidget::update_Values() #include "memory_linux.cpp" #elif defined(__APPLE__) #include "memory_osx.cpp" -#elif defined(sgi) && sgi -#include "memory_sgi.cpp" #elif defined(__svr4__) && defined(sun) #include "memory_solaris.cpp" #elif defined(__FreeBSD__) || defined(__DragonFly__) diff --git a/kcontrol/tdefontinst/configure.in.in b/kcontrol/tdefontinst/configure.in.in index c0e617fe3..d11ab77df 100644 --- a/kcontrol/tdefontinst/configure.in.in +++ b/kcontrol/tdefontinst/configure.in.in @@ -91,7 +91,6 @@ if test "$KFI_FOUND_FREETYPE" -eq 1; then *-*-kfreebsd-gnu*) UNAME='GNU/kFreeBSD' ;; *-*-netbsd*) UNAME='NetBSD' ;; *-*-solaris*) UNAME='Solaris' ;; - *-*-irix*) UNAME='Irix' ;; *-*-aix*) UNAME='AIX' ;; *-*-darwin*) UNAME='Darwin' ;; *) UNAME='Unknown' ;; diff --git a/kcontrol/tdefontinst/tdefontinst/GetPid.c b/kcontrol/tdefontinst/tdefontinst/GetPid.c index 11e2cf048..a73532d26 100644 --- a/kcontrol/tdefontinst/tdefontinst/GetPid.c +++ b/kcontrol/tdefontinst/tdefontinst/GetPid.c @@ -60,7 +60,6 @@ FreeBSD Tested on FreeBSD 5.1 by Brian Ledbetter <brian@shadowcom.net> NetBSD OpenBSD - Irix Solaris Tested on Solaris 8 x86 by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> AIX ...else parse output of "ps -eaf" @@ -75,7 +74,7 @@ gcc GetPid.c -DTEST_GETPID -DOS_Linux -o tst - ...replace OS_Linux with your particular OS type: OS_FreeBSD, OS_NetBSD, OS_Irix, OS_Solaris, + ...replace OS_Linux with your particular OS type: OS_FreeBSD, OS_NetBSD, OS_Solaris, or OS_AIX 2. Start a program - such as "vi" @@ -256,7 +255,7 @@ unsigned int kfi_getPid(const char *proc, unsigned int ppid) return error ? 0 : pid; } -#elif defined OS_Irix || defined OS_Solaris +#elif defined OS_Solaris #include <unistd.h> #include <errno.h> diff --git a/kcontrol/tdefontinst/tdefontinst/XConfig.cpp b/kcontrol/tdefontinst/tdefontinst/XConfig.cpp index bb6e49d5e..c373667bd 100644 --- a/kcontrol/tdefontinst/tdefontinst/XConfig.cpp +++ b/kcontrol/tdefontinst/tdefontinst/XConfig.cpp @@ -39,7 +39,7 @@ #include <sys/types.h> #include <signal.h> -#if defined OS_Irix || defined OS_Solaris +#if defined OS_Solaris extern "C" unsigned int kfi_getPid(const char *proc, pid_t ppid); #else extern "C" unsigned int kfi_getPid(const char *proc, unsigned int ppid); diff --git a/konsole/doc/More/vt100_colorized_termcap.txt b/konsole/doc/More/vt100_colorized_termcap.txt index 0a5470b45..adabdb33b 100644 --- a/konsole/doc/More/vt100_colorized_termcap.txt +++ b/konsole/doc/More/vt100_colorized_termcap.txt @@ -40,7 +40,7 @@ with my screen in 50 line mode (49 lines + one for my comms program's status line). The system here with my account is a Sparc running Solaris 2.3, -SunOS 5.3 - but this also works under SGI IRIX and SunOS 4.3.1 +SunOS 5.3 - but this also works under SunOS 4.3.1 (remote vt-term login). I use tcsh as my default login shell (I'll eventually try out ksh once I have some time :-) diff --git a/kpersonalizer/ksysinfo.cpp b/kpersonalizer/ksysinfo.cpp index ff942954c..4dacf13fe 100644 --- a/kpersonalizer/ksysinfo.cpp +++ b/kpersonalizer/ksysinfo.cpp @@ -215,10 +215,6 @@ TQFont KSysInfo::getFixedWidthFont(){ } /////////////////// -//#elif sgi -/////////////////// - -/////////////////// //#elif __FreeBSD__ /////////////////// diff --git a/ksysguard/configure.in.in b/ksysguard/configure.in.in index 005a10495..a81f500c5 100644 --- a/ksysguard/configure.in.in +++ b/ksysguard/configure.in.in @@ -7,7 +7,6 @@ case "$host" in *-*-dragonfly*) ksysguardd_compile=yes; UNAME='FreeBSD' ;; *-*-netbsd*) ksysguardd_compile=yes; UNAME='NetBSD' ;; *-*-solaris*) ksysguardd_compile=yes; UNAME='Solaris' ;; - *-*-irix*) ksysguardd_compile=yes; UNAME='Irix' ;; *-*-openbsd*) ksysguardd_compile=yes; UNAME='OpenBSD' ;; *) ksysguardd_compile=no; UNAME='' ;; esac @@ -19,7 +18,6 @@ AM_CONDITIONAL(include_ksysguardd_linux, test "$UNAME" = Linux) AM_CONDITIONAL(include_ksysguardd_freebsd, test "$UNAME" = FreeBSD) AM_CONDITIONAL(include_ksysguardd_netbsd, test "$UNAME" = NetBSD) AM_CONDITIONAL(include_ksysguardd_solaris, test "$UNAME" = Solaris) -AM_CONDITIONAL(include_ksysguardd_irix, test "$UNAME" = Irix) AM_CONDITIONAL(include_ksysguardd_openbsd, test "$UNAME" = OpenBSD) AC_SUBST(UNAME) diff --git a/ksysguard/ksysguardd/Irix/LoadAvg.c b/ksysguard/ksysguardd/Irix/LoadAvg.c deleted file mode 100644 index 92d284756..000000000 --- a/ksysguard/ksysguardd/Irix/LoadAvg.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <CKroll@pinnaclesys.com> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/swap.h> - -#include "config.h" - -#include "ksysguardd.h" -#include "Command.h" -#include "LoadAvg.h" - -double loadavg1 = 0.0; -double loadavg5 = 0.0; -double loadavg15 = 0.0; - -void initLoadAvg(struct SensorModul* sm ) { - registerMonitor( "cpu/loadavg1", "float", - printLoadAvg1, printLoadAvg1Info, sm ); - registerMonitor( "cpu/loadavg5", "float", - printLoadAvg5, printLoadAvg5Info, sm ); - registerMonitor( "cpu/loadavg15", "float", - printLoadAvg15, printLoadAvg15Info, sm ); -} - -void exitLoadAvg( void ) { -} - -int updateLoadAvg( void ) { - - return( 0 ); -} - -void printLoadAvg1Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 1min\t0\t0\n" ); -} - -void printLoadAvg1( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg1 ); -} - -void printLoadAvg5Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 5min\t0\t0\n" ); -} - -void printLoadAvg5( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg5 ); -} - -void printLoadAvg15Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 15min\t0\t0\n" ); -} - -void printLoadAvg15( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg15 ); -} diff --git a/ksysguard/ksysguardd/Irix/LoadAvg.h b/ksysguard/ksysguardd/Irix/LoadAvg.h deleted file mode 100644 index eea8ad82e..000000000 --- a/ksysguard/ksysguardd/Irix/LoadAvg.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _LoadAvg_h_ -#define _LoadAvg_h_ - -#define LOAD(a) ((double)(a) / (1 << 8 )) - -void initLoadAvg(struct SensorModul* sm); -void exitLoadAvg(void); - -int updateLoadAvg(void); - -void printLoadAvg1( const char *cmd ); -void printLoadAvg1Info( const char *cmd ); -void printLoadAvg5( const char *cmd ); -void printLoadAvg5Info( const char *cmd ); -void printLoadAvg15( const char *cmd ); -void printLoadAvg15Info( const char *cmd ); - -#endif /* _LoadAvg_h_ */ diff --git a/ksysguard/ksysguardd/Irix/Makefile.am b/ksysguard/ksysguardd/Irix/Makefile.am deleted file mode 100644 index 3c1997924..000000000 --- a/ksysguard/ksysguardd/Irix/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -INCLUDES = -I$(srcdir)/../../CContLib -I.. - -noinst_LIBRARIES = libksysguardd.a -libksysguardd_a_SOURCES = Memory.c LoadAvg.c ProcessList.c NetDev.c cpu.c diff --git a/ksysguard/ksysguardd/Irix/Memory.c b/ksysguard/ksysguardd/Irix/Memory.c deleted file mode 100644 index e88123ddd..000000000 --- a/ksysguard/ksysguardd/Irix/Memory.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/statfs.h> -#include <sys/swap.h> -#include <sys/sysmp.h> - -#include "config.h" - -#include "ksysguardd.h" -#include "Command.h" -#include "Memory.h" - -static int Dirty = 1; -static t_memsize totalmem = (t_memsize) 0; -static t_memsize freemem = (t_memsize) 0; -static unsigned long totalswap = 0L,vswap = 0L; -static unsigned long freeswap = 0L,bufmem = 0L ; - -void initMemory( struct SensorModul* sm ) { - - registerMonitor( "mem/physical/free", "integer", - printMemFree, printMemFreeInfo, sm ); - registerMonitor( "mem/physical/used", "integer", - printMemUsed, printMemUsedInfo, sm ); - registerMonitor( "mem/swap/free", "integer", - printSwapFree, printSwapFreeInfo, sm ); - registerMonitor( "mem/swap/used", "integer", - printSwapUsed, printSwapUsedInfo, sm ); -} - -void exitMemory( void ) { -} - -int updateMemory( void ) { - struct statfs sf; - off_t val; - int pagesize = getpagesize(); - struct rminfo rmi; - if( sysmp(MP_SAGET, MPSA_RMINFO, &rmi, sizeof(rmi)) == -1 ) - return( -1 ); - totalmem = rmi.physmem*pagesize/1024; // total physical memory (without swaps) - freemem = rmi.freemem*pagesize/1024; // total free physical memory (without swaps) - bufmem = rmi.bufmem *pagesize/1024; - - statfs ("/proc", &sf,sizeof(sf),0); - - swapctl(SC_GETSWAPVIRT,&val); - vswap = val >> 1; - swapctl(SC_GETSWAPTOT,&val); - totalswap = val >> 1; - swapctl(SC_GETFREESWAP,&val); - freeswap = val >> 1; - - Dirty = 1; - - return( 0 ); -} - -void printMemFreeInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Free Memory\t0\t%ld\tKB\n", freemem ); -} - -void printMemFree( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", freemem ); -} - -void printMemUsedInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Used Memory\t0\t%ld\tKB\n", totalmem - freemem ); -} - -void printMemUsed( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", totalmem - freemem ); -} - -void printSwapFreeInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Free Swap\t0\t%ld\tKB\n", freeswap ); -} - -void printSwapFree( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", freeswap ); -} -void printSwapUsedInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Used Swap\t0\t%ld\tKB\n", totalswap - freeswap ); -} - -void printSwapUsed( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", totalswap - freeswap ); -} diff --git a/ksysguard/ksysguardd/Irix/Memory.h b/ksysguard/ksysguardd/Irix/Memory.h deleted file mode 100644 index ac3677b13..000000000 --- a/ksysguard/ksysguardd/Irix/Memory.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _Memory_h_ -#define _Memory_h_ - -typedef unsigned long t_memsize; - -void initMemory(struct SensorModul* sm); -void exitMemory(void); - -int updateMemory(void); - -void printMemFree( const char *cmd ); -void printMemFreeInfo( const char *cmd ); -void printMemUsed( const char *cmd ); -void printMemUsedInfo( const char *cmd ); -void printMemBuff( const char *cmd); -void printMemBuffInfo( const char *cmd); - -void printSwapFree( const char *cmd ); -void printSwapFreeInfo( const char *cmd ); -void printSwapUsed( const char *cmd ); -void printSwapUsedInfo( const char *cmd ); - -#endif /* _Memory_h */ diff --git a/ksysguard/ksysguardd/Irix/NetDev.c b/ksysguard/ksysguardd/Irix/NetDev.c deleted file mode 100644 index 403fea6cf..000000000 --- a/ksysguard/ksysguardd/Irix/NetDev.c +++ /dev/null @@ -1,343 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 2001 Tobias Koenig <tokoe@kde.org> - Irix Support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <fcntl.h> -#include <sys/socket.h> -#include <net/if.h> -#include <net/soioctl.h> -#include <stdio.h> -#include <string.h> -#include <sys/sysctl.h> -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> -#include <invent.h> -#include <strings.h> - - -#include "Command.h" -#include "ksysguardd.h" -#include "NetDev.h" - -#ifdef __GNUC__ -#define LONGLONG long long -#endif - -typedef struct { - char name[IFNAMSIZ]; - u_long recBytes; - u_long recPacks; - u_long recErrs; - u_long recDrop; - u_long recMulticast; - u_long sentBytes; - u_long sentPacks; - u_long sentErrs; - u_long sentMulticast; - u_long sentColls; -} NetDevInfo; - -#define MAXNETDEVS 32 -static NetDevInfo NetDevs[MAXNETDEVS]; -static NetDevInfo oNetDevs[MAXNETDEVS]; -static int NetDevCnt = 0; - -char **parseCommand(const char *cmd) -{ - char *tmp_cmd = strdup(cmd); - char *begin; - char *retval = malloc(sizeof(char *)*2); - - begin = rindex(tmp_cmd, '/'); - *begin = '\0'; - begin++; - retval[1] = strdup(begin); // sensor - - begin = rindex(tmp_cmd, '/'); - *begin = '\0'; - begin = rindex(tmp_cmd, '/'); - begin++; - retval[0] = strdup(begin); // interface - free(tmp_cmd); - - return retval; -} - -/* ------------------------------ public part --------------------------- */ - -void initNetDev(struct SensorModul* sm) -{ - int i; - char monitor[1024]; - - memset(NetDevs,0,sizeof(NetDevInfo)*MAXNETDEVS); - memset(oNetDevs,0,sizeof(NetDevInfo)*MAXNETDEVS); - - updateNetDev(); - - for (i = 0; i < NetDevCnt; i++) { - - sprintf(monitor,"network/interfaces/%s/receiver/packets", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo, sm); - sprintf(monitor ,"network/interfaces/%s/receiver/errors", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo, sm); - /* - [CK] I don't know how to get Bytes sent/received, if someone does please drop me a note. - sprintf(monitor,"network/interfaces/%s/receiver/data", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo, sm); - sprintf(monitor,"network/interfaces/%s/receiver/drops", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo, sm); - sprintf(monitor ,"network/interfaces/%s/receiver/multicast", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo, sm); - */ - - sprintf(monitor,"network/interfaces/%s/transmitter/packets", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo, sm); - sprintf(monitor,"network/interfaces/%s/transmitter/errors", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo, sm); - /* - sprintf(monitor,"network/interfaces/%s/transmitter/data", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo, sm); - sprintf(monitor,"network/interfaces/%s/transmitter/multicast", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo, sm); - */ - sprintf(monitor,"network/interfaces/%s/transmitter/collisions", NetDevs[i].name); - registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo, sm); - } -} - -void exitNetDev(void) -{ - int i; - char monitor[1024]; - - for (i = 0; i < NetDevCnt; i++) { - sprintf(monitor,"network/interfaces/%s/receiver/packets", NetDevs[i].name); - removeMonitor(monitor); - sprintf(monitor,"network/interfaces/%s/receiver/errors", NetDevs[i].name); - removeMonitor(monitor); -/* - sprintf(monitor,"network/interfaces/%s/receiver/drops", NetDevs[i].name); - removeMonitor(monitor); - sprintf(monitor,"network/interfaces/%s/receiver/multicast", NetDevs[i].name); - removeMonitor(monitor); - sprintf(monitor,"network/interfaces/%s/receiver/data", NetDevs[i].name); - removeMonitor(monitor); -*/ - - sprintf(monitor,"network/interfaces/%s/transmitter/packets", NetDevs[i].name); - removeMonitor(monitor); - sprintf(monitor,"network/interfaces/%s/transmitter/errors", NetDevs[i].name); - removeMonitor(monitor); -/* - sprintf(monitor,"network/interfaces/%s/transmitter/data", NetDevs[i].name); - removeMonitor(monitor); - sprintf(monitor,"network/interfaces/%s/transmitter/multicast", NetDevs[i].name); - removeMonitor(monitor); -*/ - sprintf(monitor,"network/interfaces/%s/transmitter/collisions", NetDevs[i].name); - removeMonitor(monitor); - - } -} - -int updateNetDev(void) -{ - int name[6]; - int num_iface=0, i; - char buf[MAXNETDEVS*sizeof(struct ifreq)]; - size_t len; - int s; - struct ifconf ifc; - struct ifstats *istat; - struct timeval tv; - static LONGLONG timestamp=0; - LONGLONG cts,elapsed; - //struct ipstat ips; - - if ((s=socket(PF_INET,SOCK_DGRAM,0)) < 0){ - print_error("socket creation failed"); - return(-1); - } - - ifc.ifc_len = sizeof (buf); - ifc.ifc_buf = buf; - if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) { - print_error("cannot get interface configuration"); - return(-1); - } - - gettimeofday(&tv, 0); - cts = ((LONGLONG)tv.tv_sec * 100 + (LONGLONG) tv.tv_usec / 10000);/* in 10 ms unit*/ - elapsed = cts - timestamp; - timestamp=cts; - - NetDevCnt=0; - - for (i = 0; i < MAXNETDEVS; i++) { - if ( *ifc.ifc_req[i].ifr_name == 0) break; - if (ioctl(s, SIOCGIFSTATS, &ifc.ifc_req[i]) < 0) { - print_error("cannot get interface statistics"); - return (-1); - } - istat=&ifc.ifc_req[i].ifr_stats; - //if ( ifc.ifc_req[i].ifr_flags & IFF_UP) { - strncpy(NetDevs[i].name,ifc.ifc_req[i].ifr_name, IFNAMSIZ); - NetDevs[i].name[IFNAMSIZ-1]='\0'; - NetDevs[i].recBytes = (istat->ifs_ipackets - oNetDevs[i].recBytes) * 100 / elapsed; - NetDevs[i].recPacks = (istat->ifs_ipackets - oNetDevs[i].recPacks) * 100 / elapsed; - NetDevs[i].recErrs = istat->ifs_ierrors - oNetDevs[i].recErrs; - //NetDevs[i].recDrop = istat - oNetDevs[i].recDrop; - //NetDevs[i].recMulticast = istat - oNetDevs[i].recMulticast; - NetDevs[i].sentBytes = istat->ifs_opackets - oNetDevs[i].sentBytes; - NetDevs[i].sentPacks = (istat->ifs_opackets - oNetDevs[i].sentPacks) * 100 / elapsed; - NetDevs[i].sentErrs = (istat->ifs_oerrors - oNetDevs[i].sentErrs) * 100 / elapsed; - //NetDevs[i].sentMulticast = istat - NetDevs[i].sentMulticast; - NetDevs[i].sentColls = (istat->ifs_collisions - oNetDevs[i].sentColls) *100/elapsed; - /* save it for the next round */ - oNetDevs[i].recBytes = istat->ifs_ipackets; - oNetDevs[i].recPacks = istat->ifs_ipackets; - oNetDevs[i].recErrs = istat->ifs_ierrors; - //oNetDevs[i].recDrop = - //oNetDevs[i].recMulticast = - oNetDevs[i].sentBytes = istat->ifs_opackets; - oNetDevs[i].sentPacks = istat->ifs_opackets; - oNetDevs[i].sentErrs = istat->ifs_oerrors; - //oNetDevs[i].sentMulticast = - oNetDevs[i].sentColls = istat->ifs_collisions; - //} - NetDevCnt++; - } - close(s); - return (0); -} - -void printNetDevRecBytes(const char *cmd) -{ - int i; - char **retval; - - retval = parseCommand(cmd); - - if (retval == NULL) - return; - - for (i = 0; i < NetDevCnt; i++) { - if (!strcmp(NetDevs[i].name, retval[0])) { - if (!strncmp(retval[1], "data", 4)) - fprintf(CurrentClient, "%lu", NetDevs[i].recBytes); - if (!strncmp(retval[1], "packets", 7)) - fprintf(CurrentClient, "%lu", NetDevs[i].recPacks); - if (!strncmp(retval[1], "errors", 6)) - fprintf(CurrentClient, "%lu", NetDevs[i].recErrs); - if (!strncmp(retval[1], "drops", 5)) - fprintf(CurrentClient, "%lu", NetDevs[i].recDrop); - if (!strncmp(retval[1], "multicast", 9)) - fprintf(CurrentClient, "%lu", NetDevs[i].recMulticast); - } - } - free(retval[0]); - free(retval[1]); - free(retval); - - fprintf(CurrentClient, "\n"); -} - -void printNetDevRecBytesInfo(const char *cmd) -{ - char **retval; - - retval = parseCommand(cmd); - - if (retval == NULL) - return; - - if (!strncmp(retval[1], "data", 4)) - fprintf(CurrentClient, "Received Data\t0\t0\tkBytes/s\n"); - if (!strncmp(retval[1], "packets", 7)) - fprintf(CurrentClient, "Received Packets\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "errors", 6)) - fprintf(CurrentClient, "Receiver Errors\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "drops", 5)) - fprintf(CurrentClient, "Receiver Drops\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "multicast", 9)) - fprintf(CurrentClient, "Received Multicast Packets\t0\t0\t1/s\n"); - - free(retval[0]); - free(retval[1]); - free(retval); -} - -void printNetDevSentBytes(const char *cmd) -{ - int i; - char **retval; - - retval = parseCommand(cmd); - - if (retval == NULL) - return; - - for (i = 0; i < NetDevCnt; i++) { - if (!strcmp(NetDevs[i].name, retval[0])) { - if (!strncmp(retval[1], "data", 4)) - fprintf(CurrentClient, "%lu", NetDevs[i].sentBytes); - if (!strncmp(retval[1], "packets", 7)) - fprintf(CurrentClient, "%lu", NetDevs[i].sentPacks); - if (!strncmp(retval[1], "errors", 6)) - fprintf(CurrentClient, "%lu", NetDevs[i].sentErrs); - if (!strncmp(retval[1], "multicast", 9)) - fprintf(CurrentClient, "%lu", NetDevs[i].sentMulticast); - if (!strncmp(retval[1], "collisions", 10)) - fprintf(CurrentClient, "%lu", NetDevs[i].sentColls); - } - } - free(retval[0]); - free(retval[1]); - free(retval); - - fprintf(CurrentClient, "\n"); -} - -void printNetDevSentBytesInfo(const char *cmd) -{ - char **retval; - - retval = parseCommand(cmd); - - if (retval == NULL) - return; - - if (!strncmp(retval[1], "data", 4)) - fprintf(CurrentClient, "Sent Data\t0\t0\tkBytes/s\n"); - if (!strncmp(retval[1], "packets", 7)) - fprintf(CurrentClient, "Sent Packets\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "errors", 6)) - fprintf(CurrentClient, "Transmitter Errors\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "multicast", 9)) - fprintf(CurrentClient, "Sent Multicast Packets\t0\t0\t1/s\n"); - if (!strncmp(retval[1], "collisions", 10)) - fprintf(CurrentClient, "Transmitter Collisions\t0\t0\t1/s\n"); - - free(retval[0]); - free(retval[1]); - free(retval); -} diff --git a/ksysguard/ksysguardd/Irix/NetDev.h b/ksysguard/ksysguardd/Irix/NetDev.h deleted file mode 100644 index aa30166e9..000000000 --- a/ksysguard/ksysguardd/Irix/NetDev.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 2001 Tobias Koenig <tokoe@kde.org> - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _netdev_h_ -#define _netdev_h_ - -void initNetDev(struct SensorModul* sm); -void exitNetDev(void); - -int updateNetDev(void); - -void printNetDevRecBytes(const char* cmd); -void printNetDevRecBytesInfo(const char* cmd); -void printNetDevSentBytes(const char* cmd); -void printNetDevSentBytesInfo(const char* cmd); - -#endif diff --git a/ksysguard/ksysguardd/Irix/ProcessList.c b/ksysguard/ksysguardd/Irix/ProcessList.c deleted file mode 100644 index cf95b2937..000000000 --- a/ksysguard/ksysguardd/Irix/ProcessList.c +++ /dev/null @@ -1,462 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <errno.h> -#include <fcntl.h> -#include <signal.h> -#include <sys/types.h> -#include <dirent.h> -#include <pwd.h> -#include <sys/resource.h> -#include <sys/procfs.h> -#include <sys/statfs.h> -#include <sys/sysmp.h> -#include <sys/sysinfo.h> - -#include "ccont.h" -#include "../../gui/SignalIDs.h" -#include "ksysguardd.h" - -#include "Command.h" -#include "ProcessList.h" - -#define BUFSIZE 1024 -#define TDEINITLEN strlen("tdeinit: ") - -typedef struct { - int alive; /* for "garbage collection" */ - pid_t pid; /* process ID */ - pid_t ppid; /* parent process ID */ - uid_t uid; /* process owner (real UID) */ - gid_t gid; /* process group (real GID) */ - char *userName; /* process owner (name) */ - int nThreads; /* # of threads in this process */ - int Prio; /* scheduling priority */ - size_t Size; /* total size of process image */ - size_t RSSize; /* resident set size */ - char State[8]; /* process state */ - double Time; /* CPU time for the process in 100ms */ - double Load; /* CPU load in % */ - char Command[PRCOMSIZ];/* command name */ - char CmdLine[PRARGSZ];/* command line */ - double centStamp; /* timestamp for CPU load */ -} ProcessInfo; - -static CONTAINER ProcessList = 0; -static unsigned ProcessCount = 0; /* # of processes */ -static DIR *procdir; /* handle for /proc */ -static int pagesz; - -#define KBYTES 1024 - -/* - * lwpStateName() -- return string representation of process state - */ -char *lwpStateName( prpsinfo_t lwpinfo ) { - - static char result[8]; - - switch( lwpinfo.pr_sname ) { - case 'S': - sprintf( result, "%s", "sleep" ); - break; - case 'R': - sprintf( result, "%s", "run" ); - break; - case 'Z': - sprintf( result, "%s", "zombie" ); - break; - case 'T': - sprintf( result, "%s", "stop" ); - break; - case 'I': - sprintf( result, "%s", "start" ); - break; - case 'X': - sprintf( result, "%s", "wmem" ); - case '0': - sprintf( result, "%s/%d", "cpu", (int) lwpinfo.pr_sonproc ); - break; - default: - sprintf( result, "%s", "???" ); - break; - } - - return( result ); -} - -static void validateStr( char *string ) { - - char *ptr = string; - - /* - * remove all chars that might screw up communication - */ - while( *ptr != '\0' ) { - if( *ptr == '\t' || *ptr == '\n' || *ptr == '\r' ) - *ptr = ' '; - ptr++; - } - /* - * make sure there's at least one char - */ - if( string[0] == '\0' ) - strcpy( string, " " ); -} - -static int processCmp( void *p1, void *p2 ) { - - return( ((ProcessInfo *) p1)->pid - ((ProcessInfo *) p2)->pid ); -} - -static ProcessInfo *findProcessInList( pid_t pid ) { - - ProcessInfo key; - long index; - - key.pid = pid; - if( (index = search_ctnr( ProcessList, processCmp, &key )) < 0 ) - return( NULL ); - - return( get_ctnr( ProcessList, index )); -} - -static int updateProcess( pid_t pid ) { - ProcessInfo *ps; - int fd; - char buf[BUFSIZE]; - prpsinfo_t psinfo; - struct passwd *pw; - double newCentStamp,timeDiff, usDiff,usTime; - struct timeval tv; - - if( (ps = findProcessInList( pid )) == NULL ) { - if( (ps = (ProcessInfo *) malloc( sizeof( ProcessInfo ))) - == NULL ) { - print_error( "cannot malloc()\n" ); - return( -1 ); - } - ps->pid = pid; - ps->userName = NULL; - ps->alive = 0; - - gettimeofday(&tv, 0); - ps->centStamp = (double)tv.tv_sec * 100.0 + (double)tv.tv_usec / 10000.0; - - push_ctnr( ProcessList, ps ); - bsort_ctnr( ProcessList, processCmp ); - } - - sprintf( buf, "%s/pinfo/%ld", PROCDIR, pid ); - if( (fd = open( buf, O_RDONLY )) < 0 ) { - /* process terminated */ - return( -1 ); - } - - - - if( ioctl(fd,PIOCPSINFO,&psinfo) < 0) { - print_error( "cannot read psinfo from \"%s\"\n", buf ); - close( fd ); - return( -1 ); - } - close( fd ); - - ps->ppid = psinfo.pr_ppid; - ps->uid = psinfo.pr_uid; - ps->gid = psinfo.pr_gid; - - pw = getpwuid( psinfo.pr_uid ); - if( ps->userName != NULL ) - free( ps->userName ); - ps->userName = strdup( pw->pw_name ); - - strncpy (ps->State,lwpStateName( psinfo ),8); - ps->State[7]='\0'; - - - ps->Prio = psinfo.pr_pri; - - gettimeofday(&tv, 0); - newCentStamp = (double)tv.tv_sec * 100.0 + (double) tv.tv_usec / 10000.0; - usTime = (double) psinfo.pr_time.tv_sec * 100.0 + (double)psinfo.pr_time.tv_nsec / 10000000.0; - - timeDiff = newCentStamp - ps->centStamp; - usDiff = usTime - ps->Time; - - if ((timeDiff > 0.0) && (usDiff >= 0.0)) - { - ps->Load = (usDiff / timeDiff) * 100.0; - /* During startup we get bigger loads since the time diff - * cannot be correct. So we force it to 0. */ - ps->Load = (ps->Load > 100.0) ? 0.0 : ps->Load; - } - else - ps->Load = 0.0; - - ps->centStamp = newCentStamp; - ps->Time = usTime; - - ps->Size = (psinfo.pr_size * pagesz)/KBYTES; - ps->RSSize = (psinfo.pr_rssize * pagesz)/KBYTES; - - strncpy(ps->Command,psinfo.pr_fname,PRCOMSIZ); - ps->Command[PRCOMSIZ-1]='\0'; - - strncpy(ps->CmdLine,psinfo.pr_psargs,PRARGSZ); - ps->CmdLine[PRARGSZ-1]='\0'; - - validateStr( ps->Command ); - validateStr( ps->CmdLine ); - - ps->alive = 1; - return( 0 ); -} - -static void cleanupProcessList( void ) { - - ProcessInfo *ps; - - ProcessCount = 0; - for( ps = first_ctnr( ProcessList ); ps; ps = next_ctnr( ProcessList )) { - if( ps->alive ) { - ps->alive = 0; - ProcessCount++; - } else { - free( remove_ctnr( ProcessList )); - } - } -} - -void initProcessList( struct SensorModul* sm ) { - - if( (procdir = opendir( PROCDIR )) == NULL ) { - print_error( "cannot open \"%s\" for reading\n", PROCDIR ); - return; - } - pagesz=getpagesize(); - ProcessList = new_ctnr(); - updateProcessList(); - - /* - * register the supported monitors & commands - */ - registerMonitor( "pscount", "integer", - printProcessCount, printProcessCountInfo, sm ); - registerMonitor( "ps", "table", - printProcessList, printProcessListInfo, sm ); - - if (!RunAsDaemon) - { - registerCommand("kill", killProcess); - registerCommand("setpriority", setPriority); - } -} - -void exitProcessList( void ) { - - removeMonitor("ps"); - removeMonitor("pscount"); - - if (!RunAsDaemon) - { - removeCommand("kill"); - removeCommand("setpriority"); - } - - destr_ctnr( ProcessList, free ); -} - -int updateProcessList( void ) { - - struct dirent *de; - struct statfs sf; - - statfs("/proc/pinfo",&sf,sizeof(sf),0); - ProcessCount = sf.f_files; - - rewinddir( procdir ); - while( (de = readdir( procdir )) != NULL ) { - /* - * skip '.' and '..' - */ - if( de->d_name[0] == '.' ) - continue; - - /* - * fetch the process info and insert it into the info table - */ - updateProcess( (pid_t) atol( de->d_name )); - } - cleanupProcessList(); - - return( 0 ); -} - -void printProcessListInfo( const char *cmd ) { - fprintf(CurrentClient, "Name\tPID\tPPID\tGID\tStatus\tUser" - "\tSize\tResident\t%% CPU\tPriority\tCommand\n" ); - fprintf(CurrentClient, "s\td\td\td\ts\ts\tD\tD\tf\td\ts\n" ); -} - -void printProcessList( const char *cmd ) { - - ProcessInfo *ps; - - for( ps = first_ctnr( ProcessList ); ps; ps = next_ctnr( ProcessList )) { - fprintf(CurrentClient, - "%s\t%ld\t%ld\t%ld\t%s\t%s\t%d\t%d\t%.2f\t%d\t%s\n", - ps->Command, - (long) ps->pid, - (long) ps->ppid, - (long) ps->gid, - ps->State, - ps->userName, - ps->Size, - ps->RSSize, - ps->Load, - ps->Prio, - ps->CmdLine); - } - - fprintf(CurrentClient, "\n"); -} - -void printProcessCount( const char *cmd ) { - fprintf(CurrentClient, "%d\n", ProcessCount ); -} - -void printProcessCountInfo( const char *cmd ) { - fprintf(CurrentClient, "Number of Processes\t0\t0\t\n" ); -} - -void killProcess( const char *cmd ) { - - int sig, pid; - - sscanf( cmd, "%*s %d %d", &pid, &sig ); - - switch( sig ) { - case MENU_ID_SIGABRT: - sig = SIGABRT; - break; - case MENU_ID_SIGALRM: - sig = SIGALRM; - break; - case MENU_ID_SIGCHLD: - sig = SIGCHLD; - break; - case MENU_ID_SIGCONT: - sig = SIGCONT; - break; - case MENU_ID_SIGFPE: - sig = SIGFPE; - break; - case MENU_ID_SIGHUP: - sig = SIGHUP; - break; - case MENU_ID_SIGILL: - sig = SIGILL; - break; - case MENU_ID_SIGINT: - sig = SIGINT; - break; - case MENU_ID_SIGKILL: - sig = SIGKILL; - break; - case MENU_ID_SIGPIPE: - sig = SIGPIPE; - break; - case MENU_ID_SIGQUIT: - sig = SIGQUIT; - break; - case MENU_ID_SIGSEGV: - sig = SIGSEGV; - break; - case MENU_ID_SIGSTOP: - sig = SIGSTOP; - break; - case MENU_ID_SIGTERM: - sig = SIGTERM; - break; - case MENU_ID_SIGTSTP: - sig = SIGTSTP; - break; - case MENU_ID_SIGTTIN: - sig = SIGTTIN; - break; - case MENU_ID_SIGTTOU: - sig = SIGTTOU; - break; - case MENU_ID_SIGUSR1: - sig = SIGUSR1; - break; - case MENU_ID_SIGUSR2: - sig = SIGUSR2; - break; - } - if( kill( (pid_t) pid, sig )) { - switch( errno ) { - case EINVAL: - fprintf(CurrentClient, "4\n" ); - break; - case ESRCH: - fprintf(CurrentClient, "3\n" ); - break; - case EPERM: - fprintf(CurrentClient, "2\n" ); - break; - default: - fprintf(CurrentClient, "1\n" ); /* unknown error */ - break; - } - } else - fprintf(CurrentClient, "0\n"); -} - -void setPriority( const char *cmd ) { - int pid, prio; - - sscanf( cmd, "%*s %d %d", &pid, &prio ); - if( setpriority( PRIO_PROCESS, pid, prio )) { - switch( errno ) { - case EINVAL: - fprintf(CurrentClient, "4\n" ); - break; - case ESRCH: - fprintf(CurrentClient, "3\n" ); - break; - case EPERM: - case EACCES: - fprintf(CurrentClient, "2\n" ); - break; - default: - fprintf(CurrentClient, "1\n" ); /* unknown error */ - break; - } - } else - fprintf(CurrentClient, "0\n"); -} diff --git a/ksysguard/ksysguardd/Irix/ProcessList.h b/ksysguard/ksysguardd/Irix/ProcessList.h deleted file mode 100644 index 5d949279e..000000000 --- a/ksysguard/ksysguardd/Irix/ProcessList.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _ProcessList_H_ -#define _ProcessList_H_ - -#define PROCDIR "/proc" - -void initProcessList(struct SensorModul* sm); -void exitProcessList(void); - -int updateProcessList(void); - -void printProcessList(const char*); -void printProcessListInfo(const char*); - -void printProcessCount(const char* cmd); -void printProcessCountInfo(const char* cmd); - -void killProcess(const char* cmd); -void setPriority(const char* cmd); - -#endif diff --git a/ksysguard/ksysguardd/Irix/cpu.c b/ksysguard/ksysguardd/Irix/cpu.c deleted file mode 100644 index 7c013db37..000000000 --- a/ksysguard/ksysguardd/Irix/cpu.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Irix support by Carsten Kroll <ckroll@pinnaclesys.com> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> -#include <sys/sysmp.h> -#include <sys/sysinfo.h> - -#include "cpu.h" -#include "Command.h" -#include "ksysguardd.h" - -#define CPUSTATES 6 - -long percentages(int cnt, int *out, long *new, long *old, long *diffs); - -static int nCPUs=0; - - -long cp_time[CPUSTATES]; -long cp_old[CPUSTATES]; -long cp_diff[CPUSTATES]; -int cpu_states[CPUSTATES]; - -struct cpu_info{ - long cp_time[CPUSTATES]; - long cp_old[CPUSTATES]; - long cp_diff[CPUSTATES]; - int cpu_states[CPUSTATES]; -}; - -static struct cpu_info *g_ci; - -/* returns the requested cpu number starting at 0*/ -int getID(const char *cmd){ - int id; - sscanf(cmd + 7, "%d", &id); - return id-1; -} - -void -initCpuInfo(struct SensorModul* sm) -{ - char mname[50]; - int i; - if (sysmp(MP_NPROCS,&nCPUs) < 0) nCPUs=0; - nCPUs++; - g_ci = malloc(sizeof(struct cpu_info) * nCPUs); - memset(g_ci,0,sizeof(struct cpu_info) * nCPUs); - - registerMonitor("cpu/user", "integer", printCPUUser, - printCPUUserInfo, sm); - registerMonitor("cpu/sys", "integer", printCPUSys, - printCPUSysInfo, sm); - registerMonitor("cpu/idle", "integer", printCPUIdle, - printCPUIdleInfo, sm); - - if (nCPUs > 1) for (i=0;i<nCPUs;i++){ - /* indidividual CPU load */ - sprintf(mname,"cpu/cpu%d/user",i+1); - registerMonitor(mname, "integer", printCPUxUser, - printCPUUserInfo, sm); - sprintf(mname,"cpu/cpu%d/sys",i+1); - registerMonitor(mname, "integer", printCPUxSys, - printCPUSysInfo, sm); - sprintf(mname,"cpu/cpu%d/idle",i+1); - registerMonitor(mname, "integer", printCPUxIdle, - printCPUIdleInfo, sm); - } - - updateCpuInfo(); -} - -void -exitCpuInfo(void) -{ - free(g_ci); -} - -int -updateCpuInfo(void) -{ - struct sysinfo si; - int rv=0; - int i; - /* overall summary */ - if (sysmp(MP_SAGET,MPSA_SINFO,&si,sizeof(struct sysinfo)) >=0){ - cp_time[CPU_IDLE] =si.cpu[CPU_IDLE]; - cp_time[CPU_USER] =si.cpu[CPU_USER]; - cp_time[CPU_KERNEL]=si.cpu[CPU_KERNEL]; - cp_time[CPU_SXBRK] =si.cpu[CPU_SXBRK]; - cp_time[CPU_INTR] =si.cpu[CPU_INTR]; - cp_time[CPU_WAIT] =si.cpu[CPU_WAIT]; - percentages(CPUSTATES,cpu_states,cp_time,cp_old,cp_diff); - } - /* individual CPU statistics*/ - if (nCPUs > 1) for (i=0;i<nCPUs;i++){ - if (sysmp(MP_SAGET1,MPSA_SINFO,&si,sizeof(struct sysinfo),i) >=0){ - g_ci[i].cp_time[CPU_IDLE] =si.cpu[CPU_IDLE]; - g_ci[i].cp_time[CPU_USER] =si.cpu[CPU_USER]; - g_ci[i].cp_time[CPU_KERNEL]=si.cpu[CPU_KERNEL]; - g_ci[i].cp_time[CPU_SXBRK] =si.cpu[CPU_SXBRK]; - g_ci[i].cp_time[CPU_INTR] =si.cpu[CPU_INTR]; - g_ci[i].cp_time[CPU_WAIT] =si.cpu[CPU_WAIT]; - percentages(CPUSTATES, g_ci[i].cpu_states, g_ci[i].cp_time, g_ci[i].cp_old,g_ci[i].cp_diff); - }else{ - rv =-1; - } - } - return (rv); -} - -void -printCPUUser(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", cpu_states[CPU_USER]/10); -} - -void -printCPUUserInfo(const char* cmd) -{ - fprintf(CurrentClient, "CPU User Load\t0\t100\t%%\n"); -} - -void -printCPUSys(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", cpu_states[CPU_KERNEL]/10); -} - -void -printCPUSysInfo(const char* cmd) -{ - fprintf(CurrentClient, "CPU System Load\t0\t100\t%%\n"); -} - -void -printCPUIdle(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", cpu_states[CPU_IDLE]/10); -} - -void -printCPUIdleInfo(const char* cmd) -{ - fprintf(CurrentClient, "CPU Idle Load\t0\t100\t%%\n"); -} -/* same as above but for individual CPUs */ -void -printCPUxUser(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", g_ci[getID(cmd)].cpu_states[CPU_USER]/10); -} - -void -printCPUxSys(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", g_ci[getID(cmd)].cpu_states[CPU_KERNEL]/10); -} - -void -printCPUxIdle(const char* cmd) -{ - fprintf(CurrentClient, "%d\n", g_ci[getID(cmd)].cpu_states[CPU_IDLE]/10); -} - - -/* The part ripped from top... */ -/* - * Top users/processes display for Unix - * Version 3 - * - * This program may be freely redistributed, - * but this entire comment MUST remain intact. - * - * Copyright (c) 1984, 1989, William LeFebvre, Rice University - * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University - */ - -/* - * percentages(cnt, out, new, old, diffs) - calculate percentage change - * between array "old" and "new", putting the percentages in "out". - * "cnt" is size of each array and "diffs" is used for scratch space. - * The array "old" is updated on each call. - * The routine assumes modulo arithmetic. This function is especially - * useful on BSD mchines for calculating cpu state percentages. - */ - -long percentages(cnt, out, new, old, diffs) - -int cnt; -int *out; -long *new; -long *old; -long *diffs; - -{ - int i; - long change; - long total_change; - long *dp; - long half_total; - - /* initialization */ - total_change = 0; - dp = diffs; - - /* calculate changes for each state and the overall change */ - for (i = 0; i < cnt; i++) - { - if ((change = *new - *old) < 0) - { - /* this only happens when the counter wraps */ - change = (int) - ((unsigned long)*new-(unsigned long)*old); - } - total_change += (*dp++ = change); - *old++ = *new++; - } - - /* avoid divide by zero potential */ - if (total_change == 0) - { - total_change = 1; - } - - /* calculate percentages based on overall change, rounding up */ - half_total = total_change / 2l; - - /* Do not divide by 0. Causes Floating point exception */ - if(total_change) { - for (i = 0; i < cnt; i++) - { - *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); - } - } - - /* return the total in case the caller wants to use it */ - return(total_change); -} diff --git a/ksysguard/ksysguardd/Irix/cpu.h b/ksysguard/ksysguardd/Irix/cpu.h deleted file mode 100644 index f61d12505..000000000 --- a/ksysguard/ksysguardd/Irix/cpu.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _cpuinfo_h_ -#define _cpuinfo_h_ - -void initCpuInfo(struct SensorModul* sm); -void exitCpuInfo(void); - -int updateCpuInfo(void); - -void printCPUUser(const char* cmd); -void printCPUUserInfo(const char* cmd); -void printCPUSys(const char* cmd); -void printCPUSysInfo(const char* cmd); -void printCPUIdle(const char* cmd); -void printCPUIdleInfo(const char* cmd); -void printCPUxUser(const char* cmd); -void printCPUxUserInfo(const char* cmd); -void printCPUxSys(const char* cmd); -void printCPUxSysInfo(const char* cmd); -void printCPUxIdle(const char* cmd); -void printCPUxIdleInfo(const char* cmd); - -#endif diff --git a/ksysguard/ksysguardd/Makefile.am b/ksysguard/ksysguardd/Makefile.am index 0e1f1122a..4e03919bc 100644 --- a/ksysguard/ksysguardd/Makefile.am +++ b/ksysguard/ksysguardd/Makefile.am @@ -12,15 +12,12 @@ endif if include_ksysguardd_solaris solaris_SUBDIR = Solaris endif -if include_ksysguardd_irix -irix_SUBDIR = Irix -endif if include_ksysguardd_openbsd openbsd_SUBDIR = OpenBSD endif SUBDIRS = $(linux_SUBDIR) $(freebsd_SUBDIR) $(netbsd_SUBDIR)\ - $(solaris_SUBDIR) $(irix_SUBDIR) $(openbsd_SUBDIR) + $(solaris_SUBDIR) $(openbsd_SUBDIR) KSYSGUARDDRCFILE=$(sysconfdir)/ksysguarddrc INCLUDES = -DKSYSGUARDDRCFILE="\"$(KSYSGUARDDRCFILE)\"" -DOSTYPE_$(UNAME) -I$(srcdir)/../CContLib -I$(srcdir)/$(UNAME) $(all_includes) diff --git a/ksysguard/ksysguardd/Tru64/LoadAvg.c b/ksysguard/ksysguardd/Tru64/LoadAvg.c deleted file mode 100644 index ddbe68e2d..000000000 --- a/ksysguard/ksysguardd/Tru64/LoadAvg.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/swap.h> - -#include "config.h" - -#ifdef HAVE_KSTAT -#include <kstat.h> -#endif - -#include "ksysguardd.h" -#include "Command.h" -#include "LoadAvg.h" - -double loadavg1 = 0.0; -double loadavg5 = 0.0; -double loadavg15 = 0.0; - -void initLoadAvg( struct SensorModul* sm ) { -#ifdef HAVE_KSTAT - registerMonitor( "cpu/loadavg1", "float", - printLoadAvg1, printLoadAvg1Info, sm ); - registerMonitor( "cpu/loadavg5", "float", - printLoadAvg5, printLoadAvg5Info, sm ); - registerMonitor( "cpu/loadavg15", "float", - printLoadAvg15, printLoadAvg15Info, sm ); -#endif -} - -void exitLoadAvg( void ) { -} - -int updateLoadAvg( void ) { - -#ifdef HAVE_KSTAT - kstat_ctl_t *kctl; - kstat_t *ksp; - kstat_named_t *kdata; - - /* - * get a kstat handle and update the user's kstat chain - */ - if( (kctl = kstat_open()) == NULL ) - return( 0 ); - while( kstat_chain_update( kctl ) != 0 ) - ; - - /* - * traverse the kstat chain to find the appropriate statistics - */ - if( (ksp = kstat_lookup( kctl, "unix", 0, "system_misc" )) == NULL ) - return( 0 ); - if( kstat_read( kctl, ksp, NULL ) == -1 ) - return( 0 ); - - /* - * lookup the data - */ - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "avenrun_1min" ); - if( kdata != NULL ) - loadavg1 = LOAD( kdata->value.ui32 ); - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "avenrun_5min" ); - if( kdata != NULL ) - loadavg5 = LOAD( kdata->value.ui32 ); - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "avenrun_15min" ); - if( kdata != NULL ) - loadavg15 = LOAD( kdata->value.ui32 ); - - kstat_close( kctl ); -#endif /* ! HAVE_KSTAT */ - - return( 0 ); -} - -void printLoadAvg1Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 1min\t0\t0\n" ); -} - -void printLoadAvg1( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg1 ); -} - -void printLoadAvg5Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 5min\t0\t0\n" ); -} - -void printLoadAvg5( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg5 ); -} - -void printLoadAvg15Info( const char *cmd ) { - fprintf(CurrentClient, "avnrun 15min\t0\t0\n" ); -} - -void printLoadAvg15( const char *cmd ) { - fprintf(CurrentClient, "%f\n", loadavg15 ); -} diff --git a/ksysguard/ksysguardd/Tru64/LoadAvg.h b/ksysguard/ksysguardd/Tru64/LoadAvg.h deleted file mode 100644 index eea8ad82e..000000000 --- a/ksysguard/ksysguardd/Tru64/LoadAvg.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _LoadAvg_h_ -#define _LoadAvg_h_ - -#define LOAD(a) ((double)(a) / (1 << 8 )) - -void initLoadAvg(struct SensorModul* sm); -void exitLoadAvg(void); - -int updateLoadAvg(void); - -void printLoadAvg1( const char *cmd ); -void printLoadAvg1Info( const char *cmd ); -void printLoadAvg5( const char *cmd ); -void printLoadAvg5Info( const char *cmd ); -void printLoadAvg15( const char *cmd ); -void printLoadAvg15Info( const char *cmd ); - -#endif /* _LoadAvg_h_ */ diff --git a/ksysguard/ksysguardd/Tru64/Makefile.am b/ksysguard/ksysguardd/Tru64/Makefile.am deleted file mode 100644 index 95be0247b..000000000 --- a/ksysguard/ksysguardd/Tru64/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# -# -AM_CFLAGS = -Wall - -INCLUDES = -I$(srcdir)/../../CContLib -I.. - -lib_LIBRARIES = libksysguardd.a -libksysguardd_a_SOURCES = Memory.c LoadAvg.c NetDev.c diff --git a/ksysguard/ksysguardd/Tru64/Memory.c b/ksysguard/ksysguardd/Tru64/Memory.c deleted file mode 100644 index 3a9332064..000000000 --- a/ksysguard/ksysguardd/Tru64/Memory.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/stat.h> -#include <sys/swap.h> - -#include "config.h" - -#ifdef HAVE_KSTAT -#include <kstat.h> -#endif - -#include "ksysguardd.h" -#include "Command.h" -#include "Memory.h" - -static int Dirty = 1; -static t_memsize totalmem = (t_memsize) 0; -static t_memsize freemem = (t_memsize) 0; -static long totalswap = 0L; -static long freeswap = 0L; - -/* - * this is borrowed from top's m_sunos5 module - * used by permission from William LeFebvre - */ -static int pageshift; -static long (*p_pagetok) (); -#define pagetok(size) ((*p_pagetok)(size)) - -long pagetok_none( long size ) { - return( size ); -} - -long pagetok_left( long size ) { - return( size << pageshift ); -} - -long pagetok_right( long size ) { - return( size >> pageshift ); -} - -void initMemory( struct SensorModul* sm ) { - - long i = sysconf( _SC_PAGESIZE ); - - pageshift = 0; - while( (i >>= 1) > 0 ) - pageshift++; - - /* calculate an amount to shift to K values */ - /* remember that log base 2 of 1024 is 10 (i.e.: 2^10 = 1024) */ - pageshift -= 10; - - /* now determine which pageshift function is appropriate for the - result (have to because x << y is undefined for y < 0) */ - if( pageshift > 0 ) { - /* this is the most likely */ - p_pagetok = pagetok_left; - } else if( pageshift == 0 ) { - p_pagetok = pagetok_none; - } else { - p_pagetok = pagetok_right; - pageshift = -pageshift; - } - -#ifdef HAVE_KSTAT - registerMonitor( "mem/physical/free", "integer", - printMemFree, printMemFreeInfo, sm ); - registerMonitor( "mem/physical/used", "integer", - printMemUsed, printMemUsedInfo, sm ); -#endif - registerMonitor( "mem/swap/free", "integer", - printSwapFree, printSwapFreeInfo, sm ); - registerMonitor( "mem/swap/used", "integer", - printSwapUsed, printSwapUsedInfo, sm ); -} - -void exitMemory( void ) { -} - -int updateMemory( void ) { - - struct swaptable *swt; - struct swapent *ste; - int i; - int ndevs; - long swaptotal; - long swapfree; - char dummy[128]; -#ifdef HAVE_KSTAT - kstat_ctl_t *kctl; - kstat_t *ksp; - kstat_named_t *kdata; -#endif /* HAVE_KSTAT */ - - if( (ndevs = swapctl( SC_GETNSWP, NULL )) < 1 ) - return( 0 ); - if( (swt = (struct swaptable *) malloc( - sizeof( int ) - + ndevs * sizeof( struct swapent ))) == NULL ) - return( 0 ); - - /* - * fill in the required fields and retrieve the info thru swapctl() - */ - swt->swt_n = ndevs; - ste = &(swt->swt_ent[0]); - for( i = 0; i < ndevs; i++ ) { - /* - * since we'renot interested in the path(s), - * we'll re-use the same buffer - */ - ste->ste_path = dummy; - ste++; - } - swapctl( SC_LIST, swt ); - - swaptotal = swapfree = 0L; - - ste = &(swt->swt_ent[0]); - for( i = 0; i < ndevs; i++ ) { - if( (! (ste->ste_flags & ST_INDEL)) - && (! (ste->ste_flags & ST_DOINGDEL)) ) { - swaptotal += ste->ste_pages; - swapfree += ste->ste_free; - } - ste++; - } - free( swt ); - - totalswap = pagetok( swaptotal ); - freeswap = pagetok( swapfree ); - -#ifdef HAVE_KSTAT - /* - * get a kstat handle and update the user's kstat chain - */ - if( (kctl = kstat_open()) == NULL ) - return( 0 ); - while( kstat_chain_update( kctl ) != 0 ) - ; - - totalmem = pagetok( sysconf( _SC_PHYS_PAGES )); - - /* - * traverse the kstat chain to find the appropriate statistics - */ - if( (ksp = kstat_lookup( kctl, "unix", 0, "system_pages" )) == NULL ) - return( 0 ); - if( kstat_read( kctl, ksp, NULL ) == -1 ) - return( 0 ); - - /* - * lookup the data - */ - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "freemem" ); - if( kdata != NULL ) - freemem = pagetok( kdata->value.ui32 ); - - kstat_close( kctl ); -#endif /* ! HAVE_KSTAT */ - - Dirty = 0; - - return( 0 ); -} - -void printMemFreeInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Free Memory\t0\t%ld\tKB\n", totalmem ); -} - -void printMemFree( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", freemem ); -} - -void printMemUsedInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Used Memory\t0\t%ld\tKB\n", totalmem ); -} - -void printMemUsed( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", totalmem - freemem ); -} - -void printSwapFreeInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Free Swap\t0\t%ld\tKB\n", totalswap ); -} - -void printSwapFree( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", freeswap ); -} - -void printSwapUsedInfo( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "Used Swap\t0\t%ld\tKB\n", totalswap ); -} - -void printSwapUsed( const char *cmd ) { - if( Dirty ) - updateMemory(); - fprintf(CurrentClient, "%ld\n", totalswap - freeswap ); -} diff --git a/ksysguard/ksysguardd/Tru64/Memory.h b/ksysguard/ksysguardd/Tru64/Memory.h deleted file mode 100644 index 7df6eb033..000000000 --- a/ksysguard/ksysguardd/Tru64/Memory.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _Memory_h_ -#define _Memory_h_ - -typedef unsigned long t_memsize; - -#define PAGETOK(a) ((( (t_memsize) sysconf( _SC_PAGESIZE )) / (t_memsize) 1024) * (t_memsize) (a)) - -void initMemory(struct SensorModul* sm); -void exitMemory(void); - -int updateMemory(void); - -void printMemFree( const char *cmd ); -void printMemFreeInfo( const char *cmd ); -void printMemUsed( const char *cmd ); -void printMemUsedInfo( const char *cmd ); - -void printSwapFree( const char *cmd ); -void printSwapFreeInfo( const char *cmd ); -void printSwapUsed( const char *cmd ); -void printSwapUsedInfo( const char *cmd ); - -#endif /* _Memory_h */ diff --git a/ksysguard/ksysguardd/Tru64/NetDev.c b/ksysguard/ksysguardd/Tru64/NetDev.c deleted file mode 100644 index 0699b929a..000000000 --- a/ksysguard/ksysguardd/Tru64/NetDev.c +++ /dev/null @@ -1,678 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999, 2000 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program is free software; you can redistribute it and/or - modify it under the terms of version 2 of the GNU General Public - License as published by the Free Software Foundation. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <errno.h> -#include <stropts.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <net/if.h> - -#include "config.h" - -#ifdef HAVE_KSTAT -#include <kstat.h> -#endif - -#include "ksysguardd.h" -#include "Command.h" -#include "NetDev.h" - -/* - * available network interface statistics through kstat(3): - * - * kstat name value - * ---------------------------------------------------------------------- - * for the loopback interface(s) we can get - * ipackets # packets received - * opackets # packets sent - * in addition to those, for "real" interfaces: - * oerrors # xmit errors - * ierrors # recv errors - * macxmt_errors # xmit errors reported by hardware? - * macrcv_errors # recv errors reported by hardware? - * opackets64 same as opackets (64bit) - * ipackets64 same as ipackets (64bit) - * obytes # bytes sent - * rbytes # bytes received - * obytes64 same as obytes (64bit) - * rbytes64 same as ibytes (64bit) - * collisions # collisions - * multixmt # multicasts sent? - * multircv # multicasts received? - * brdcstxmt # broadcasts transmitted - * brdcstrcv # broadcasts received - * unknowns - * blocked - * ex_collisions - * defer_xmts - * align_errors - * fcs_errors - * oflo # overflow errors - * uflo # underflow errors - * runt_errors - * missed - * tx_late_collisions - * carrier_errors - * noxmtbuf - * norcvbuf - * xmt_badinterp - * rcv_badinterp - * intr # interrupts? - * xmtretry # xmit retries? - * ifspeed interface speed: 10000000 for 10BaseT - * duplex "half" or "full" - * media e.g. "PHY/MII" - * promisc promiscuous mode (e.g. "off") - * first_collisions - * multi_collisions - * sqe_errors - * toolong_errors - */ - -typedef struct { - char *Name; - short flags; - unsigned long ipackets; - unsigned long OLDipackets; - unsigned long opackets; - unsigned long OLDopackets; - unsigned long ierrors; - unsigned long OLDierrors; - unsigned long oerrors; - unsigned long OLDoerrors; - unsigned long collisions; - unsigned long OLDcollisions; - unsigned long multixmt; - unsigned long OLDmultixmt; - unsigned long multircv; - unsigned long OLDmultircv; - unsigned long brdcstxmt; - unsigned long OLDbrdcstxmt; - unsigned long brdcstrcv; - unsigned long OLDbrdcstrcv; -} NetDevInfo; - - -#define NBUFFERS 64 -#define MAXNETDEVS 64 -static NetDevInfo IfInfo[MAXNETDEVS]; - -static int NetDevCount; - -/* - * insertnetdev() -- insert device name & flags into our list - */ -int insertnetdev( const char *name, const short flags ) { - - int i = 0; - - /* - * interface "aliases" don't seem to have - * separate kstat statistics, so we skip them - */ - if( strchr( name, (int) ':' ) != NULL ) - return( 0 ); - - while( (i < NetDevCount) && (strcmp( IfInfo[i].Name, name ) != 0) ) { - if( strcmp( IfInfo[i].Name, name ) == 0 ) - return( 0 ); - i++; - } - - /* - * init new slot - */ - IfInfo[i].Name = strdup( name ); - IfInfo[i].flags = flags; - IfInfo[i].ipackets = 0L; - IfInfo[i].OLDipackets = 0L; - IfInfo[i].opackets = 0L; - IfInfo[i].OLDopackets = 0L; - IfInfo[i].ierrors = 0L; - IfInfo[i].OLDierrors = 0L; - IfInfo[i].oerrors = 0L; - IfInfo[i].OLDoerrors = 0L; - IfInfo[i].collisions = 0L; - IfInfo[i].OLDcollisions = 0L; - IfInfo[i].multixmt = 0L; - IfInfo[i].OLDmultixmt = 0L; - IfInfo[i].multircv = 0L; - IfInfo[i].OLDmultircv = 0L; - IfInfo[i].brdcstxmt = 0L; - IfInfo[i].OLDbrdcstxmt = 0L; - IfInfo[i].brdcstrcv = 0L; - IfInfo[i].OLDbrdcstrcv = 0L; - NetDevCount = ++i; - - /* XXX: need sanity checks! */ - return( 0 ); -} - -/* - * getnetdevlist() -- get a list of all "up" interfaces - */ -int getnetdevlist( void ) { - - int fd; - int buffsize; - int prevsize; - int prevCount; - struct ifconf ifc; - struct ifreq *ifr; - - if( (fd = socket( PF_INET, SOCK_DGRAM, 0 )) < 0 ) { - return( -1 ); - } - - /* - * get the interface list via iotl( SIOCGIFCONF ) - * the following algorithm based on ideas from W.R. Stevens' - * "UNIX Network Programming", Vol. 1: - * Since the ioctl may return 0, indicating success, even if the - * ifreq buffer was too small, we have to make sure, it didn't - * get truncated by comparing our initial size guess with the - * actual returned size. - */ - prevsize = 0; - buffsize = NBUFFERS * sizeof( struct ifreq ); - while( 1 ) { - if( (ifc.ifc_buf = malloc( buffsize )) == NULL ) - return( -1 ); - - ifc.ifc_len = buffsize; - if( ioctl( fd, SIOCGIFCONF, &ifc ) < 0 ) { - if( errno != EINVAL || prevsize != 0 ) { - free( ifc.ifc_buf ); - return( -1 ); - } - } else { - if( ifc.ifc_len == prevsize ) - /* success */ - break; - prevsize = ifc.ifc_len; - } - /* - * initial buffer guessed too small, allocate a bigger one - */ - free( ifc.ifc_buf ); - buffsize = (NBUFFERS + 10) * sizeof( struct ifreq ); - } - - /* - * get the names for all interfaces which are configured "up" - * we're not interested in the ifc data (address), so we reuse the - * same structure (with ifc.len set) for the next ioctl() - */ - prevCount = NetDevCount; - for( ifr = (struct ifreq *) ifc.ifc_buf; - ifr < (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - ifr++ ) { - if( ioctl( fd, SIOCGIFFLAGS, ifr ) < 0 ) { - free( ifc.ifc_buf ); - return( -1 ); - } - if( ifr->ifr_flags & IFF_UP ) - insertnetdev( ifr->ifr_name, ifr->ifr_flags ); - } - free( ifc.ifc_buf ); - close( fd ); - - if( (prevCount > 0) && (prevCount != NetDevCount) ) { - print_error( "RECONFIGURE\n" ); - prevCount = NetDevCount; - } - - return( NetDevCount ); -} - -void initNetDev( struct SensorModul* sm ) { -#ifdef HAVE_KSTAT - char mon[128]; - int i; - - getnetdevlist(); - for( i = 0; i < NetDevCount; i++ ) { - sprintf( mon, "network/%s/ipackets", IfInfo[i].Name ); - registerMonitor( mon, "integer", - printIPackets, printIPacketsInfo, sm ); - sprintf( mon, "network/%s/opackets", IfInfo[i].Name ); - registerMonitor( mon, "integer", - printOPackets, printOPacketsInfo, sm ); - /* - * if this isn't a loopback interface, - * register additional monitors - */ - if( ! (IfInfo[i].flags & IFF_LOOPBACK) ) { - /* - * recv errors - */ - sprintf( mon, "network/%s/ierrors", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printIErrors, printIErrorsInfo, sm ); - /* - * xmit errors - */ - sprintf( mon, "network/%s/oerrors", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printOErrors, printOErrorsInfo, sm ); - /* - * collisions - */ - sprintf( mon, "network/%s/collisions", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printCollisions, printCollisionsInfo, sm ); - /* - * multicast xmits - */ - sprintf( mon, "network/%s/multixmt", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printMultiXmits, printMultiXmitsInfo, sm ); - /* - * multicast recvs - */ - sprintf( mon, "network/%s/multircv", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printMultiRecvs, printMultiRecvsInfo, sm ); - /* - * broadcast xmits - */ - sprintf( mon, "network/%s/brdcstxmt", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printBcastXmits, printBcastXmitsInfo, sm ); - /* - * broadcast recvs - */ - sprintf( mon, "network/%s/brdcstrcv", - IfInfo[i].Name ); - registerMonitor( mon, "integer", - printBcastRecvs, printBcastRecvsInfo, sm ); - } - } -#endif -} - -void exitNetDev( void ) { -} - -int updateNetDev( void ) { - -#ifdef HAVE_KSTAT - kstat_ctl_t *kctl; - kstat_t *ksp; - kstat_named_t *kdata; - int i; - - /* - * get a kstat handle and update the user's kstat chain - */ - if( (kctl = kstat_open()) == NULL ) - return( 0 ); - while( kstat_chain_update( kctl ) != 0 ) - ; - - for( i = 0; i < NetDevCount; i++ ) { - char *name; - char *ptr; - - /* - * chop off the trailing interface no - */ - name = strdup( IfInfo[i].Name ); - ptr = name + strlen( name ) - 1; - while( (ptr > name) && isdigit( (int) *ptr ) ) { - *ptr = '\0'; - ptr--; - } - - /* - * traverse the kstat chain - * to find the appropriate statistics - */ - if( (ksp = kstat_lookup( kctl, - name, 0, IfInfo[i].Name )) == NULL ) { - free( name ); - return( 0 ); - } - if( kstat_read( kctl, ksp, NULL ) == -1 ) { - free( name ); - return( 0 ); - } - free( name ); - - /* - * lookup & store the data - */ - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ipackets" ); - if( kdata != NULL ) { - IfInfo[i].OLDipackets = IfInfo[i].ipackets; - IfInfo[i].ipackets = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "opackets" ); - if( kdata != NULL ) { - IfInfo[i].OLDopackets = IfInfo[i].opackets; - IfInfo[i].opackets = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "ierrors" ); - if( kdata != NULL ) { - IfInfo[i].OLDierrors = IfInfo[i].ierrors; - IfInfo[i].ierrors = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "oerrors" ); - if( kdata != NULL ) { - IfInfo[i].OLDoerrors = IfInfo[i].oerrors; - IfInfo[i].oerrors = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "collisions" ); - if( kdata != NULL ) { - IfInfo[i].OLDcollisions = IfInfo[i].collisions; - IfInfo[i].collisions = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "multixmt" ); - if( kdata != NULL ) { - IfInfo[i].OLDmultixmt = IfInfo[i].multixmt; - IfInfo[i].multixmt = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "multircv" ); - if( kdata != NULL ) { - IfInfo[i].OLDmultircv = IfInfo[i].multircv; - IfInfo[i].multircv = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "brdcstxmt" ); - if( kdata != NULL ) { - IfInfo[i].OLDbrdcstxmt = IfInfo[i].brdcstxmt; - IfInfo[i].brdcstxmt = kdata->value.ul; - } - kdata = (kstat_named_t *) kstat_data_lookup( ksp, "brdcstrcv" ); - if( kdata != NULL ) { - IfInfo[i].OLDbrdcstrcv = IfInfo[i].brdcstrcv; - IfInfo[i].brdcstrcv = kdata->value.ul; - } - } - - kstat_close( kctl ); -#endif /* ! HAVE_KSTAT */ - - return( 0 ); -} - -void printIPacketsInfo( const char *cmd ) { - fprintf(CurrentClient, "Received Packets\t0\t0\tPackets\n" ); -} - -void printIPackets( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDipackets > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].ipackets - IfInfo[i].OLDipackets); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printOPacketsInfo( const char *cmd ) { - fprintf(CurrentClient, "Transmitted Packets\t0\t0\tPackets\n" ); -} - -void printOPackets( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDopackets > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].opackets - IfInfo[i].OLDopackets ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printIErrorsInfo( const char *cmd ) { - fprintf(CurrentClient, "Input Errors\t0\t0\tPackets\n" ); -} - -void printIErrors( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDierrors > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].ierrors - IfInfo[i].OLDierrors ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printOErrorsInfo( const char *cmd ) { - fprintf(CurrentClient, "Output Errors\t0\t0\tPackets\n" ); -} - -void printOErrors( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDoerrors > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].oerrors - IfInfo[i].OLDoerrors ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printCollisionsInfo( const char *cmd ) { - fprintf(CurrentClient, "Collisions\t0\t0\tPackets\n" ); -} - -void printCollisions( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDcollisions > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].collisions - IfInfo[i].OLDcollisions ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printMultiXmitsInfo( const char *cmd ) { - fprintf(CurrentClient, "Multicasts Sent\t0\t0\tPackets\n" ); -} - -void printMultiXmits( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDmultixmt > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].multixmt - IfInfo[i].OLDmultixmt ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printMultiRecvsInfo( const char *cmd ) { - fprintf(CurrentClient, "Multicasts Received\t0\t0\tPackets\n" ); -} - -void printMultiRecvs( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDmultircv > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].multircv - IfInfo[i].OLDmultircv ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printBcastXmitsInfo( const char *cmd ) { - fprintf(CurrentClient, "Broadcasts Sent\t0\t0\tPackets\n" ); -} - -void printBcastXmits( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDbrdcstxmt > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].brdcstxmt - IfInfo[i].OLDbrdcstxmt ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} - -void printBcastRecvsInfo( const char *cmd ) { - fprintf(CurrentClient, "Broadcasts Received\t0\t0\tPackets\n" ); -} - -void printBcastRecvs( const char *cmd ) { - - char *cmdcopy = strdup( cmd ); - char *name, *ptr; - int i; - - ptr = strchr( cmdcopy, (int) '/' ); - name = ++ptr; - ptr = strchr( name, (int) '/' ); - *ptr = '\0'; - - for( i = 0; i < NetDevCount; i++ ) { - if( (IfInfo[i].OLDbrdcstrcv > 0) - && (strcmp( IfInfo[i].Name, name ) == 0) ) { - fprintf(CurrentClient, "%ld\n", - IfInfo[i].brdcstrcv - IfInfo[i].OLDbrdcstrcv ); - free( cmdcopy ); - return; - } - } - free( cmdcopy ); - fprintf(CurrentClient, "0\n" ); -} diff --git a/ksysguard/ksysguardd/Tru64/NetDev.h b/ksysguard/ksysguardd/Tru64/NetDev.h deleted file mode 100644 index b6ff54448..000000000 --- a/ksysguard/ksysguardd/Tru64/NetDev.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - KSysGuard, the KDE System Guard - - Copyright (c) 1999 Chris Schlaeger <cs@kde.org> - - Solaris support by Torsten Kasch <tk@Genetik.Uni-Bielefeld.DE> - - This program 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 of the License, or - (at your option) any later version. - - This program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -*/ - -#ifndef _NetDev_h_ -#define _NetDev_h_ - -void initNetDev(struct SensorModul* sm); -void exitNetDev(void); - -int updateNetDev(void); - -void printIPacketsInfo( const char *cmd ); -void printIPackets( const char *cmd ); - -void printOPacketsInfo( const char *cmd ); -void printOPackets( const char *cmd ); - -void printIErrorsInfo( const char *cmd ); -void printIErrors( const char *cmd ); - -void printOErrorsInfo( const char *cmd ); -void printOErrors( const char *cmd ); - -void printCollisionsInfo( const char *cmd ); -void printCollisions( const char *cmd ); - -void printMultiXmitsInfo( const char *cmd ); -void printMultiXmits( const char *cmd ); - -void printMultiRecvsInfo( const char *cmd ); -void printMultiRecvs( const char *cmd ); - -void printBcastXmitsInfo( const char *cmd ); -void printBcastXmits( const char *cmd ); - -void printBcastRecvsInfo( const char *cmd ); -void printBcastRecvs( const char *cmd ); - -#endif /* _NetDev_h */ diff --git a/ksysguard/ksysguardd/modules.h b/ksysguard/ksysguardd/modules.h index e92bca5e4..b9a8a4f92 100644 --- a/ksysguard/ksysguardd/modules.h +++ b/ksysguard/ksysguardd/modules.h @@ -75,14 +75,6 @@ #include "ProcessList.h" #endif /* OSTYPE_Solaris */ -#ifdef OSTYPE_Irix -#include "LoadAvg.h" -#include "Memory.h" -#include "NetDev.h" -#include "ProcessList.h" -#include "cpu.h" -#endif /* OSTYPE_Irix */ - #ifdef OSTYPE_OpenBSD #include "cpu.h" #include "memory.h" @@ -147,14 +139,6 @@ struct SensorModul SensorModulList[] = { { "ProcessList", initProcessList, exitProcessList, updateProcessList, NULLVVFUNC, 0, NULLTIME }, #endif /* OSTYPE_Solaris */ -#ifdef OSTYPE_Irix - { "CpuInfo", initCpuInfo, exitCpuInfo, updateCpuInfo, NULLVVFUNC, 0, NULLTIME }, - { "LoadAvg", initLoadAvg, exitLoadAvg, updateLoadAvg, NULLVVFUNC, 0, NULLTIME }, - { "Memory", initMemory, exitMemory, updateMemory, NULLVVFUNC, 0, NULLTIME }, - { "NetDev", initNetDev, exitNetDev, updateNetDev, NULLVVFUNC, 0, NULLTIME }, - { "ProcessList", initProcessList, exitProcessList, updateProcessList, NULLVVFUNC, 0, NULLTIME }, -#endif /* OSTYPE_Irix */ - #ifdef OSTYPE_OpenBSD { "CpuInfo", initCpuInfo, exitCpuInfo, updateCpuInfo, NULLVVFUNC, 0, NULLTIME }, { "Memory", initMemory, exitMemory, updateMemory, NULLVVFUNC, 0, NULLTIME }, |
