pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xfce4-diskperf-plugin Apply io_sysctl patch b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/007d1758faa9
branches:  trunk
changeset: 515395:007d1758faa9
user:      martti <martti%pkgsrc.org@localhost>
date:      Sun Jul 02 10:13:11 2006 +0000

description:
Apply io_sysctl patch by Kibum Han (pkg/33772)

diffstat:

 sysutils/xfce4-diskperf-plugin/distinfo         |   3 +-
 sysutils/xfce4-diskperf-plugin/patches/patch-aa |  84 +++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 1 deletions(-)

diffs (99 lines):

diff -r adba5f2435e6 -r 007d1758faa9 sysutils/xfce4-diskperf-plugin/distinfo
--- a/sysutils/xfce4-diskperf-plugin/distinfo   Sun Jul 02 10:12:52 2006 +0000
+++ b/sysutils/xfce4-diskperf-plugin/distinfo   Sun Jul 02 10:13:11 2006 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.4 2005/02/24 13:40:59 agc Exp $
+$NetBSD: distinfo,v 1.5 2006/07/02 10:13:11 martti Exp $
 
 SHA1 (xfce4-diskperf-plugin-1.5.tar.gz) = 1c1f2bea61d48c5a5ac25dd072d5734af0491854
 RMD160 (xfce4-diskperf-plugin-1.5.tar.gz) = 2eeb070aeb2be2b53ff57e86f684c9d430d637ab
 Size (xfce4-diskperf-plugin-1.5.tar.gz) = 226767 bytes
+SHA1 (patch-aa) = 86a3cabe41c9470716f82000e41e6d9b64f6d372
diff -r adba5f2435e6 -r 007d1758faa9 sysutils/xfce4-diskperf-plugin/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xfce4-diskperf-plugin/patches/patch-aa   Sun Jul 02 10:13:11 2006 +0000
@@ -0,0 +1,84 @@
+$NetBSD: patch-aa,v 1.3 2006/07/02 10:13:11 martti Exp $
+
+--- panel-plugin/devperf.c.orig        2003-11-30 12:58:54.000000000 +0200
++++ panel-plugin/devperf.c     2006-07-02 10:05:44.000000000 +0300
+@@ -264,21 +264,39 @@
+       const char     *device = (const char *) p_pvDevice;
+       struct timeval tv;
+       size_t size, i, ndrives;
++#ifdef HW_DISKSTATS
+       struct disk_sysctl *drives, drive;
++#else
++      struct io_sysctl *drives, drive;
++#endif
+       int mib[3];
+ 
+       mib[0] = CTL_HW;
++#ifdef HW_DISKSTATS
+       mib[1] = HW_DISKSTATS;
+       mib[2] = sizeof(struct disk_sysctl);
++#else
++      mib[1] = HW_IOSTATS;
++      mib[2] = sizeof(struct io_sysctl);
++#endif
++
+       if (sysctl(mib, 3, NULL, &size, NULL, 0) == -1)
+               return(-1);
++#ifdef HW_DISKSTATS
+       ndrives = size / sizeof(struct disk_sysctl);
++#else
++      ndrives = size / sizeof(struct io_sysctl);
++#endif
+       drives = malloc(size);
+       if (sysctl(mib, 3, drives, &size, NULL, 0) == -1)
+               return(-1);
+ 
+       for (i = 0; i < ndrives; i++) {
++#ifdef HW_DISKSTATS
+               if (strcmp(drives[i].dk_name, device) == 0) {
++#else
++              if (strcmp(drives[i].name, device) == 0) {
++#endif
+                       drive = drives[i];
+                       break;
+               }
+@@ -292,13 +310,18 @@
+       gettimeofday (&tv, 0);
+       perf->timestamp_ns = (uint64_t)1000ull * 1000ull * 1000ull *
+               tv.tv_sec + 1000ull * tv.tv_usec;
+-#if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 106110000)
++#ifdef HW_DISKSTATS
++# if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 106110000)
+   /* NetBSD < 1.6K does not have separate read/write statistics. */
+       perf->rbytes = drive.dk_bytes;
+       perf->wbytes = drive.dk_bytes;
+-#else
++# else
+       perf->rbytes = drive.dk_rbytes;
+       perf->wbytes = drive.dk_wbytes;
++# endif
++#else
++      perf->rbytes = drive.rbytes;
++      perf->wbytes = drive.wbytes;
+ #endif
+ 
+   /*
+@@ -306,10 +329,18 @@
+    * time separatly.
+    *                                              -- Benedikt
+    */
++#ifdef HW_DISKSTATS
+   perf->qlen = drive.dk_xfer;
+       perf->rbusy_ns = ((uint64_t)1000ull * 1000ull * 1000ull * drive.dk_time_sec
+     + 1000ull * drive.dk_time_usec) / 2ull;
+   perf->wbusy_ns = perf->rbusy_ns;
++#else
++  perf->qlen = drive.xfer;
++      perf->rbusy_ns = ((uint64_t)1000ull * 1000ull * 1000ull * drive.time_sec
++    + 1000ull * drive.time_usec) / 2ull;
++  perf->wbusy_ns = perf->rbusy_ns;
++
++#endif
+ 
+       return(0);
+ }



Home | Main Index | Thread Index | Old Index