Source-Changes-HG archive

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

[src/trunk]: src reapply some fixes to make multi-threaded ctfmerge work



details:   https://anonhg.NetBSD.org/src/rev/856a82a02f6d
branches:  trunk
changeset: 339218:856a82a02f6d
user:      chs <chs%NetBSD.org@localhost>
date:      Mon Jul 06 00:21:51 2015 +0000

description:
reapply some fixes to make multi-threaded ctfmerge work
that were lost in the overzealous resync with freebsd.
remove the hacks which were applied to work around those problems.

diffstat:

 external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c |  17 ++++++++---------
 share/mk/sys.mk                                   |   5 ++---
 2 files changed, 10 insertions(+), 12 deletions(-)

diffs (76 lines):

diff -r 88ba983f55cc -r 856a82a02f6d external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c
--- a/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c Sun Jul 05 22:07:09 2015 +0000
+++ b/external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c Mon Jul 06 00:21:51 2015 +0000
@@ -177,7 +177,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE /* XXX TBD fix this */
 #include <unistd.h>
+#undef _NETBSD_SOURCE
+#else
+#include <unistd.h>
+#endif
 #include <pthread.h>
 #include <assert.h>
 #if defined(sun)
@@ -208,12 +214,7 @@
 #pragma init(bigheap)
 
 #define        MERGE_PHASE1_BATCH_SIZE         8
-#if 0
-// XXX: bug?
 #define        MERGE_PHASE1_MAX_SLOTS          5
-#else
-#define        MERGE_PHASE1_MAX_SLOTS          1
-#endif
 #define        MERGE_INPUT_THROTTLE_LEN        10
 
 const char *progname;
@@ -686,6 +687,7 @@
 
        for (i = 0; i < nslots; i++) {
                pthread_mutex_init(&wq->wq_wip[i].wip_lock, NULL);
+               pthread_cond_init(&wq->wq_wip[i].wip_cv, NULL);
                wq->wq_wip[i].wip_batchid = wq->wq_next_batchid++;
        }
 
@@ -789,7 +791,7 @@
                debug_level = atoi(getenv("CTFMERGE_DEBUG_LEVEL"));
 
        err = 0;
-       while ((c = getopt(argc, argv, ":cd:D:fgl:L:o:tvw:sS:")) != EOF) {
+       while ((c = getopt(argc, argv, ":cd:D:fgl:L:o:tvw:s")) != EOF) {
                switch (c) {
                case 'c':
                        docopy = 1;
@@ -837,9 +839,6 @@
                        /* use the dynsym rather than the symtab */
                        dynsym = CTF_USE_DYNSYM;
                        break;
-               case 'S':
-                       maxslots = atoi(optarg);
-                       break;
                default:
                        usage();
                        exit(2);
diff -r 88ba983f55cc -r 856a82a02f6d share/mk/sys.mk
--- a/share/mk/sys.mk   Sun Jul 05 22:07:09 2015 +0000
+++ b/share/mk/sys.mk   Mon Jul 06 00:21:51 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: sys.mk,v 1.127 2014/08/10 05:57:31 matt Exp $
+#      $NetBSD: sys.mk,v 1.128 2015/07/06 00:21:51 chs Exp $
 #      @(#)sys.mk      8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -46,8 +46,7 @@
 
 # C Type Format data is required for DTrace
 CTFFLAGS       ?=      -g -L VERSION
-# Use only one thread for now.
-CTFMFLAGS      ?=      -S 1 -g -t -L VERSION
+CTFMFLAGS      ?=      -t -g -L VERSION
 
 CXX?=          c++
 CXXFLAGS?=     ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length}



Home | Main Index | Thread Index | Old Index