diff options
-rw-r--r-- | doc/kicker-applets/ktimemon.docbook | 12 | ||||
-rw-r--r-- | kicker-applets/ktimemon/README | 11 | ||||
-rw-r--r-- | kicker-applets/ktimemon/sample.cpp | 45 | ||||
-rw-r--r-- | kicker-applets/ktimemon/sample.h | 2 |
4 files changed, 14 insertions, 56 deletions
diff --git a/doc/kicker-applets/ktimemon.docbook b/doc/kicker-applets/ktimemon.docbook index da4958a..da9a4fc 100644 --- a/doc/kicker-applets/ktimemon.docbook +++ b/doc/kicker-applets/ktimemon.docbook @@ -39,10 +39,8 @@ graphical user interface. It also supports <emphasis>docking</emphasis>, <note> <para>Currently, &ktimemon; only supports a limited number of systems: &Linux; based installations with the <filename>/proc</filename> file -system, &Solaris; based installations with the -<filename>kstat</filename> library, and Digital &UNIX; (formerly -DEC/OSF1) based installations with the -<command>table</command>(2) system call. Help with +system and &Solaris; based installations with the +<filename>kstat</filename> library. Help with porting it to other platforms is most welcome. </para> </note> @@ -302,10 +300,8 @@ linkend="fund">Onscreen Fundamentals</link>).</para> <answer> <para> &ktimemon; supports &Linux; based systems with the <filename -class="devicefile">/proc</filename> file system, &Solaris; based -systems with the <filename>kstat</filename> library, and Digital -&UNIX; (formerly DEC/OSF1) systems with the -<command>table</command>(2) system call interface. Only the &Linux; +class="devicefile">/proc</filename> file system and &Solaris; based +systems with the <filename>kstat</filename> library. Only the &Linux; version has been thoroughly tested, if you experience any problems with the &Solaris;/Digital &UNIX; port, please do not hesitate to contact me. diff --git a/kicker-applets/ktimemon/README b/kicker-applets/ktimemon/README index 5bf223f..e5f3777 100644 --- a/kicker-applets/ktimemon/README +++ b/kicker-applets/ktimemon/README @@ -32,21 +32,20 @@ context switch activity. It is well integrated in KDE and can be configured graphically. For more information, see the associated documentation (before installation it can be found in ktimemon/doc/*.html) -KTimemon works on Linux using the /proc filesystem, on Solaris using the -kstat interface, and on Digital Unix (formerly known as DEC/OSF1) using -the table() system call interface. If you can help me to port it to other +KTimemon works on Linux using the /proc filesystem and on Solaris using the +kstat interface. If you can help me to port it to other platforms, please drop me a note! -While I was able to test the system interface on Solaris and DEC/OSF1 in +While I was able to test the system interface on Solaris in isolation, I could not test the whole application for lack of KDE on the machines I have access to. Hence I have no idea whether this thing actually compiles, let alone works on these platforms. The machines I tested -were running DEC/OSF V4.0 and Solaris 2.5.1 respectively. If you get it to +were running Solaris 2.5.1. If you get it to work (or not) on such a system, please let me know! Noteworthy changes from version 0.2: -- Port to DEC/OSF1 and Solaris +- Port to Solaris - Configurable mouse bindings - Slight rearrangement of memory information - Bars can be displayed vertically diff --git a/kicker-applets/ktimemon/sample.cpp b/kicker-applets/ktimemon/sample.cpp index 5864583..a57a7c6 100644 --- a/kicker-applets/ktimemon/sample.cpp +++ b/kicker-applets/ktimemon/sample.cpp @@ -24,9 +24,7 @@ #include <fstream> #include <stdio.h> -#ifdef __osf__ -#include <sys/table.h> -#elif defined(USE_SOLARIS) +#if defined(USE_SOLARIS) #include <kstat.h> #include <sys/sysinfo.h> #include <sys/stat.h> @@ -42,7 +40,7 @@ // -- global definitions ------------------------------------------------- -#if defined(__osf__) || defined(USE_SOLARIS) +#if defined(USE_SOLARIS) extern "C" int getpagesize(); // argh, have to define prototype! #endif @@ -130,7 +128,7 @@ KSample::KSample(KTimeMon *t, bool a, unsigned p, unsigned s, unsigned c) : } #endif -#if defined(USE_SOLARIS) || defined(__osf__) +#if defined(USE_SOLARIS) pagesPerMB = (1024*1024) / getpagesize(); if (pagesPerMB == 0) pagesPerMB = 1; // paranoia sanity check #endif @@ -261,41 +259,6 @@ void KSample::readSample() } sample.cpus = l; -#elif defined(__osf__) // in OSF/2, we can use table() - - TQString msg = i18n("Unable to obtain system information.\n" - "The table(2) system call returned an error " - "for table %1.\n" - "Please contact the maintainer at [email protected] " - "who will try to figure out what went wrong."); - - struct tbl_sysinfo sysinfo; - if (table(TBL_SYSINFO, 0, &sysinfo, 1, sizeof(sysinfo)) != 1) - fatal(msg.arg("TBL_SYSINFO")); - - sample.user = sysinfo.si_user; - sample.nice = sysinfo.si_nice; - sample.kernel = sysinfo.si_sys; - sample.iowait = sysinfo.wait; - sample.idle = sysinfo.si_idle; - - struct tbl_vmstats vmstats; - if (table(TBL_VMSTATS, 0, &vmstats, 1, sizeof(vmstats)) != 1) - fatal(msg.arg("TBL_VMSTATS")); - - sample.mtotal = vmstats.free_count + vmstats.active_count + - vmstats.inactive_count + vmstats.wire_count; - sample.free = vmstats.free_count; - sample.buffers = vmstats.inactive_count; // pages not used for some time - sample.cached = vmstats.wire_count; // kernel/driver memory - - struct tbl_swapinfo swapinfo; - if (table(TBL_SWAPINFO, -1, &swapinfo, 1, sizeof(swapinfo)) != 1) - fatal(msg.arg("TBL_SWAPINFO")); - - sample.stotal = swapinfo.size; - sample.sfree = swapinfo.free; - #elif defined(USE_SOLARIS) kstat_t *ksp; @@ -441,7 +404,7 @@ inline void KSample::makeMBytes(unsigned long &v) { #ifdef __linux__ v /= 1024; // can it be simpler ;-) -#elif defined (__osf__) || defined(USE_SOLARIS) +#elif defined(USE_SOLARIS) v /= pagesPerMB; #endif } diff --git a/kicker-applets/ktimemon/sample.h b/kicker-applets/ktimemon/sample.h index 6ebe77d..2a79ad9 100644 --- a/kicker-applets/ktimemon/sample.h +++ b/kicker-applets/ktimemon/sample.h @@ -80,7 +80,7 @@ private: struct kstat_ctl *kc; bool warned; #endif -#if defined(USE_SOLARIS) || defined(__osf__) +#if defined(USE_SOLARIS) unsigned long pagesPerMB; #endif Sample sample, oldSample; |