svn commit: r228118 - head/sys/sys

2011-11-29 Thread Lawrence Stewart
Author: lstewart
Date: Tue Nov 29 07:59:45 2011
New Revision: 228118
URL: http://svn.freebsd.org/changeset/base/228118

Log:
  Introduce the new fromclock public wrapper API which allows consumers to
  select which system clock to obtain time from, independent of the current
  default system clock. In the brave new multi sysclock world, both feedback and
  feed-forward system clocks can be maintained and used concurrently, so this 
API
  provides a minimalist first step for interested consumers to exercise control
  over their choice of system clock.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded Feed-Forward
  Clock Synchronization Algorithms project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Discussed with:   Julien Ridoux (jridoux at unimelb edu au)
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Modified:
  head/sys/sys/timeffc.h

Modified: head/sys/sys/timeffc.h
==
--- head/sys/sys/timeffc.h  Tue Nov 29 06:53:36 2011(r228117)
+++ head/sys/sys/timeffc.h  Tue Nov 29 07:59:45 2011(r228118)
@@ -186,6 +186,132 @@ void fbclock_getbinuptime(struct bintime
 void fbclock_getnanouptime(struct timespec *tsp);
 void fbclock_getmicrouptime(struct timeval *tvp);
 
+/*
+ * Public system clock wrapper API which allows consumers to select which clock
+ * to obtain time from, independent of the current default system clock. These
+ * wrappers should be used instead of directly calling the underlying fbclock_
+ * or ffclock_ functions.
+ */
+static inline void
+bintime_fromclock(struct bintime *bt, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_bintime(bt);
+   else
+   fbclock_bintime(bt);
+}
+
+static inline void
+nanotime_fromclock(struct timespec *tsp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_nanotime(tsp);
+   else
+   fbclock_nanotime(tsp);
+}
+
+static inline void
+microtime_fromclock(struct timeval *tvp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_microtime(tvp);
+   else
+   fbclock_microtime(tvp);
+}
+
+static inline void
+getbintime_fromclock(struct bintime *bt, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getbintime(bt);
+   else
+   fbclock_getbintime(bt);
+}
+
+static inline void
+getnanotime_fromclock(struct timespec *tsp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getnanotime(tsp);
+   else
+   fbclock_getnanotime(tsp);
+}
+
+static inline void
+getmicrotime_fromclock(struct timeval *tvp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getmicrotime(tvp);
+   else
+   fbclock_getmicrotime(tvp);
+}
+
+static inline void
+binuptime_fromclock(struct bintime *bt, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_binuptime(bt);
+   else
+   fbclock_binuptime(bt);
+}
+
+static inline void
+nanouptime_fromclock(struct timespec *tsp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_nanouptime(tsp);
+   else
+   fbclock_nanouptime(tsp);
+}
+
+static inline void
+microuptime_fromclock(struct timeval *tvp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_microuptime(tvp);
+   else
+   fbclock_microuptime(tvp);
+}
+
+static inline void
+getbinuptime_fromclock(struct bintime *bt, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getbinuptime(bt);
+   else
+   fbclock_getbinuptime(bt);
+}
+
+static inline void
+getnanouptime_fromclock(struct timespec *tsp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getnanouptime(tsp);
+   else
+   fbclock_getnanouptime(tsp);
+}
+
+static inline void
+getmicrouptime_fromclock(struct timeval *tvp, int whichclock)
+{
+
+   if (whichclock == SYSCLOCK_FFWD)
+   ffclock_getmicrouptime(tvp);
+   else
+   fbclock_getmicrouptime(tvp);
+}
+
 #else /* !_KERNEL */
 
 /* Feed-Forward Clock system calls. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228119 - head/usr.sbin/mfiutil

2011-11-29 Thread Xin LI
Author: delphij
Date: Tue Nov 29 08:16:14 2011
New Revision: 228119
URL: http://svn.freebsd.org/changeset/base/228119

Log:
  In build_volume(), check if arrays is allocated before traversing its
  items.  While parsing the arrays input, it's possible that we reach the
  error path before initializing the 'arrays' pointer, which in turn leads
  to a NULL deference.
  
  Submitted by: Garrett Cooper
  MFC after:1 week

Modified:
  head/usr.sbin/mfiutil/mfi_config.c

Modified: head/usr.sbin/mfiutil/mfi_config.c
==
--- head/usr.sbin/mfiutil/mfi_config.c  Tue Nov 29 07:59:45 2011
(r228118)
+++ head/usr.sbin/mfiutil/mfi_config.c  Tue Nov 29 08:16:14 2011
(r228119)
@@ -820,9 +820,11 @@ error:
free(config);
free(state.volumes);
free(state.arrays);
-   for (i = 0; i  narrays; i++)
-   free(arrays[i].drives);
-   free(arrays);
+   if (arrays != NULL) {
+   for (i = 0; i  narrays; i++)
+   free(arrays[i].drives);
+   free(arrays);
+   }
close(fd);
 
return (error);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228120 - head/share/mk

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 08:20:23 2011
New Revision: 228120
URL: http://svn.freebsd.org/changeset/base/228120

Log:
  Allow NO_FOO to override WITH_FOO that could be specified in /etc/src.conf.
  
  This is required to override knobs (e.g. WITH_PROFILE) during buildworld
  stages in Makefile.inc1 (otherwise the build is stopped due to both WITH_FOO
  and WITHOUT_FOO defined).

Modified:
  head/share/mk/bsd.own.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Nov 29 08:16:14 2011(r228119)
+++ head/share/mk/bsd.own.mkTue Nov 29 08:20:23 2011(r228120)
@@ -207,6 +207,9 @@ COMPRESS_EXT?=  .gz
 MAN \
 PROFILE
 .if defined(NO_${var})
+.if defined(WITH_${var})
+.undef WITH_${var}
+.endif
 WITHOUT_${var}=
 .endif
 .endfor
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228122 - head/usr.sbin/mergemaster

2011-11-29 Thread Doug Barton
Author: dougb
Date: Tue Nov 29 08:22:12 2011
New Revision: 228122
URL: http://svn.freebsd.org/changeset/base/228122

Log:
  If using DISTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo
  
  PR:   bin/162891
  Submitted by: Helge Oldach src-mergemaster-no...@oldach.net

Modified:
  head/usr.sbin/mergemaster/mergemaster.sh

Modified: head/usr.sbin/mergemaster/mergemaster.sh
==
--- head/usr.sbin/mergemaster/mergemaster.shTue Nov 29 08:21:54 2011
(r228121)
+++ head/usr.sbin/mergemaster/mergemaster.shTue Nov 29 08:22:12 2011
(r228122)
@@ -1336,14 +1336,14 @@ esac
 
 if [ -e ${DESTDIR}/etc/localtime ]; then # Ignore if TZ == UTC
   echo ''
+  [ -n ${DESTDIR} ]  tzs_args=-C ${DESTDIR}
   if [ -f ${DESTDIR}/var/db/zoneinfo ]; then
 echo *** Reinstalling `cat ${DESTDIR}/var/db/zoneinfo` as 
${DESTDIR}/etc/localtime
-[ -n ${DESTDIR} ]  tzs_args=-C ${DESTDIR}
 tzsetup $tzs_args -r
   else
 echo *** There is no ${DESTDIR}/var/db/zoneinfo file to update 
${DESTDIR}/etc/localtime.
 echo 'You should run tzsetup'
-run_it_now tzsetup
+run_it_now tzsetup $tzs_args
   fi
 fi
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228121 - head/sys/conf

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 08:21:54 2011
New Revision: 228121
URL: http://svn.freebsd.org/changeset/base/228121

Log:
  Fix typo in comments (conversation - conversion).

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Tue Nov 29 08:20:23 2011(r228120)
+++ head/sys/conf/kern.mk   Tue Nov 29 08:21:54 2011(r228121)
@@ -128,7 +128,7 @@ CFLAGS+=-fstack-protector
 .endif
 
 #
-# Enable CTF conversation on request
+# Enable CTF conversion on request
 #
 .if defined(WITH_CTF)
 .undef NO_CTF
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228123 - head/sys/kern

2011-11-29 Thread Lawrence Stewart
Author: lstewart
Date: Tue Nov 29 08:33:40 2011
New Revision: 228123
URL: http://svn.freebsd.org/changeset/base/228123

Log:
  Do away with the somewhat clunky sysclock_ops structure and associated code,
  reimplementing the [get]{bin,nano,micro}[up]time() wrapper functions in terms 
of
  the new fromclock API instead.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded Feed-Forward
  Clock Synchronization Algorithms project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Discussed with:   Julien Ridoux (jridoux at unimelb edu au)
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Modified:
  head/sys/kern/kern_tc.c

Modified: head/sys/kern/kern_tc.c
==
--- head/sys/kern/kern_tc.c Tue Nov 29 08:22:12 2011(r228122)
+++ head/sys/kern/kern_tc.c Tue Nov 29 08:33:40 2011(r228123)
@@ -470,38 +470,6 @@ uint32_t ffclock_status;   /* Feed-forwar
 int8_t ffclock_updated;/* New estimates are available. 
*/
 struct mtx ffclock_mtx;/* Mutex on ffclock_estimate. */
 
-struct sysclock_ops {
-   int active;
-   void (*binuptime) (struct bintime *bt);
-   void (*nanouptime) (struct timespec *tsp);
-   void (*microuptime) (struct timeval *tvp);
-   void (*bintime) (struct bintime *bt);
-   void (*nanotime) (struct timespec *tsp);
-   void (*microtime) (struct timeval *tvp);
-   void (*getbinuptime) (struct bintime *bt);
-   void (*getnanouptime) (struct timespec *tsp);
-   void (*getmicrouptime) (struct timeval *tvp);
-   void (*getbintime) (struct bintime *bt);
-   void (*getnanotime) (struct timespec *tsp);
-   void (*getmicrotime) (struct timeval *tvp);
-};
-
-static struct sysclock_ops sysclock = {
-   .active = SYSCLOCK_FBCK,
-   .binuptime = fbclock_binuptime,
-   .nanouptime = fbclock_nanouptime,
-   .microuptime = fbclock_microuptime,
-   .bintime = fbclock_bintime,
-   .nanotime = fbclock_nanotime,
-   .microtime = fbclock_microtime,
-   .getbinuptime = fbclock_getbinuptime,
-   .getnanouptime = fbclock_getnanouptime,
-   .getmicrouptime = fbclock_getmicrouptime,
-   .getbintime = fbclock_getbintime,
-   .getnanotime = fbclock_getnanotime,
-   .getmicrotime = fbclock_getmicrotime
-};
-
 struct fftimehands {
struct ffclock_estimate cest;
struct bintime  tick_time;
@@ -794,46 +762,6 @@ ffclock_change_tc(struct timehands *th)
fftimehands = ffth;
 }
 
-static void
-change_sysclock(int new_sysclock)
-{
-
-   sysclock.active = new_sysclock;
-
-   switch (sysclock.active) {
-   case SYSCLOCK_FBCK:
-   sysclock.binuptime = fbclock_binuptime;
-   sysclock.nanouptime = fbclock_nanouptime;
-   sysclock.microuptime = fbclock_microuptime;
-   sysclock.bintime = fbclock_bintime;
-   sysclock.nanotime = fbclock_nanotime;
-   sysclock.microtime = fbclock_microtime;
-   sysclock.getbinuptime = fbclock_getbinuptime;
-   sysclock.getnanouptime = fbclock_getnanouptime;
-   sysclock.getmicrouptime = fbclock_getmicrouptime;
-   sysclock.getbintime = fbclock_getbintime;
-   sysclock.getnanotime = fbclock_getnanotime;
-   sysclock.getmicrotime = fbclock_getmicrotime;
-   break;
-   case SYSCLOCK_FFWD:
-   sysclock.binuptime = ffclock_binuptime;
-   sysclock.nanouptime = ffclock_nanouptime;
-   sysclock.microuptime = ffclock_microuptime;
-   sysclock.bintime = ffclock_bintime;
-   sysclock.nanotime = ffclock_nanotime;
-   sysclock.microtime = ffclock_microtime;
-   sysclock.getbinuptime = ffclock_getbinuptime;
-   sysclock.getnanouptime = ffclock_getnanouptime;
-   sysclock.getmicrouptime = ffclock_getmicrouptime;
-   sysclock.getbintime = ffclock_getbintime;
-   sysclock.getnanotime = ffclock_getnanotime;
-   sysclock.getmicrotime = ffclock_getmicrotime;
-   break;
-   default:
-   break;
-   }
-}
-
 /*
  * Retrieve feed-forward counter and time of last kernel tick.
  */
@@ -949,84 +877,84 @@ void
 binuptime(struct bintime *bt)
 {
 
-   sysclock.binuptime(bt);
+   binuptime_fromclock(bt, sysclock_active);
 }
 
 void
 nanouptime(struct timespec *tsp)
 {
 
-   sysclock.nanouptime(tsp);
+   nanouptime_fromclock(tsp, sysclock_active);
 }
 
 void
 microuptime(struct timeval *tvp)
 {
 
-   sysclock.microuptime(tvp);
+   microuptime_fromclock(tvp, sysclock_active);
 }
 
 void
 bintime(struct bintime *bt)
 {
 
-   sysclock.bintime(bt);
+   

svn commit: r228124 - in head: share/mk sys/conf

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 08:38:47 2011
New Revision: 228124
URL: http://svn.freebsd.org/changeset/base/228124

Log:
  Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead
  of executing a shell on every object or executable/library file.
  
  This shaves off more than 30,000 shell invocations during buildworld.

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.prog.mk
  head/share/mk/sys.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Nov 29 08:33:40 2011(r228123)
+++ head/share/mk/bsd.lib.mkTue Nov 29 08:38:47 2011(r228124)
@@ -75,15 +75,15 @@ PO_FLAG=-pg
 
 .c.po:
${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o 
${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .c.So:
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o 
${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .cc.o:
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -96,47 +96,47 @@ PO_FLAG=-pg
 
 .f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .f.So:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .s.po .s.So:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .asm.po:
${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .asm.So:
${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .S.po:
${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 .S.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif
 
 all: objwarn
 
@@ -211,9 +211,9 @@ ${SHLIB_NAME}: ${SOBJS}
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
 .endif
-   @[ -z ${CTFMERGE} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}  \
-   ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS})
+.if !defined(NO_CTF)
+   ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
+.endif
 .endif
 
 .if defined(INSTALL_PIC_ARCHIVE)  defined(LIB)  !empty(LIB)  
${MK_TOOLCHAIN} != no

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Tue Nov 29 08:33:40 2011(r228123)
+++ head/share/mk/bsd.prog.mk   Tue Nov 29 08:38:47 2011(r228124)
@@ -60,9 +60,9 @@ ${PROG}: ${OBJS}
 .else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
 .endif
-   @[ -z ${CTFMERGE} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} 

svn commit: r228125 - in head/sys: kern sys

2011-11-29 Thread Lawrence Stewart
Author: lstewart
Date: Tue Nov 29 08:43:04 2011
New Revision: 228125
URL: http://svn.freebsd.org/changeset/base/228125

Log:
  Make sysclock_active publicly available to external consumers.
  
  Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
  Melbourne, Australia, as part of the FreeBSD Foundation funded Feed-Forward
  Clock Synchronization Algorithms project.
  
  For more information, see http://www.synclab.org/radclock/
  
  Discussed with:   Julien Ridoux (jridoux at unimelb edu au)
  Submitted by: Julien Ridoux (jridoux at unimelb edu au)

Modified:
  head/sys/kern/kern_ffclock.c
  head/sys/sys/timeffc.h

Modified: head/sys/kern/kern_ffclock.c
==
--- head/sys/kern/kern_ffclock.cTue Nov 29 08:38:47 2011
(r228124)
+++ head/sys/kern/kern_ffclock.cTue Nov 29 08:43:04 2011
(r228125)
@@ -190,8 +190,6 @@ sysctl_kern_ffclock_choice(SYSCTL_HANDLE
 SYSCTL_PROC(_kern_ffclock, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD,
 0, 0, sysctl_kern_ffclock_choice, A, Clock paradigms available);
 
-extern int sysclock_active;
-
 static int
 sysctl_kern_ffclock_active(SYSCTL_HANDLER_ARGS)
 {

Modified: head/sys/sys/timeffc.h
==
--- head/sys/sys/timeffc.h  Tue Nov 29 08:38:47 2011(r228124)
+++ head/sys/sys/timeffc.h  Tue Nov 29 08:43:04 2011(r228125)
@@ -61,6 +61,7 @@ struct ffclock_estimate {
  */
 #defineSYSCLOCK_FBCK   0
 #defineSYSCLOCK_FFWD   1
+extern int sysclock_active;
 
 /*
  * Parameters of counter characterisation required by feed-forward algorithms.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228124 - in head: share/mk sys/conf

2011-11-29 Thread Garrett Cooper
On Tue, Nov 29, 2011 at 12:38 AM, Max Khon f...@freebsd.org wrote:
 Author: fjoe
 Date: Tue Nov 29 08:38:47 2011
 New Revision: 228124
 URL: http://svn.freebsd.org/changeset/base/228124

 Log:
  Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead
  of executing a shell on every object or executable/library file.

  This shaves off more than 30,000 shell invocations during buildworld.

Thank you Great minds truly do think alike.
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228071 - head/sys/net

2011-11-29 Thread Gleb Smirnoff
On Mon, Nov 28, 2011 at 07:47:22PM +, Bjoern A. Zeeb wrote:
B On 28. Nov 2011, at 14:44 , Gleb Smirnoff wrote:
B 
B  Author: glebius
B  Date: Mon Nov 28 14:44:59 2011
B  New Revision: 228071
B  URL: http://svn.freebsd.org/changeset/base/228071
B  
B  Log:
B   - Use generic alloc_unr(9) allocator for if_clone, instead
B of hand-made.
B   - When registering new cloner, check whether a cloner with
B same name already exist.
B   - When allocating unit, also check with help of ifunit()
B whether such interface already exist or not. [1]
B 
B This forces packages to be recompiled;  they might like to have a 
__FreeBSD_version for that?
B It's not MFCable, at least I think - don't see a MFC after, just want to be 
sure.

No plans for MFC.

btw, I don't like the static initializer of cloners, since it require 
re-compile of
dependencies.

What about making an API change: remove the static initializer and make an 
initializer
function. Modules should have only a pointer to opaque structure. We will bump
__FreeBSD_version for that. But later with any change to the if_clone struct, we
won't have ABI change. If everyone agrees, I can go for that.

B See one more comment inline?
B  +  ifc-ifc_unrhdr = new_unrhdr(0, ifc-ifc_maxunit, ifc-ifc_mtx);
B  +  LIST_INIT(ifc-ifc_iflist);
B  
B IF_CLONERS_LOCK();
B  +  LIST_FOREACH(ifc1, V_if_cloners, ifc_list)
B  +  if (strcmp(ifc-ifc_name, ifc1-ifc_name) == 0) {
B  +  IF_CLONERS_UNLOCK();
B  +  IF_CLONE_REMREF(ifc);
B  +  return (EEXIST);
B 
B At this point you may have a problem not freeing the unr?

No, there is no problem. The code path that goes to delete_unrhdr() is the
following:

IF_CLONE_REMREF calls IF_CLONE_REMREF_LOCKED, the latter calls if_clone_free(),
and the last one calls delete_unrhdr().

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228071 - head/sys/net

2011-11-29 Thread Gleb Smirnoff
On Mon, Nov 28, 2011 at 10:23:07PM +0200, Jaakko Heinonen wrote:
J On 2011-11-28, Bjoern A. Zeeb wrote:
J   static void
J   if_clone_free(struct if_clone *ifc)
J   {
J   -for (int bytoff = 0; bytoff  ifc-ifc_bmlen; bytoff++) {
J   -KASSERT(ifc-ifc_units[bytoff] == 0x00,
J   -(ifc_units[%d] is not empty, bytoff));
J   -}
J   
JKASSERT(LIST_EMPTY(ifc-ifc_iflist),
J(%s: ifc_iflist not empty, __func__));
J   
JIF_CLONE_LOCK_DESTROY(ifc);
J   -free(ifc-ifc_units, M_CLONE);
J   +delete_unrhdr(ifc-ifc_unrhdr);
J   }
J 
J delete_unrhdr() KASSERTs that all allocations has been freed. Thus if
J the leak below has occurred, the result will be a panic at this point
J with INVARIANTS enabled kernel. If INVARIANTS is disabled, a memory leak
J is possible.

Thanks, Jaakko! Good catch. I will try to fix that.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228071 - head/sys/net

2011-11-29 Thread Bjoern A. Zeeb

On Tue, 29 Nov 2011, Gleb Smirnoff wrote:


On Mon, Nov 28, 2011 at 07:47:22PM +, Bjoern A. Zeeb wrote:
B On 28. Nov 2011, at 14:44 , Gleb Smirnoff wrote:
B
B  Author: glebius
B  Date: Mon Nov 28 14:44:59 2011
B  New Revision: 228071
B  URL: http://svn.freebsd.org/changeset/base/228071
B 
B  Log:
B   - Use generic alloc_unr(9) allocator for if_clone, instead
B of hand-made.
B   - When registering new cloner, check whether a cloner with
B same name already exist.
B   - When allocating unit, also check with help of ifunit()
B whether such interface already exist or not. [1]
B
B This forces packages to be recompiled;  they might like to have a 
__FreeBSD_version for that?
B It's not MFCable, at least I think - don't see a MFC after, just want to be 
sure.

No plans for MFC.

btw, I don't like the static initializer of cloners, since it require 
re-compile of
dependencies.

What about making an API change: remove the static initializer and make an 
initializer
function. Modules should have only a pointer to opaque structure. We will bump
__FreeBSD_version for that. But later with any change to the if_clone struct, we
won't have ABI change. If everyone agrees, I can go for that.


I have some fairly intrusive changes to cloners sitting in p4 for the
V_irtualization but it could make my life easier;  I'll be happy to
look at the patch.



B See one more comment inline?
B  +ifc-ifc_unrhdr = new_unrhdr(0, ifc-ifc_maxunit, ifc-ifc_mtx);
B  +LIST_INIT(ifc-ifc_iflist);
B 
B   IF_CLONERS_LOCK();
B  +LIST_FOREACH(ifc1, V_if_cloners, ifc_list)
B  +if (strcmp(ifc-ifc_name, ifc1-ifc_name) == 0) {
B  +IF_CLONERS_UNLOCK();
B  +IF_CLONE_REMREF(ifc);
B  +return (EEXIST);
B
B At this point you may have a problem not freeing the unr?

No, there is no problem. The code path that goes to delete_unrhdr() is the
following:

IF_CLONE_REMREF calls IF_CLONE_REMREF_LOCKED, the latter calls if_clone_free(),
and the last one calls delete_unrhdr().




--
Bjoern A. Zeeb You have to have visions!
 Stop bit received. Insert coin for new address family.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228114 - head/lib/libedit/edit/readline

2011-11-29 Thread David Chisnall
On 29 Nov 2011, at 04:50, Max Khon wrote:

  All this makes it possible to build and link gdb with -ledit.

When I had a quick look a couple of days ago, kadmin and [k]gdb were the only 
things that linked against readline in base.  With them now linking against 
libedit, can we remove readline from base?

David___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228114 - head/lib/libedit/edit/readline

2011-11-29 Thread Max Khon
David,

On Tue, Nov 29, 2011 at 6:28 PM, David Chisnall thera...@freebsd.orgwrote:

  All this makes it possible to build and link gdb with -ledit.

 When I had a quick look a couple of days ago, kadmin and [k]gdb were the
 only things that linked against readline in base.  With them now linking
 against libedit, can we remove readline from base?


Yes, I am working on it. Stay tuned.

Max
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228132 - head/sys/net

2011-11-29 Thread Lawrence Stewart
Author: lstewart
Date: Tue Nov 29 12:55:26 2011
New Revision: 228132
URL: http://svn.freebsd.org/changeset/base/228132

Log:
  Revert r227778 in preparation for committing reworked patches in its place.

Modified:
  head/sys/net/bpf.c
  head/sys/net/bpf.h

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Tue Nov 29 12:41:44 2011(r228131)
+++ head/sys/net/bpf.c  Tue Nov 29 12:55:26 2011(r228132)
@@ -1,17 +1,12 @@
 /*-
  * Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California.
- * Copyright (c) 2011 The FreeBSD Foundation.
- * All rights reserved.
+ * The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from the Stanford/CMU enet packet filter,
  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
  * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
  * Berkeley Laboratory.
  *
- * Portions of this software were developed by Julien Ridoux at the University
- * of Melbourne under sponsorship from the FreeBSD Foundation.
- *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -44,7 +39,6 @@ __FBSDID($FreeBSD$);
 
 #include opt_bpf.h
 #include opt_compat.h
-#include opt_ffclock.h
 #include opt_netgraph.h
 
 #include sys/types.h
@@ -61,9 +55,6 @@ __FBSDID($FreeBSD$);
 #include sys/signalvar.h
 #include sys/filio.h
 #include sys/sockio.h
-#ifdef FFCLOCK
-#include sys/timeffc.h
-#endif
 #include sys/ttycom.h
 #include sys/uio.h
 
@@ -99,13 +90,8 @@ MALLOC_DEFINE(M_BPF, BPF, BPF data);
 
 #define PRINET  26 /* interruptible */
 
-#ifdef FFCLOCK
-#define SIZEOF_BPF_HDR(type)   \
-(offsetof(type, ffcount_stamp) + sizeof(((type *)0)-ffcount_stamp))
-#else
 #defineSIZEOF_BPF_HDR(type)\
 (offsetof(type, bh_hdrlen) + sizeof(((type *)0)-bh_hdrlen))
-#endif
 
 #ifdef COMPAT_FREEBSD32
 #include sys/mount.h
@@ -125,9 +111,6 @@ struct bpf_hdr32 {
uint32_tbh_datalen; /* original length of packet */
uint16_tbh_hdrlen;  /* length of bpf header (this struct
   plus alignment padding) */
-#ifdef FFCLOCK
-   ffcounter   ffcount_stamp;  /* ffcounter timestamp of packet */
-#endif
 };
 #endif
 
@@ -168,16 +151,9 @@ static int bpf_setif(struct bpf_d *, str
 static voidbpf_timed_out(void *);
 static __inline void
bpf_wakeup(struct bpf_d *);
-#ifdef FFCLOCK
-static voidcatchpacket(struct bpf_d *, u_char *, unsigned int,
-   unsigned int, void (*)(struct bpf_d *, caddr_t,
-   unsigned int, void *, unsigned int), struct bintime *,
-   ffcounter *);
-#else
 static voidcatchpacket(struct bpf_d *, u_char *, u_int, u_int,
void (*)(struct bpf_d *, caddr_t, u_int, void *, u_int),
struct bintime *);
-#endif
 static voidreset_d(struct bpf_d *);
 static int  bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd);
 static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *);
@@ -196,12 +172,6 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_
 bpf_zerocopy_enable, 0, Enable new zero-copy BPF buffer sessions);
 static SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW,
 bpf_stats_sysctl, bpf statistics portal);
-#ifdef FFCLOCK
-static int bpf_ffclock_tstamp = 0;
-SYSCTL_INT(_net_bpf, OID_AUTO, ffclock_tstamp, CTLFLAG_RW,
-bpf_ffclock_tstamp, 0,
-Set BPF to timestamp using Feed-Forward clock by default);
-#endif
 
 static d_open_tbpfopen;
 static d_read_tbpfread;
@@ -728,15 +698,6 @@ bpfopen(struct cdev *dev, int flags, int
callout_init_mtx(d-bd_callout, d-bd_mtx, 0);
knlist_init_mtx(d-bd_sel.si_note, d-bd_mtx);
 
-#ifdef FFCLOCK
-   /*
-* Set the timestamping mode for this device, i.e. which clock is used.
-* The default option is to use the feedback/ntpd system clock.
-*/
-   if (bpf_ffclock_tstamp)
-   d-bd_tstamp = d-bd_tstamp | BPF_T_FFCLOCK;
-#endif
-
return (0);
 }
 
@@ -1815,13 +1776,8 @@ bpf_ts_quality(int tstype)
return (BPF_TSTAMP_NORMAL);
 }
 
-#ifdef FFCLOCK
-static int
-bpf_gettime(struct bintime *bt, ffcounter *ffcount, int tstype, struct mbuf *m)
-#else
 static int
 bpf_gettime(struct bintime *bt, int tstype, struct mbuf *m)
-#endif
 {
struct m_tag *tag;
int quality;
@@ -1837,31 +1793,11 @@ bpf_gettime(struct bintime *bt, int tsty
return (BPF_TSTAMP_EXTERN);
}
}
-   if (quality == BPF_TSTAMP_NORMAL) {
-#ifdef FFCLOCK
-   if ((tstype  BPF_T_FFCLOCK) == 0) {
-   ffclock_read_counter(ffcount);
-#endif
-   binuptime(bt);
-#ifdef FFCLOCK
-

Re: svn commit: r227778 - head/sys/net

2011-11-29 Thread Lawrence Stewart

On 11/28/11 14:59, Benjamin Kaduk wrote:

On Wed, 23 Nov 2011, Lawrence Stewart wrote:


On 11/23/11 17:42, Julien Ridoux wrote:


Thanks all for the feedback. With some delay, I have a patch against
r227871 that implements what Lawrence proposed. You can find it
here:
http://www.cubinlab.ee.unimelb.edu.au/~jrid/patches/ffclock-bpf-header-r227871.patch



There are a few nits, but the patch implements what I envisaged,
thanks Julien.


The use of the union for bh_ustamp feels a bit odd, as (e.g.) a bpf_ts
is two 64-bit ints, but an ffcounter is just a single 64-bit int.


Julien and I discussed this - the alternative of somehow casting that 
struct member to something else is probably worse, so we're going to 
stick with a union.





I have tested this under a few typical scenario, it works as
expected but already brings some headaches (hence the long delay
mentioned above :-)).

I thought a bit more of user cases. I believe many of them call for
having both feed-forward counter and its conversion in second be
present in the BPF header. For example, this allows to have absolute
packet departure/arrival times (as per usual), but also provides the
opportunity to compute inter-arrival times accurately using the
difference clock. There are other examples I can think of, and if one
believe the feed-forward clock approach becomes more popular, such
usages will be more and more common.



Having read only the first introductory link that Lawrence posted when
he first started introducing the ffclock code, it does really seem like
there are lots of interesting things to do with both timestamps available.



Assuming the BPF header grows by 8 bytes independent of any kernel
option, I admit that the current implementation is a bit ugly. The
BPF structure is not nicely packed and looks clunky. Ideally, the


The
+#define bh_tstamp bh_ustamp.ts_stamp
is a sort of thing that can get annoying when poking around kernel
cores, c. I won't argue with you that the current implementation is a
bit ugly.


Agreed it's gross, but in sticking with the union route, this is a 
necessary evil to reduce the impact of integrating FFCLOCK support into BPF.



feed-forward counter should be placed just below the bh_tstamp
member, but this would require libpcap and all ports depending on it
to be recompiled after this change.


Even though it looks a bit gross, we would still add it at the end to
avoid gratuitously breaking binaries. We would then also add some
explicit padding in the struct to soak up the redundant space left in
between it and the second last struct member.


Though ... we are just after a release branch is forked. That seems to
be a much better time to change the ABI for cleanliness' sake than right
before a release ;)


True.




What is your favourite option?


FreeBSD parlance is to ask what colour you would like to paint the
bikeshed ;)

As I've never experienced the pain John refers to, I'll defer to the
wisdom of others on whether the proposed patch will create pain down
the road. I think it's ok, but if consensus is 8bytes per packet isn't
going to break the bank, I guess we just go for it - but I guess I am
cautious about this route as we can push a lot of packets per second
through the stack.


Since other people seem to be keeping quiet, I'll add that I'm in favor
of just always adding the 8 bytes per packet.


Julien and I discussed this at length today, and agree that for head, 
we'll add the new bh_ffcounter member to the BPF header unconditionally.


Thanks to you and John for the input.

I'm going to revert r227778 in order to start form a clean slate, and 
add two separate patches. One will reintegrate FFCLOCK support with BPF 
without breaking the ABI. A follow up patch will bump the ffclock 
version and add the bh_ffcounter to the bpf header (after the timestamp 
member). Then a final patch will bump __FreeBSD_version and add a note 
to UPDATING about recompiling to get kernel/world in sync, which should 
seal the deal.


Cheers,
Lawrence
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228133 - head/sys/vm

2011-11-29 Thread Konstantin Belousov
Author: kib
Date: Tue Nov 29 13:07:32 2011
New Revision: 228133
URL: http://svn.freebsd.org/changeset/base/228133

Log:
  Hide the internals of vm_page_lock(9) from the loadable modules.
  Since the address of vm_page lock mutex depends on the kernel options,
  it is easy for module to get out of sync with the kernel.
  
  No vm_page_lockptr() accessor is provided for modules. It can be added
  later if needed, unless proper KPI is developed to serve the needs.
  
  Reviewed by:  attilio, alc
  MFC after:3 weeks

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Tue Nov 29 12:55:26 2011(r228132)
+++ head/sys/vm/vm_page.c   Tue Nov 29 13:07:32 2011(r228133)
@@ -2843,6 +2843,36 @@ vm_page_test_dirty(vm_page_t m)
vm_page_dirty(m);
 }
 
+void
+vm_page_lock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   mtx_lock_flags_(vm_page_lockptr(m), 0, file, line);
+}
+
+void
+vm_page_unlock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   mtx_unlock_flags_(vm_page_lockptr(m), 0, file, line);
+}
+
+int
+vm_page_trylock_KBI(vm_page_t m, const char *file, int line)
+{
+
+   return (mtx_trylock_flags_(vm_page_lockptr(m), 0, file, line));
+}
+
+#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
+void
+vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line)
+{
+
+   mtx_assert_(vm_page_lockptr(m), a, file, line);
+}
+#endif
+
 int so_zerocp_fullpage = 0;
 
 /*

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Tue Nov 29 12:55:26 2011(r228132)
+++ head/sys/vm/vm_page.h   Tue Nov 29 13:07:32 2011(r228133)
@@ -218,11 +218,23 @@ extern struct vpglocks pa_lock[];
 
 #definePA_LOCK_ASSERT(pa, a)   mtx_assert(PA_LOCKPTR(pa), (a))
 
+#ifdef KLD_MODULE
+#definevm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#definevm_page_unlock(m)   vm_page_unlock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#definevm_page_trylock(m)  vm_page_trylock_KBI((m), LOCK_FILE, 
LOCK_LINE)
+#if defined(INVARIANTS)
+#definevm_page_lock_assert(m, a)   \
+vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__)
+#else
+#definevm_page_lock_assert(m, a)
+#endif
+#else  /* !KLD_MODULE */
 #definevm_page_lockptr(m)  (PA_LOCKPTR(VM_PAGE_TO_PHYS((m
 #definevm_page_lock(m) mtx_lock(vm_page_lockptr((m)))
 #definevm_page_unlock(m)   mtx_unlock(vm_page_lockptr((m)))
 #definevm_page_trylock(m)  mtx_trylock(vm_page_lockptr((m)))
 #definevm_page_lock_assert(m, a)   
mtx_assert(vm_page_lockptr((m)), (a))
+#endif
 
 #definevm_page_queue_free_mtx  vm_page_queue_free_lock.data
 /*
@@ -405,6 +417,13 @@ void vm_page_cowfault (vm_page_t);
 int vm_page_cowsetup(vm_page_t);
 void vm_page_cowclear (vm_page_t);
 
+void vm_page_lock_KBI(vm_page_t m, const char *file, int line);
+void vm_page_unlock_KBI(vm_page_t m, const char *file, int line);
+int vm_page_trylock_KBI(vm_page_t m, const char *file, int line);
+#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT)
+void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line);
+#endif
+
 #ifdef INVARIANTS
 void vm_page_object_lock_assert(vm_page_t m);
 #defineVM_PAGE_OBJECT_LOCK_ASSERT(m)   vm_page_object_lock_assert(m)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r227778 - head/sys/net

2011-11-29 Thread Lawrence Stewart

On 11/30/11 00:05, Lawrence Stewart wrote:

On 11/28/11 14:59, Benjamin Kaduk wrote:

On Wed, 23 Nov 2011, Lawrence Stewart wrote:

On 11/23/11 17:42, Julien Ridoux wrote:


[snip]


What is your favourite option?


FreeBSD parlance is to ask what colour you would like to paint the
bikeshed ;)

As I've never experienced the pain John refers to, I'll defer to the
wisdom of others on whether the proposed patch will create pain down
the road. I think it's ok, but if consensus is 8bytes per packet isn't
going to break the bank, I guess we just go for it - but I guess I am
cautious about this route as we can push a lot of packets per second
through the stack.


Since other people seem to be keeping quiet, I'll add that I'm in favor
of just always adding the 8 bytes per packet.


Julien and I discussed this at length today, and agree that for head,
we'll add the new bh_ffcounter member to the BPF header unconditionally.

Thanks to you and John for the input.

I'm going to revert r227778 in order to start form a clean slate, and
add two separate patches. One will reintegrate FFCLOCK support with BPF
without breaking the ABI. A follow up patch will bump the ffclock
version and add the bh_ffcounter to the bpf header (after the timestamp
member). Then a final patch will bump __FreeBSD_version and add a note
to UPDATING about recompiling to get kernel/world in sync, which should
seal the deal.


Here's the first of the patches:

http://people.freebsd.org/~lstewart/patches/misc/ffclock_bpf_intactabi_10.x.r228130.patch

Julien, it's basically what you sent me today, but is against vanilla 
bpf.c/bpf.h (I decided at the last minute that reverting r227778 first 
was going to be cleaner and easier to follow). Relative to what you 
sent, it also has some tweaks to reduce the diff size, remove the 
unnecessary uses of BPF_T_FLAG()/BPF_T_FORMAT() and fix the (u_char 
*)mb buglet.


If I don't hear any objections, I'll commit it tomorrow.

Cheers,
Lawrence
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228137 - in head: share/mk sys/conf

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 16:34:44 2011
New Revision: 228137
URL: http://svn.freebsd.org/changeset/base/228137

Log:
  - fix WITH_CTF when specified in /etc/src.conf [1]
  - CTFCONVERT_CMD=... is a hack (should be defined to empty string instead):
  make(1) should be taught to ignore empty commands silently in compat mode
  (as it does in !compat mode, GNU make also silently ignores empty commands)
  and to skip printing empty commands in !compat mode
  - config(8) should generate ${NORMAL_CTFCONVERT} invocation without '@':
  this will allow to simplify kern.pre.mk even more and lessen the number
  of shell invocations during kernel build when CTF is turned off
  - WITH_CTF can now be converted to usual MK_CTF=yes/no infrastructure
  
  Pointy hat to:fjoe [1]

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.own.mk
  head/share/mk/bsd.prog.mk
  head/share/mk/sys.mk
  head/sys/conf/kern.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Nov 29 15:24:19 2011(r228136)
+++ head/share/mk/bsd.lib.mkTue Nov 29 16:34:44 2011(r228137)
@@ -33,15 +33,10 @@ CFLAGS+= -DNDEBUG
 NO_WERROR=
 .endif
 
-# Enable CTF conversion on request.
-.if defined(WITH_CTF)
-.undef NO_CTF
-.endif
-
 .if defined(DEBUG_FLAGS)
 CFLAGS+= ${DEBUG_FLAGS}
 
-.if !defined(NO_CTF)  (${DEBUG_FLAGS:M-g} != )
+.if defined(WITH_CTF)  (${DEBUG_FLAGS:M-g} != )
 CTFFLAGS+= -g
 .endif
 .endif
@@ -69,21 +64,15 @@ PO_FLAG=-pg
 
 .c.o:
${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-   (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+   ${CTFCONVERT_CMD}
 
 .c.po:
${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o 
${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .c.So:
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o 
${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .cc.o:
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -96,47 +85,33 @@ PO_FLAG=-pg
 
 .f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .f.So:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .s.po .s.So:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .asm.po:
${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .asm.So:
${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .S.po:
${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 .S.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-.if !defined(NO_CTF)
-   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.endif
+   ${CTFCONVERT_CMD}
 
 all: objwarn
 
@@ -211,7 +186,7 @@ ${SHLIB_NAME}: ${SOBJS}
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
 .endif
-.if !defined(NO_CTF)
+.if defined(WITH_CTF)
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
 .endif
 .endif

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Nov 29 15:24:19 2011(r228136)
+++ head/share/mk/bsd.own.mkTue Nov 29 16:34:44 2011(r228137)
@@ -189,6 +189,12 @@ STRIP?=-s
 COMPRESS_CMD?= gzip -cn
 COMPRESS_EXT?= .gz
 
+.if defined(WITH_CTF)
+CTFCONVERT_CMD=${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.else
+CTFCONVERT_CMD=...
+.endif
+
 .if !defined(_WITHOUT_SRCCONF)
 #
 # Define MK_* variables (which are either yes or no) for users

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Tue Nov 29 15:24:19 2011(r228136)
+++ head/share/mk/bsd.prog.mk   Tue Nov 29 16:34:44 2011(r228137)
@@ -15,16 +15,11 @@ CFLAGS+= -DNDEBUG
 NO_WERROR=
 .endif
 
-# Enable CTF conversion on request.
-.if 

Re: svn commit: r228124 - in head: share/mk sys/conf

2011-11-29 Thread Max Khon
Alexander,

On Tue, Nov 29, 2011 at 9:00 PM, Alexander Kabaev kab...@gmail.com wrote:

 Author: fjoe
  Date: Tue Nov 29 08:38:47 2011
  New Revision: 228124
  URL: http://svn.freebsd.org/changeset/base/228124
 
  Log:
Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif)
  instead of executing a shell on every object or executable/library
  file.
This shaves off more than 30,000 shell invocations during
  buildworld.

 Have you looked as to _why_ it was done through shell invocation in the
 first place before removing it? You now have broken CTF support in
 cases where WITH_CTF is set not on make command line or in environment,
 but say in each individual Makefile.


I tested all the use-cases mentioned in the original commit but it looks
like I specified the location of modified share/mk incorrectly when I did
WITH_CTF userland tests.

Should be fixed now. Sorry for the breakage.

Max
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r227778 - head/sys/net

2011-11-29 Thread Jung-uk Kim
On Tuesday 29 November 2011 11:13 am, Lawrence Stewart wrote:
 On 11/30/11 00:05, Lawrence Stewart wrote:
  On 11/28/11 14:59, Benjamin Kaduk wrote:
  On Wed, 23 Nov 2011, Lawrence Stewart wrote:
  On 11/23/11 17:42, Julien Ridoux wrote:

 [snip]

  What is your favourite option?
 
  FreeBSD parlance is to ask what colour you would like to paint
  the bikeshed ;)
 
  As I've never experienced the pain John refers to, I'll defer
  to the wisdom of others on whether the proposed patch will
  create pain down the road. I think it's ok, but if consensus is
  8bytes per packet isn't going to break the bank, I guess we
  just go for it - but I guess I am cautious about this route as
  we can push a lot of packets per second through the stack.
 
  Since other people seem to be keeping quiet, I'll add that I'm
  in favor of just always adding the 8 bytes per packet.
 
  Julien and I discussed this at length today, and agree that for
  head, we'll add the new bh_ffcounter member to the BPF header
  unconditionally.
 
  Thanks to you and John for the input.
 
  I'm going to revert r227778 in order to start form a clean slate,
  and add two separate patches. One will reintegrate FFCLOCK
  support with BPF without breaking the ABI. A follow up patch will
  bump the ffclock version and add the bh_ffcounter to the bpf
  header (after the timestamp member). Then a final patch will bump
  __FreeBSD_version and add a note to UPDATING about recompiling to
  get kernel/world in sync, which should seal the deal.

 Here's the first of the patches:

 http://people.freebsd.org/~lstewart/patches/misc/ffclock_bpf_intact
abi_10.x.r228130.patch

I only glanced at it but it looks very close to what I wanted to 
suggest.

Thanks!

Jung-uk Kim

 Julien, it's basically what you sent me today, but is against
 vanilla bpf.c/bpf.h (I decided at the last minute that reverting
 r227778 first was going to be cleaner and easier to follow).
 Relative to what you sent, it also has some tweaks to reduce the
 diff size, remove the unnecessary uses of
 BPF_T_FLAG()/BPF_T_FORMAT() and fix the (u_char *)mb buglet.

 If I don't hear any objections, I'll commit it tomorrow.

 Cheers,
 Lawrence
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228140 - head/sys/conf

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 18:52:02 2011
New Revision: 228140
URL: http://svn.freebsd.org/changeset/base/228140

Log:
  Do not echo ${CTFCONVERT} command: config(8) will be fixed to not
  emit '@' for ${NORMAL_CTFCONVERT} invocation.

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Tue Nov 29 18:23:08 2011(r228139)
+++ head/sys/conf/kern.pre.mk   Tue Nov 29 18:52:02 2011(r228140)
@@ -124,8 +124,7 @@ NORMAL_M= ${AWK} -f $S/tools/makeobjops.
  ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
 
 .if defined(WITH_CTF)
-CTFCONVERT_CMD=${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-NORMAL_CTFCONVERT= ${ECHO} ${CTFCONVERT_CMD}  ${CTFCONVERT_CMD}
+NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .else
 NORMAL_CTFCONVERT= :
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228141 - head/sys/conf

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 19:13:01 2011
New Revision: 228141
URL: http://svn.freebsd.org/changeset/base/228141

Log:
  Call CTFMERGE only when WITH_CTF is defined.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue Nov 29 18:52:02 2011(r228140)
+++ head/sys/conf/kmod.mk   Tue Nov 29 19:13:01 2011(r228141)
@@ -201,7 +201,7 @@ ${KMOD}.kld: ${OBJS}
 ${FULLPROG}: ${OBJS}
 .endif
${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS}
-.if !defined(NO_CTF)
+.if defined(WITH_CTF)
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
 .endif
 .if defined(EXPORT_SYMS)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228143 - in head: . share/mk tools/build/options

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 19:46:17 2011
New Revision: 228143
URL: http://svn.freebsd.org/changeset/base/228143

Log:
  Turn off profiled libs build by default.
  Can be enabled back using WITH_PROFILE=yes in /etc/src.conf

Added:
  head/tools/build/options/WITH_PROFILE
 - copied, changed from r227900, head/tools/build/options/WITHOUT_PROFILE
Deleted:
  head/tools/build/options/WITHOUT_PROFILE
Modified:
  head/Makefile.inc1
  head/share/mk/bsd.own.mk

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Nov 29 19:45:58 2011(r228142)
+++ head/Makefile.inc1  Tue Nov 29 19:46:17 2011(r228143)
@@ -239,7 +239,7 @@ BMAKE=  MAKEOBJDIRPREFIX=${WORLDTMP} \
BOOTSTRAPPING=${OSRELDATE} \
SSP_CFLAGS= \
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
-   -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
+   -DNO_PIC -DNO_PROFILE -DNO_SHARED \
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
 
 # build-tools stage
@@ -438,7 +438,7 @@ _libraries:
@echo --
${_+_}cd ${.CURDIR}; \
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-   -DWITHOUT_MAN -DWITHOUT_PROFILE libraries
+   -DWITHOUT_MAN -DNO_PROFILE libraries
 _depend:
@echo
@echo --
@@ -1321,8 +1321,8 @@ ${_lib}__PL: .PHONY
cd ${.CURDIR}/${_lib}; \
${MAKE} DIRPRFX=${_lib}/ obj; \
${MAKE} DIRPRFX=${_lib}/ depend; \
-   ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
-   ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
+   ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
+   ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
 .endif
 .endfor
 
@@ -1555,7 +1555,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE}
 .endif
 
 NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-   -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \
+   -DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \
-DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
CPUTYPE=${XDEV_CPUTYPE}

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Nov 29 19:45:58 2011(r228142)
+++ head/share/mk/bsd.own.mkTue Nov 29 19:46:17 2011(r228143)
@@ -388,7 +388,6 @@ __DEFAULT_YES_OPTIONS = \
 PMC \
 PORTSNAP \
 PPP \
-PROFILE \
 QUOTAS \
 RCMDS \
 RCS \
@@ -423,7 +422,8 @@ __DEFAULT_NO_OPTIONS = \
 ICONV \
 IDEA \
 LIBCPLUSPLUS \
-OFED
+OFED \
+PROFILE
 
 #
 # Default behaviour of some options depends on the architecture.  Unfortunately

Copied and modified: head/tools/build/options/WITH_PROFILE (from r227900, 
head/tools/build/options/WITHOUT_PROFILE)
==
--- head/tools/build/options/WITHOUT_PROFILEWed Nov 23 18:15:49 2011
(r227900, copy source)
+++ head/tools/build/options/WITH_PROFILE   Tue Nov 29 19:46:17 2011
(r228143)
@@ -1,2 +1,2 @@
 .\ $FreeBSD$
-Set to avoid compiling profiled libraries.
+Set to build profiled libraries.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228147 - head/share/mk

2011-11-29 Thread Max Khon
Author: fjoe
Date: Tue Nov 29 20:06:27 2011
New Revision: 228147
URL: http://svn.freebsd.org/changeset/base/228147

Log:
  CTFCONVERT_CMD=... hack does not work sufficiently well in parallel builds.
  
  Put a bandaid until make(1) is taught to ignore empty commands.

Modified:
  head/share/mk/bsd.own.mk

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkTue Nov 29 19:49:11 2011(r228146)
+++ head/share/mk/bsd.own.mkTue Nov 29 20:06:27 2011(r228147)
@@ -192,7 +192,7 @@ COMPRESS_EXT?=  .gz
 .if defined(WITH_CTF)
 CTFCONVERT_CMD=${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .else
-CTFCONVERT_CMD=...
+CTFCONVERT_CMD=@:
 .endif
 
 .if !defined(_WITHOUT_SRCCONF)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228143 - in head: . share/mk tools/build/options

2011-11-29 Thread John Baldwin
On Tuesday, November 29, 2011 2:46:17 pm Max Khon wrote:
 Author: fjoe
 Date: Tue Nov 29 19:46:17 2011
 New Revision: 228143
 URL: http://svn.freebsd.org/changeset/base/228143
 
 Log:
   Turn off profiled libs build by default.
   Can be enabled back using WITH_PROFILE=yes in /etc/src.conf

Hmm, was discussed anywhere?  (I haven't seen it if so, but am a bit behind on 
a few lists from last week still.)  Also, it seems you are hacking on several 
build-related things currently, is there a larger project you are working on 
to reduce build world times or some such?

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228143 - in head: . share/mk tools/build/options

2011-11-29 Thread Gábor Kövesdán

On 2011.11.29. 20:46, Max Khon wrote:

Log:
   Turn off profiled libs build by default.
   Can be enabled back using WITH_PROFILE=yes in /etc/src.conf
I think it was useful. Profiling is useful for developing any piece of 
software that builds on libc or other common libs, even for software 
that is not directly related to FreeBSD. I think it should be reverted.


Gabor
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228143 - in head: . share/mk tools/build/options

2011-11-29 Thread Doug Barton
On 11/29/2011 12:47, Gábor Kövesdán wrote:
 On 2011.11.29. 20:46, Max Khon wrote:
 Log:
Turn off profiled libs build by default.
Can be enabled back using WITH_PROFILE=yes in /etc/src.conf
 I think it was useful. Profiling is useful for developing any piece of
 software that builds on libc or other common libs, even for software
 that is not directly related to FreeBSD. I think it should be reverted.

Since we ask users to read -current, it would be useful if our
developers did too. :)

As Max pointed out in his message about this, the profiled libs are only
really useful to a tiny percentage of developers. If you need them,
twist the knob. Building them should be off by default.


Doug

-- 

We could put the whole Internet into a book.
Too practical.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228143 - in head: . share/mk tools/build/options

2011-11-29 Thread Garrett Cooper
2011/11/29 Doug Barton do...@freebsd.org:
 On 11/29/2011 12:47, Gábor Kövesdán wrote:
 On 2011.11.29. 20:46, Max Khon wrote:
 Log:
    Turn off profiled libs build by default.
    Can be enabled back using WITH_PROFILE=yes in /etc/src.conf
 I think it was useful. Profiling is useful for developing any piece of
 software that builds on libc or other common libs, even for software
 that is not directly related to FreeBSD. I think it should be reverted.

 Since we ask users to read -current, it would be useful if our
 developers did too. :)

 As Max pointed out in his message about this, the profiled libs are only
 really useful to a tiny percentage of developers. If you need them,
 twist the knob. Building them should be off by default.

+1. The needs of the many outweigh the needs of the few. As suggested
elsewhere, I think it would also be a good idea to enable it in
tinderbox builds.
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228124 - in head: share/mk sys/conf

2011-11-29 Thread Alexander Leidinger
Hi,

did you verify that this works with settings in src.conf for buildworld and for 
corresponding makeoptions in the kernel config for buildkernel and for the old 
way of building kernels?

The reason we had the shell conditionals was because we didn't manage to get 
all cases working with make conditionals due to the evaluation order of the 
various files.

Bye,
Alexander.

-- 
Send via an Android device, please forgive brevity and typographic and spelling 
errors. Max Khon f...@freebsd.org hat geschrieben:Author: fjoe
Date: Tue Nov 29 08:38:47 2011
New Revision: 228124
URL: http://svn.freebsd.org/changeset/base/228124

Log:
  Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead
  of executing a shell on every object or executable/library file.
  
  This shaves off more than 30,000 shell invocations during buildworld.

Modified:
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.prog.mk
  head/share/mk/sys.mk
  head/sys/conf/kern.post.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Nov 29 08:33:40 2011(r228123)
+++ head/share/mk/bsd.lib.mkTue Nov 29 08:38:47 2011(r228124)
@@ -75,15 +75,15 @@ PO_FLAG=-pg

.c.po:
${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.c.So:
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.cc.o:
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@@ -96,47 +96,47 @@ PO_FLAG=-pg

.f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.f.So:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.s.po .s.So:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.asm.po:
${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.asm.So:
${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
    -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.S.po:
${CC} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

.S.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
-   @[ -z ${CTFCONVERT} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
-${CTFCONVERT} ${CTFFLAGS} ${.TARGET})
+.if !defined(NO_CTF)
+   ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.endif

all: objwarn

@@ -211,9 +211,9 @@ ${SHLIB_NAME}: ${SOBJS}
    -o ${.TARGET} -Wl,-soname,${SONAME} \
    `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
.endif
-   @[ -z ${CTFMERGE} -o -n ${NO_CTF} ] || \
-(${ECHO} ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}  \
-${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS})
+.if !defined(NO_CTF)
+   ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
+.endif
.endif

.if defined(INSTALL_PIC_ARCHIVE)  defined(LIB)  !empty(LIB)  
${MK_TOOLCHAIN} != no

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Tue Nov 29 08:33:40 2011(r228123)
+++ head/share/mk/bsd.prog.mk   Tue Nov 29 08:38:47 2011(r228124)
@@ 

svn commit: r228148 - head/sys/conf

2011-11-29 Thread John Baldwin
Author: jhb
Date: Tue Nov 29 21:28:48 2011
New Revision: 228148
URL: http://svn.freebsd.org/changeset/base/228148

Log:
  Remove a bit of debugging that accidentally crept in earlier.

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shTue Nov 29 20:06:27 2011(r228147)
+++ head/sys/conf/newvers.shTue Nov 29 21:28:48 2011(r228148)
@@ -99,7 +99,6 @@ for dir in /bin /usr/bin /usr/local/bin;
 done
 
 if [ -n $svnversion ] ; then
-   echo $svnversion
svn=`cd ${SYSDIR}  $svnversion`
case $svn in
[0-9]*) svn= r${svn} ;;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228149 - in head/tools/regression/usr.bin/make/execution: . ellipsis empty plus

2011-11-29 Thread Max Khon
Author: fjoe
Date: Wed Nov 30 05:49:17 2011
New Revision: 228149
URL: http://svn.freebsd.org/changeset/base/228149

Log:
  Add three execution tests for make(1):
  - plus: execute +command when run with -jX -n
  - ellipsis: ellipsis (...) from variable
  - empty: empty command (from variable)
  
  Currently make(1) fails all three tests:
  - plus: segmentation fault due to incorrect command list handling
  - ellipsis: works in compat mode but fails in job (-jX) mode
  - empty:
  - compat mode: prints error message
- job mode: works but prints empty string

Added:
  head/tools/regression/usr.bin/make/execution/
  head/tools/regression/usr.bin/make/execution/ellipsis/
  head/tools/regression/usr.bin/make/execution/ellipsis/Makefile   (contents, 
props changed)
  head/tools/regression/usr.bin/make/execution/ellipsis/expected.status.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/ellipsis/expected.stderr.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/ellipsis/expected.stdout.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/ellipsis/test.t   (contents, 
props changed)
  head/tools/regression/usr.bin/make/execution/empty/
  head/tools/regression/usr.bin/make/execution/empty/Makefile   (contents, 
props changed)
  head/tools/regression/usr.bin/make/execution/empty/expected.status.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/empty/expected.stderr.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/empty/expected.stdout.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/empty/test.t   (contents, props 
changed)
  head/tools/regression/usr.bin/make/execution/plus/
  head/tools/regression/usr.bin/make/execution/plus/Makefile   (contents, props 
changed)
  head/tools/regression/usr.bin/make/execution/plus/expected.status.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/plus/expected.stderr.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/plus/expected.stdout.1   
(contents, props changed)
  head/tools/regression/usr.bin/make/execution/plus/test.t   (contents, props 
changed)

Added: head/tools/regression/usr.bin/make/execution/ellipsis/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/make/execution/ellipsis/Makefile  Wed Nov 
30 05:49:17 2011(r228149)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+ELLIPSIS=  ...
+
+check-ellipsis:
+   @${MAKE} -f ${MAKEFILE} do-$@
+   @${MAKE} -f ${MAKEFILE} -j2 do-$@
+   @${MAKE} -f ${MAKEFILE} -j2 -B do-$@
+
+do-check-ellipsis: do-check-ellipsis-1 do-check-ellipsis-2
+.ORDER: do-check-ellipsis-1 do-check-ellipsis-2
+
+do-check-ellipsis-1:
+   @echo before $@
+   ${ELLIPSIS}
+   @echo after $@
+
+do-check-ellipsis-2:
+   @echo before $@
+   ${ELLIPSIS}
+   @echo after $@

Added: head/tools/regression/usr.bin/make/execution/ellipsis/expected.status.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/make/execution/ellipsis/expected.status.1 
Wed Nov 30 05:49:17 2011(r228149)
@@ -0,0 +1 @@
+0

Added: head/tools/regression/usr.bin/make/execution/ellipsis/expected.stderr.1
==

Added: head/tools/regression/usr.bin/make/execution/ellipsis/expected.stdout.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/make/execution/ellipsis/expected.stdout.1 
Wed Nov 30 05:49:17 2011(r228149)
@@ -0,0 +1,12 @@
+before do-check-ellipsis-1
+before do-check-ellipsis-2
+after do-check-ellipsis-1
+after do-check-ellipsis-2
+before do-check-ellipsis-1
+before do-check-ellipsis-2
+after do-check-ellipsis-1
+after do-check-ellipsis-2
+before do-check-ellipsis-1
+before do-check-ellipsis-2
+after do-check-ellipsis-1
+after do-check-ellipsis-2

Added: head/tools/regression/usr.bin/make/execution/ellipsis/test.t
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/make/execution/ellipsis/test.tWed Nov 
30 05:49:17 2011(r228149)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+cd `dirname $0`
+. ../../common.sh
+
+# Description
+DESC=Ellipsis command from variable
+
+# Run
+TEST_N=1
+TEST_1=
+
+eval_cmd $*

Added: head/tools/regression/usr.bin/make/execution/empty/Makefile
==
--- /dev/null   00:00:00 1970   (empty,