diff options
author | Christian Birchinger <joker@gentoo.org> | 2004-05-22 03:04:35 +0000 |
---|---|---|
committer | Christian Birchinger <joker@gentoo.org> | 2004-05-22 03:04:35 +0000 |
commit | 62ebd1c98761e8fb468666b6c2d4839d5956f6dd (patch) | |
tree | 61133f0269cf4ba1d1455be628136bb4a76f1db4 /x11-plugins/wmmon | |
parent | Initial verison. (Manifest recommit) (diff) | |
download | gentoo-2-62ebd1c98761e8fb468666b6c2d4839d5956f6dd.tar.gz gentoo-2-62ebd1c98761e8fb468666b6c2d4839d5956f6dd.tar.bz2 gentoo-2-62ebd1c98761e8fb468666b6c2d4839d5956f6dd.zip |
Added a patch to make memory monitoring work with kernel 2.6
Diffstat (limited to 'x11-plugins/wmmon')
-rw-r--r-- | x11-plugins/wmmon/ChangeLog | 10 | ||||
-rw-r--r-- | x11-plugins/wmmon/files/digest-wmmon-1.0_beta2-r2 | 1 | ||||
-rw-r--r-- | x11-plugins/wmmon/files/wmmon-1.0_beta2-kernel26.patch | 121 | ||||
-rw-r--r-- | x11-plugins/wmmon/wmmon-1.0_beta2-r2.ebuild | 33 |
4 files changed, 163 insertions, 2 deletions
diff --git a/x11-plugins/wmmon/ChangeLog b/x11-plugins/wmmon/ChangeLog index d3bde1682c72..68e0274ba600 100644 --- a/x11-plugins/wmmon/ChangeLog +++ b/x11-plugins/wmmon/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for x11-plugins/wmmon -# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmmon/ChangeLog,v 1.7 2003/12/06 16:00:06 port001 Exp $ +# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmmon/ChangeLog,v 1.8 2004/05/22 03:04:35 joker Exp $ + +*wmmon-1.0_beta2-r2 (22 May 2004) + + 22 May 2004; Christian Birchinger <joker@gentoo.org> + wmmon-1.0_beta2-r2.ebuild, files/wmmon-1.0_beta2-kernel26.patch: + Added a patch to make memory monitoring work with kernel 2.6 06 Dec 2003; Ian Leitch <port001@gentoo.org> wmmon-1.0_beta2-r1.ebuild: Reverting the block. See #33362 diff --git a/x11-plugins/wmmon/files/digest-wmmon-1.0_beta2-r2 b/x11-plugins/wmmon/files/digest-wmmon-1.0_beta2-r2 new file mode 100644 index 000000000000..aa0d5acf08e0 --- /dev/null +++ b/x11-plugins/wmmon/files/digest-wmmon-1.0_beta2-r2 @@ -0,0 +1 @@ +MD5 1b8c780b8c24a6958c69330fef4171df wmmon-1_0b2.tar.gz 21589 diff --git a/x11-plugins/wmmon/files/wmmon-1.0_beta2-kernel26.patch b/x11-plugins/wmmon/files/wmmon-1.0_beta2-kernel26.patch new file mode 100644 index 000000000000..3b1234b4eb1c --- /dev/null +++ b/x11-plugins/wmmon/files/wmmon-1.0_beta2-kernel26.patch @@ -0,0 +1,121 @@ +diff -ruN wmmon.app.orig/wmmon/Makefile wmmon.app/wmmon/Makefile +--- wmmon.app.orig/wmmon/Makefile 1998-05-19 23:13:16.000000000 +0200 ++++ wmmon.app/wmmon/Makefile 2004-05-22 04:27:19.000000000 +0200 +@@ -5,9 +5,8 @@ + ../wmgeneral/misc.o \ + ../wmgeneral/list.o + +- + .c.o: +- cc -c -O2 -Wall $< -o $*.o ++ cc -c $(CFLAGS) $(DEFINES) -Wall $< -o $*.o + + wmmon: $(OBJS) + cc -o wmmon $^ $(LIBDIR) $(LIBS) +diff -ruN wmmon.app.orig/wmmon/wmmon.c wmmon.app/wmmon/wmmon.c +--- wmmon.app.orig/wmmon/wmmon.c 1998-05-19 23:13:16.000000000 +0200 ++++ wmmon.app/wmmon/wmmon.c 2004-05-22 04:29:39.000000000 +0200 +@@ -187,8 +187,7 @@ + + void update_stat_cpu(stat_dev *); + void update_stat_io(stat_dev *); +-void update_stat_mem(stat_dev *st, stat_dev *st2); +-void update_stat_swp(stat_dev *); ++void update_stat_mem_k26(stat_dev *st, stat_dev *st2); + + void wmmon_routine(int argc, char **argv) { + +@@ -297,8 +296,7 @@ + update_stat_io(&stat_device[1]); + + if(stat_current == 2) { +- update_stat_mem(&stat_device[2], &stat_device[3]); +-// update_stat_swp(&stat_device[3]); ++ update_stat_mem_k26(&stat_device[2], &stat_device[3]); + } + + if (stat_current < 2) { +@@ -497,47 +495,56 @@ + st->hisaddcnt += 1; + } + +-void update_stat_mem(stat_dev *st, stat_dev *st2) { ++void update_stat_mem_k26(stat_dev *st, stat_dev *st2) { + + char temp[128]; +- unsigned long free, shared, buffers, cached; ++ unsigned long free, shared, buffers, cached, swap_free; + + freopen("/proc/meminfo", "r", fp_meminfo); + while (fgets(temp, 128, fp_meminfo)) { +- if (strstr(temp, "Mem:")) { +- sscanf(temp, "Mem: %ld %ld %ld %ld %ld %ld", +- &st->rt_idle, &st->rt_stat, +- &free, &shared, &buffers, &cached); +- st->rt_idle >>= 10; +- st->rt_stat -= buffers+cached; +- st->rt_stat >>= 10; +-// break; ++ if (strstr(temp, "MemTotal:")) { ++ sscanf(temp, "MemTotal: %ld", &st->rt_idle); ++ continue; + } +- if (strstr(temp, "Swap:")) { +- sscanf(temp, "Swap: %ld %ld", &st2->rt_idle, &st2->rt_stat); +- st2->rt_idle >>= 10; +- st2->rt_stat >>= 10; +- break; ++ if (strstr(temp, "MemFree:")) { ++ sscanf(temp, "MemFree: %ld", &free); ++ continue; ++ } ++ if (strstr(temp, "Buffers:")) { ++ sscanf(temp, "Buffers: %ld", &buffers); ++ continue; ++ } ++ if (strstr(temp, "Cached:")) { ++ sscanf(temp, "Cached: %ld", &cached); ++ continue; ++ } ++ ++ if (strstr(temp, "SwapTotal:")) { ++ sscanf(temp, "SwapTotal: %ld", &st2->rt_idle); ++ continue; ++ } ++ if (strstr(temp, "SwapFree:")) { ++ sscanf(temp, "SwapFree: %ld", &swap_free); ++ continue; + } + } +-} + +-void update_stat_swp(stat_dev *st) { ++ // used = total - free; ++ st->rt_stat = st->rt_idle - free; ++ st2->rt_stat = st2->rt_idle - swap_free; + +- char temp[128]; ++ // ignore shared ++ shared = 0; + +- fseek(fp_meminfo, 0, SEEK_SET); +- while (fgets(temp, 128, fp_meminfo)) { +- if (strstr(temp, "Swap:")) { +- sscanf(temp, "Swap: %ld %ld", &st->rt_idle, &st->rt_stat); +- st->rt_idle >>= 10; +- st->rt_stat >>= 10; +- break; +- } +- } ++ st->rt_idle >>= 10; ++ st->rt_stat -= buffers+cached; ++ st->rt_stat >>= 10; + ++ st2->rt_idle >>= 10; ++ st2->rt_stat >>= 10; + } + ++ + /*******************************************************************************\ + |* get_statistics *| + \*******************************************************************************/ diff --git a/x11-plugins/wmmon/wmmon-1.0_beta2-r2.ebuild b/x11-plugins/wmmon/wmmon-1.0_beta2-r2.ebuild new file mode 100644 index 000000000000..cc005e81fef6 --- /dev/null +++ b/x11-plugins/wmmon/wmmon-1.0_beta2-r2.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmmon/wmmon-1.0_beta2-r2.ebuild,v 1.1 2004/05/22 03:04:35 joker Exp $ + +inherit eutils + +S="${WORKDIR}/${PN}.app" +IUSE="" +DESCRIPTION="Dockable system resources monitor applette for WindowMaker" +WMMON_VERSION=1_0b2 +SRC_URI="http://rpig.dyndns.org/~anstinus/Linux/${PN}-${WMMON_VERSION}.tar.gz" +HOMEPAGE="http://www.bensinclair.com/dockapp/" + +DEPEND="virtual/x11" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~x86 ~sparc ~amd64" + +src_unpack() { + unpack ${A} ; cd ${S}/${PN} + epatch ${FILESDIR}/${P}-kernel26.patch + sed -i -e "s|-O2|${CFLAGS}|" Makefile +} + +src_compile() { + emake -C ${PN} || die +} + +src_install () { + dobin wmmon/wmmon + dodoc BUGS CHANGES COPYING HINTS INSTALL README TODO +} |