pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/benchmarks/blogbench Add patches to support a new flag:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/861481862700
branches:  trunk
changeset: 520105:861481862700
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Sun Oct 15 12:53:04 2006 +0000

description:
Add patches to support a new flag:

        --directio or -o (if enabled uses O_DIRECT in open(2)).

Useful to test performance of Direct I/O implementation on NetBSD.

Bump PKGREVISION.

diffstat:

 benchmarks/blogbench/Makefile         |   3 ++-
 benchmarks/blogbench/distinfo         |   8 +++++++-
 benchmarks/blogbench/patches/patch-aa |  12 ++++++++++++
 benchmarks/blogbench/patches/patch-ab |  21 +++++++++++++++++++++
 benchmarks/blogbench/patches/patch-ac |  22 ++++++++++++++++++++++
 benchmarks/blogbench/patches/patch-ad |  20 ++++++++++++++++++++
 benchmarks/blogbench/patches/patch-ae |  13 +++++++++++++
 benchmarks/blogbench/patches/patch-af |  13 +++++++++++++
 8 files changed, 110 insertions(+), 2 deletions(-)

diffs (154 lines):

diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/Makefile
--- a/benchmarks/blogbench/Makefile     Sun Oct 15 12:41:21 2006 +0000
+++ b/benchmarks/blogbench/Makefile     Sun Oct 15 12:53:04 2006 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2006/03/04 21:29:01 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2006/10/15 12:53:04 xtraeme Exp $
 #
 
 DISTNAME=      blogbench-1.0
+PKGREVISION=   1
 CATEGORIES=    benchmarks
 MASTER_SITES=  ftp://ftp.blogbench.pureftpd.org/blogbench/
 EXTRACT_SUFX=  .tar.bz2
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/distinfo
--- a/benchmarks/blogbench/distinfo     Sun Oct 15 12:41:21 2006 +0000
+++ b/benchmarks/blogbench/distinfo     Sun Oct 15 12:53:04 2006 +0000
@@ -1,5 +1,11 @@
-$NetBSD: distinfo,v 1.2 2005/02/22 21:16:35 agc Exp $
+$NetBSD: distinfo,v 1.3 2006/10/15 12:53:04 xtraeme Exp $
 
 SHA1 (blogbench-1.0.tar.bz2) = 3e667bc9ebfee8751c28508a1840a10b9bdfc099
 RMD160 (blogbench-1.0.tar.bz2) = b688e83c06d45986d592a4fc6a6f5f59ade3da7a
 Size (blogbench-1.0.tar.bz2) = 103355 bytes
+SHA1 (patch-aa) = 77c48f0e50aeeec341d7d127564839f526a86e1f
+SHA1 (patch-ab) = 9db1070408e2afd12272e01a62d5ea8f2802c1df
+SHA1 (patch-ac) = 72ce26dc25b1c2adf9b6d8835852c6ff7ddc1d84
+SHA1 (patch-ad) = e353b458af302aa0f9afd8811d11aafb3ed19010
+SHA1 (patch-ae) = 01b8dcb0641941d70dd056ae2026b83fb16be954
+SHA1 (patch-af) = 8c16af43c281d28446dc2b976662c64b02cf3269
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-aa     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-aa,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/globals.h.orig 2006-10-15 13:01:57.000000000 +0200
++++ src/globals.h      2006-10-15 13:02:42.000000000 +0200
+@@ -41,4 +41,7 @@
+ GLOBAL(unsigned int sleep_stats, DEFAULT_SLEEP_STATS);
+ GLOBAL(unsigned int nb_writers, DEFAULT_NB_WRITERS);
+ 
++/* O_DIRECT aka Direct I/O */
++GLOBAL(unsigned int do_directio, DEFAULT_DIRECTIO);
++
+ #endif
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-ab     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-ab,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/blogbench_p.h.orig     2006-10-15 13:08:03.000000000 +0200
++++ src/blogbench_p.h  2006-10-15 13:08:32.000000000 +0200
+@@ -1,7 +1,7 @@
+ #ifndef __BLOGBENCH_P_H__
+ #define __BLOGBENCH_P_H__ 1
+ 
+-static const char *GETOPT_OPTIONS = "c:d:hi:r:W:s:w:";
++static const char *GETOPT_OPTIONS = "c:d:hi:or:W:s:w:";
+ 
+ static struct option long_options[] = {
+     { "commenters", 1, NULL, 'c' },
+@@ -12,6 +12,7 @@
+     { "rewriters", 0, NULL, 'W' },
+     { "sleep", 1, NULL, 's' },
+     { "writers", 1, NULL, 'w' },
++    { "directio", 0, NULL, 'o' },
+     { NULL, 0, NULL, 0 }
+ };
+ 
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-ac     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-ac,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/blogbench.c.orig       2006-10-15 13:09:33.000000000 +0200
++++ src/blogbench.c    2006-10-15 13:10:39.000000000 +0200
+@@ -19,6 +19,7 @@
+         "--rewriters=<n> (-W <n>): number of rewriters\n"
+         "--sleep=<secs> (-s <secs>): delay after every iteration\n"
+         "--writers=<n> (-w <n>): number of writers\n"
++        "--directio (-o): enable Direct I/O\n"
+         "\n"
+         "Sample usage:\n"
+         "\n"
+@@ -56,6 +57,9 @@
+       case 'i':
+           stats_iterations = (unsigned int) strtoul(optarg, NULL, 10);
+           break;
++      case 'o':
++          do_directio = 1;
++          break;
+       case 'r':
+           nb_readers = (unsigned int) strtoul(optarg, NULL, 10);
+           break;
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-ad     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,20 @@
+$NetBSD: patch-ad,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/helpers.c.orig 2005-02-11 15:46:26.000000000 +0100
++++ src/helpers.c      2006-10-15 13:25:58.000000000 +0200
+@@ -49,8 +49,13 @@
+     ssize_t written;    
+     int fd;
+     
+-    if ((fd = open(file_name, O_CREAT | O_TRUNC | O_WRONLY,
+-                 (mode_t) 0600)) == -1) {
++    if (do_directio)
++         fd = open(file_name, O_CREAT|O_TRUNC|O_WRONLY|O_DIRECT,
++                  (mode_t)0600);
++    else
++         fd = open(file_name, O_CREAT|O_TRUNC|O_WRONLY, (mode_t)0600);
++
++    if (fd == -1) {
+       if (errno != ENOENT) {      
+           reentrant_printf("open(\"%s\"): %s\n",
+                            file_name, strerror(errno));
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-ae     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/blogbench.h.orig       2006-10-15 13:18:13.000000000 +0200
++++ src/blogbench.h    2006-10-15 13:18:27.000000000 +0200
+@@ -104,6 +104,8 @@
+ #define DEFAULT_NB_READERS 100
+ #define DEFAULT_NB_COMMENTERS 5
+ 
++#define DEFAULT_DIRECTIO 0
++
+ #define USLEEP_WRITERS 10000
+ #define USLEEP_REWRITERS 1000000
+ #define USLEEP_READERS 0
diff -r 5477eb7cdd07 -r 861481862700 benchmarks/blogbench/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/blogbench/patches/patch-af     Sun Oct 15 12:53:04 2006 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1 2006/10/15 12:53:04 xtraeme Exp $
+
+--- src/process.c.orig 2005-02-11 22:32:46.000000000 +0100
++++ src/process.c      2006-10-15 14:44:32.000000000 +0200
+@@ -138,6 +138,8 @@
+                    "Frequency = %u secs\n"
+                    "Scratch dir = [%s]\n",
+                    sleep_stats, scratch_dir);
++    reentrant_printf("Direct I/O: %s\n", do_directio ? "enabled" : "disabled");
++
+     if (chdir(scratch_dir) != 0) {
+       reentrant_printf("Unable to enter the scratch dir [%s]: [%s]\n",
+                        scratch_dir, strerror(errno));



Home | Main Index | Thread Index | Old Index