]> git.pld-linux.org Git - packages/djbdns.git/commitdiff
- added cachestats.patch, rel 21
authorMarcin Winkler <qurczak@gmail.com>
Tue, 28 Mar 2006 11:43:58 +0000 (11:43 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    djbdns-cachestats.patch -> 1.1
    djbdns.spec -> 1.73

djbdns-cachestats.patch [new file with mode: 0644]
djbdns.spec

diff --git a/djbdns-cachestats.patch b/djbdns-cachestats.patch
new file mode 100644 (file)
index 0000000..9676f07
--- /dev/null
@@ -0,0 +1,89 @@
+#
+# This patch to djbdns 1.05 modifies the dnscache program to keep a
+# counter of cache hits and cache misses.
+#
+# Two new fields are added to the ``stats'' output line:
+#  . the fifth number is the number of cache hits
+#  . the sixth number is the number of cache misses
+# e.g.
+#  @400000003fa92ccc317d70f4 stats 3 1201 1 0 21 49
+# indicates 21 hits and 49 misses.
+#
+# James Raftery <james@now.ie>  6 Nov. 2003
+#
+--- djbdns-1.05.orig/cache.c   Sun Feb 11 21:11:45 2001
++++ djbdns-1.05/cache.c        Wed Nov  5 17:21:06 2003
+@@ -7,6 +7,11 @@
+ uint64 cache_motion = 0;
++/* record cache stats */
++/* James Raftery <james@now.ie> 6 Nov. 2003 */
++uint64 cache_hit = 0;
++uint64 cache_miss = 0;
++
+ static char *x = 0;
+ static uint32 size;
+ static uint32 hsize;
+@@ -112,15 +117,20 @@
+         if (u > size - pos - 20 - keylen) cache_impossible();
+         *datalen = u;
++        cache_hit++;
+         return x + pos + 20 + keylen;
+       }
+     }
+     nextpos = prevpos ^ get4(pos);
+     prevpos = pos;
+     pos = nextpos;
+-    if (++loop > 100) return 0; /* to protect against hash flooding */
++    if (++loop > 100) { /* to protect against hash flooding */
++      cache_miss++;
++      return 0;
++    }
+   }
++  cache_miss++;
+   return 0;
+ }
+--- djbdns-1.05.orig/cache.h   Sun Feb 11 21:11:45 2001
++++ djbdns-1.05/cache.h        Wed Nov  5 17:13:36 2003
+@@ -5,6 +5,12 @@
+ #include "uint64.h"
+ extern uint64 cache_motion;
++
++/* record cache stats */
++/* James Raftery <james@now.ie> 6 Nov. 2003 */
++extern uint64 cache_hit;
++extern uint64 cache_miss;
++
+ extern int cache_init(unsigned int);
+ extern void cache_set(const char *,unsigned int,const char *,unsigned int,uint32);
+ extern char *cache_get(const char *,unsigned int,unsigned int *,uint32 *);
+--- djbdns-1.05.orig/log.c     Sun Feb 11 21:11:45 2001
++++ djbdns-1.05/log.c  Wed Nov  5 17:21:12 2003
+@@ -276,6 +276,12 @@
+ {
+   extern uint64 numqueries;
+   extern uint64 cache_motion;
++
++  /* record cache stats */
++  /* James Raftery <james@now.ie> 6 Nov. 2003 */
++  extern uint64 cache_hit;
++  extern uint64 cache_miss;
++
+   extern int uactive;
+   extern int tactive;
+@@ -283,6 +289,8 @@
+   number(numqueries); space();
+   number(cache_motion); space();
+   number(uactive); space();
+-  number(tactive);
++  number(tactive); space();
++  number(cache_hit); space();
++  number(cache_miss);
+   line();
+ }
index 90568a15d436d2aacf98a41f6bbc57ab0c11a963..a07da8f122a398b0b1b8927e966ef7d58b23331a 100644 (file)
@@ -6,7 +6,7 @@ Summary:        DJB DNS
 Summary(pl):   DJB DNS
 Name:          djbdns
 Version:       1.05
-Release:       20
+Release:       21
 License:       http://cr.yp.to/distributors.html (free to use)
 Group:         Networking/Daemons
 Source0:       http://cr.yp.to/djbdns/%{name}-%{version}.tar.gz
@@ -30,6 +30,8 @@ Patch6:               %{name}-rbldns_a.patch
 # http://core.segfault.pl/~hobbit/tinydns-include.patch
 Patch8:                %{name}-tinydns-include.patch
 Patch9:                %{name}-tinydns-log-ipv6.patch
+# http://romana.now.ie/software/djbdns-cachestats.patch
+Patch10:       %{name}-cachestats.patch
 URL:           http://cr.yp.to/djbdns.html
 BuildRequires: rpm-perlprov
 BuildRequires: rpmbuild(macros) >= 1.202
@@ -344,6 +346,7 @@ install %{SOURCE4} .
 %patch6 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 cd doc
 ln -s merge/djbdns/* .
 
This page took 0.086254 seconds and 4 git commands to generate.