Subject: kdeutils3
To: None <tech-pkg@netbsd.org>
From: Ron Roskens <roskens@elfin.net>
List: tech-pkg
Date: 12/01/2003 14:06:37
--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Can someout out there with a multiproc box running NetBSD-current
test out the attached patch for pkgsrc/misc/kdeutils3?

 # cd pkgsrc/misc/kdeutils3/ && patch < kdeutils-3.1.4.diff
 # make install
 # ksim

Ron

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="kdeutils-3.1.4.diff"

Index: distinfo
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/misc/kdeutils3/distinfo,v
retrieving revision 1.16
diff -B -p -u -r1.16 distinfo
--- distinfo	17 Sep 2003 23:41:36 -0000	1.16
+++ distinfo	1 Dec 2003 19:52:21 -0000
@@ -14,4 +14,4 @@ SHA1 (patch-ak) = a910a9440175c9772c3932
 SHA1 (patch-am) = 1f9931d683654159686151206db4c628253e875e
 SHA1 (patch-an) = ecc14037fad569dc0627c980537bbfa03e4f820c
 SHA1 (patch-ao) = c68f205ab70cd6a5331c052b234c3fe7fb0ad411
-SHA1 (patch-ap) = 7938c4a33fa178740b0d2f704f4aab1b693ee112
+SHA1 (patch-ap) = 18cbffca37808ddf194767b5bd252e41a7c80089
Index: patches/patch-ap
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/misc/kdeutils3/patches/patch-ap,v
retrieving revision 1.1
diff -B -p -u -r1.1 patch-ap
--- patches/patch-ap	11 Mar 2003 13:22:32 -0000	1.1
+++ patches/patch-ap	1 Dec 2003 19:52:09 -0000
@@ -1,14 +1,60 @@
-$NetBSD: patch-ap,v 1.1 2003/03/11 13:22:32 markd Exp $
+$NetBSD$
 
---- ksim/monitors/cpu/ksimcpu.cpp.orig	Tue May 14 02:47:51 2002
-+++ ksim/monitors/cpu/ksimcpu.cpp
-@@ -269,6 +269,9 @@ void CpuView::updateCpu(CpuData &cpu, in
+--- ksim/monitors/cpu/ksimcpu.cpp.orig	2003-09-02 06:49:19.000000000 -0500
++++ ksim/monitors/cpu/ksimcpu.cpp	2003-12-01 13:50:07.000000000 -0600
+@@ -57,6 +57,7 @@
+ #include <kvm.h>
+ #ifdef Q_OS_NETBSD
+ #include <sys/sched.h>
++#include <malloc.h>
+ #endif
+ #endif
+ 
+@@ -277,8 +278,45 @@ void CpuView::updateCpu(CpuData &cpu, in
    cpu.idle = cpuTime[CP_IDLE];
  #endif
  
+-#if defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD)
+-#warning "add support for SMP on OpenBSD and NetBSD"
++#if defined(Q_OS_NETBSD) && (__NetBSD_Version__ > 106000000)
++  int mib[2];
++  size_t size;
++  int ncpu = 0;
++  u_int64_t * cpuTime;
++
++  mib[0] = CTL_HW;
++  mib[1] = HW_NCPU;
++  size = sizeof(ncpu);
++  if (sysctl(mib, 2, &ncpu, &size,
++     NULL, 0) < 0)
++    return;
++
++  if (cpuNumber >= ncpu)
++    return;
++
++  cpuTime = (u_int64_t *) malloc(sizeof(cpuTime[0]) * CPUSTATES * ncpu);
++
++  mib[0] = CTL_KERN;
++  mib[1] = KERN_CP_TIME;
++  size = sizeof(cpuTime[0]) * CPUSTATES * ncpu;
++
++  if (sysctl(mib, 2, cpuTime, &size,
++     0, 0) < 0)
++    return;
++
++  cpu.user = cpuTime[CP_USER + (cpuNumber * CPUSTATES)];
++  cpu.nice = cpuTime[CP_NICE + (cpuNumber * CPUSTATES)];
++  cpu.sys  = cpuTime[CP_SYS  + (cpuNumber * CPUSTATES)];
++  cpu.idle = cpuTime[CP_IDLE + (cpuNumber * CPUSTATES)];
++
++#else
++
 +#if defined(Q_OS_NETBSD)
 +#define KERN_CPTIME KERN_CP_TIME
 +#endif
- #if defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD)
- #warning "add support for SMP on OpenBSD and NetBSD"
++#if defined(Q_OS_OPENBSD)
++#warning "add support for SMP on OpenBSD"
++#endif
    int name2oid[2] = { CTL_KERN, KERN_CPTIME };
+   long cpuTime[CPUSTATES];
+   unsigned int cpuTimeLen = sizeof(cpuTime);

--wRRV7LY7NUeQGEoC--