svn commit: r228150 - head/sys/contrib/pf/net

2011-11-30 Thread Gleb Smirnoff
Author: glebius
Date: Wed Nov 30 08:47:17 2011
New Revision: 228150
URL: http://svn.freebsd.org/changeset/base/228150

Log:
  Return value should be conditional on return value of pfsync_defer_ptr()
  
  PR:   kern/162947
  Submitted by: Matthieu Kraus 

Modified:
  head/sys/contrib/pf/net/pf.c

Modified: head/sys/contrib/pf/net/pf.c
==
--- head/sys/contrib/pf/net/pf.cWed Nov 30 05:49:17 2011
(r228149)
+++ head/sys/contrib/pf/net/pf.cWed Nov 30 08:47:17 2011
(r228150)
@@ -3770,8 +3770,8 @@ pf_test_rule(struct pf_rule **rm, struct
 * replies through it.
 */
 #ifdef __FreeBSD__
-   if (pfsync_defer_ptr != NULL)
-   pfsync_defer_ptr(*sm, m);
+   if (pfsync_defer_ptr != NULL &&
+   pfsync_defer_ptr(*sm, m))
 #else
if (pfsync_defer(*sm, m))
 #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"


Re: svn commit: r227845 - head/sys/conf

2011-11-30 Thread René Ladan
2011/11/22 Luigi Rizzo :
> Author: luigi
> Date: Tue Nov 22 21:50:38 2011
> New Revision: 227845
> URL: http://svn.freebsd.org/changeset/base/227845
>
> Log:
>  forgot to merge NETMAP entries in sys/conf !
>
> Modified:
>  head/sys/conf/NOTES
>  head/sys/conf/files
>  head/sys/conf/options
>
> Modified: head/sys/conf/NOTES
> ==
> --- head/sys/conf/NOTES Tue Nov 22 21:49:29 2011        (r227844)
> +++ head/sys/conf/NOTES Tue Nov 22 21:50:38 2011        (r227845)
> @@ -799,6 +799,12 @@ device             sppp
>  #  option.  DHCP requires bpf.
>  device         bpf
>
> +#  The `netmap' device implements memory-mapped access to network
> +#  devices from userspace, enabling wire-speed packet capture and
> +#  generation even at 10Gbit/s. Requires support in the device
> +#  driver. Supported drivers are ixgbe, e1000, re.
> +device         netmap
> +
>  #  The `disc' device implements a minimal network interface,
>  #  which throws away all packets sent and never receives any.  It is
>  #  included for testing and benchmarking purposes.
>
> Modified: head/sys/conf/files
> ==
> --- head/sys/conf/files Tue Nov 22 21:49:29 2011        (r227844)
> +++ head/sys/conf/files Tue Nov 22 21:50:38 2011        (r227845)
> @@ -1507,6 +1507,7 @@ dev/mxge/mxge_rss_ethp_z8e.c      optional mx
>  dev/my/if_my.c                 optional my
>  dev/ncv/ncr53c500.c            optional ncv
>  dev/ncv/ncr53c500_pccard.c     optional ncv pccard
> +dev/netmap/netmap.c            optional netmap
>  dev/nge/if_nge.c               optional nge
>  dev/nxge/if_nxge.c             optional nxge
>  dev/nxge/xgehal/xgehal-device.c        optional nxge
>
> Modified: head/sys/conf/options
> ==
> --- head/sys/conf/options       Tue Nov 22 21:49:29 2011        (r227844)
> +++ head/sys/conf/options       Tue Nov 22 21:50:38 2011        (r227845)
> @@ -690,6 +690,7 @@ ISAPNP                      opt_isa.h
>
>  # various 'device presence' options.
>  DEV_BPF                        opt_bpf.h
> +DEV_NETMAP             opt_global.h
>  DEV_MCA                        opt_mca.h
>  DEV_CARP               opt_carp.h
>  DEV_SPLASH             opt_splash.h

I just noticed that head/sys/dev/netmap/head.diff still contains
these patches, so now it won't apply cleanly any longer.  Speaking of
which, is there an ETA for the rest of this patch?

Regards,
René
___
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: r228153 - head/usr.sbin/config

2011-11-30 Thread Max Khon
Author: fjoe
Date: Wed Nov 30 13:33:09 2011
New Revision: 228153
URL: http://svn.freebsd.org/changeset/base/228153

Log:
  Generate ${NORMAL_CTFCONVERT} invocation without '@' modifier:
  - ${NORMAL_CC} is also invoked without '@'
  - Userland CTF support was changed previously to echo ctfconvert invocations 
too

Modified:
  head/usr.sbin/config/mkmakefile.c

Modified: head/usr.sbin/config/mkmakefile.c
==
--- head/usr.sbin/config/mkmakefile.c   Wed Nov 30 12:47:36 2011
(r228152)
+++ head/usr.sbin/config/mkmakefile.c   Wed Nov 30 13:33:09 2011
(r228153)
@@ -774,7 +774,7 @@ do_rules(FILE *f)
fprintf(f, "\t%s\n", compilewith);
 
if (!(ftp->f_flags & NO_OBJ))
-   fprintf(f, "\t@${NORMAL_CTFCONVERT}\n\n");
+   fprintf(f, "\t${NORMAL_CTFCONVERT}\n\n");
else
fprintf(f, "\n");
}
___
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-30 Thread Max Khon
John,

On Wed, Nov 30, 2011 at 3:36 AM, John Baldwin  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.)


It was discussed in -current. Probably should have been discussed somewhere
else.


> 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?
>

Yes, I want to reduce build world times.

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: r228143 - in head: . share/mk tools/build/options

2011-11-30 Thread John Baldwin
On Wednesday, November 30, 2011 9:35:01 am Max Khon wrote:
> John,
> 
> On Wed, Nov 30, 2011 at 3:36 AM, John Baldwin  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.)
> 
> 
> It was discussed in -current. Probably should have been discussed somewhere
> else.

Nah, you were fine.  I was just behind on -current.

> > 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?
> >
> 
> Yes, I want to reduce build world times.

Ok, can you maybe send a more high-level e-mail of the other things you
have pending to current@ perhaps?  (If you have more stuff beyond this.)
The thread I saw on current@ only covered WITHOUT_PROFILE but didn't cover
the CTF changes or anything else, etc.

-- 
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"


svn commit: r228156 - in head/sys: fs/nfsclient fs/nwfs fs/smbfs kern nfsclient vm

2011-11-30 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 30 17:39:00 2011
New Revision: 228156
URL: http://svn.freebsd.org/changeset/base/228156

Log:
  Rename vm_page_set_valid() to vm_page_set_valid_range().
  The vm_page_set_valid() is the most reasonable name for the m->valid
  accessor.
  
  Reviewed by:  attilio, alc

Modified:
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nwfs/nwfs_io.c
  head/sys/fs/smbfs/smbfs_io.c
  head/sys/kern/uipc_shm.c
  head/sys/kern/vfs_bio.c
  head/sys/nfsclient/nfs_bio.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vnode_pager.c

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==
--- head/sys/fs/nfsclient/nfs_clbio.c   Wed Nov 30 17:36:01 2011
(r228155)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Wed Nov 30 17:39:00 2011
(r228156)
@@ -211,7 +211,7 @@ ncl_getpages(struct vop_getpages_args *a
 * Read operation filled a partial page.
 */
m->valid = 0;
-   vm_page_set_valid(m, 0, size - toff);
+   vm_page_set_valid_range(m, 0, size - toff);
KASSERT(m->dirty == 0,
("nfs_getpages: page %p is dirty", m));
} else {

Modified: head/sys/fs/nwfs/nwfs_io.c
==
--- head/sys/fs/nwfs/nwfs_io.c  Wed Nov 30 17:36:01 2011(r228155)
+++ head/sys/fs/nwfs/nwfs_io.c  Wed Nov 30 17:39:00 2011(r228156)
@@ -452,7 +452,7 @@ nwfs_getpages(ap)
("nwfs_getpages: page %p is dirty", m));
} else {
int nvalid = ((size + DEV_BSIZE - 1) - toff) & 
~(DEV_BSIZE - 1);
-   vm_page_set_valid(m, 0, nvalid);
+   vm_page_set_valid_range(m, 0, nvalid);
KASSERT((m->dirty & vm_page_bits(0, nvalid)) == 0,
("nwfs_getpages: page %p is dirty", m));
}

Modified: head/sys/fs/smbfs/smbfs_io.c
==
--- head/sys/fs/smbfs/smbfs_io.cWed Nov 30 17:36:01 2011
(r228155)
+++ head/sys/fs/smbfs/smbfs_io.cWed Nov 30 17:39:00 2011
(r228156)
@@ -509,7 +509,7 @@ smbfs_getpages(ap)
 * Read operation filled a partial page.
 */
m->valid = 0;
-   vm_page_set_valid(m, 0, size - toff);
+   vm_page_set_valid_range(m, 0, size - toff);
KASSERT(m->dirty == 0,
("smbfs_getpages: page %p is dirty", m));
} else {

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cWed Nov 30 17:36:01 2011(r228155)
+++ head/sys/kern/uipc_shm.cWed Nov 30 17:39:00 2011(r228156)
@@ -301,7 +301,7 @@ shm_dotruncate(struct shmfd *shmfd, off_
 * have been zeroed.  Some of these valid bits may
 * have already been set.
 */
-   vm_page_set_valid(m, base, size);
+   vm_page_set_valid_range(m, base, size);
 
/*
 * Round "base" to the next block boundary so that the

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Nov 30 17:36:01 2011(r228155)
+++ head/sys/kern/vfs_bio.c Wed Nov 30 17:39:00 2011(r228156)
@@ -3499,7 +3499,7 @@ vfs_page_set_valid(struct buf *bp, vm_oo
 * entire page.
 */
if (eoff > off)
-   vm_page_set_valid(m, off & PAGE_MASK, eoff - off);
+   vm_page_set_valid_range(m, off & PAGE_MASK, eoff - off);
 }
 
 /*
@@ -3662,7 +3662,7 @@ vfs_bio_set_valid(struct buf *bp, int ba
m = bp->b_pages[i];
if (n > size)
n = size;
-   vm_page_set_valid(m, base & PAGE_MASK, n);
+   vm_page_set_valid_range(m, base & PAGE_MASK, n);
base += n;
size -= n;
n = PAGE_SIZE;

Modified: head/sys/nfsclient/nfs_bio.c
==
--- head/sys/nfsclient/nfs_bio.cWed Nov 30 17:36:01 2011
(r228155)
+++ head/sys/nfsclient/nfs_bio.cWed Nov 30 17:39:00 2011
(r228156)
@@ -206,7 +206,7 @@ nfs_getpages(struct vop_getpages_args *a
 * Read operation filled a partial page.
 */
m->valid = 0;
-   vm_page_set_valid(m, 0, size - toff);
+   vm_page_set_va

svn commit: r228157 - head/usr.bin/make

2011-11-30 Thread Max Khon
Author: fjoe
Date: Wed Nov 30 18:07:38 2011
New Revision: 228157
URL: http://svn.freebsd.org/changeset/base/228157

Log:
  - Fix segmentation fault when running "+command" when run with -jX -n due
  to Compat_RunCommand() being called with `cmd' that is not on the 
node->commands
  list
  - Make ellipsis ("..." command) handling consistent: check for "..." command
  in job make after variables expansion to match compat make behavior
  - Fix empty command handling (after variables expansion and @+- modifiers
  are processed): now empty commands are ignored in compat make and are not
  printed in job make case
  - Bump MAKE_VERSION to 5-2011-11-30-0

Modified:
  head/usr.bin/make/Makefile
  head/usr.bin/make/job.c

Modified: head/usr.bin/make/Makefile
==
--- head/usr.bin/make/Makefile  Wed Nov 30 17:39:00 2011(r228156)
+++ head/usr.bin/make/Makefile  Wed Nov 30 18:07:38 2011(r228157)
@@ -10,7 +10,9 @@ SRCS= arch.c buf.c cond.c dir.c for.c ha
 
 NO_SHARED?=YES
 
-CFLAGS+=-DMAKE_VERSION=\"5200408120\"
+# Version has the RMMDDX format, where R is from RELENG_
+CFLAGS+=-DMAKE_VERSION=\"520300\"
+
 # There is no obvious performance improvement currently.
 # CFLAGS+=-DUSE_KQUEUE
 

Modified: head/usr.bin/make/job.c
==
--- head/usr.bin/make/job.c Wed Nov 30 17:39:00 2011(r228156)
+++ head/usr.bin/make/job.c Wed Nov 30 18:07:38 2011(r228157)
@@ -381,7 +381,7 @@ static int JobStart(GNode *, int, Job *)
 static void JobDoOutput(Job *, Boolean);
 static void JobInterrupt(int, int);
 static void JobRestartJobs(void);
-static int Compat_RunCommand(char *, struct GNode *);
+static int Compat_RunCommand(LstNode *, struct GNode *);
 
 static GNode   *curTarg = NULL;
 static GNode   *ENDNode;
@@ -647,7 +647,7 @@ JobPassSig(int signo)
  * numCommands is incremented if the command is actually printed.
  */
 static int
-JobPrintCommand(char *cmd, Job *job)
+JobPrintCommand(LstNode *cmdNode, Job *job)
 {
Boolean noSpecials; /* true if we shouldn't worry about
 * inserting special commands into
@@ -658,40 +658,30 @@ JobPrintCommand(char *cmd, Job *job)
 * off before printing the command
 * and need to turn it back on */
const char *cmdTemplate;/* Template to use when printing the command */
-   char*cmdStart;  /* Start of expanded command */
-   LstNode *cmdNode;   /* Node for replacing the command */
+   char*cmd;   /* Expanded command */
 
noSpecials = (noExecute && !(job->node->type & OP_MAKE));
 
-   if (strcmp(cmd, "...") == 0) {
-   job->node->type |= OP_SAVE_CMDS;
-   if ((job->flags & JOB_IGNDOTS) == 0) {
-   job->tailCmds =
-   Lst_Succ(Lst_Member(&job->node->commands, cmd));
-   return (1);
-   }
-   return (0);
-   }
-
 #defineDBPRINTF(fmt, arg)  \
DEBUGF(JOB, (fmt, arg));\
fprintf(job->cmdFILE, fmt, arg);\
fflush(job->cmdFILE);
 
-   numCommands += 1;
-
/*
 * For debugging, we replace each command with the result of expanding
 * the variables in the command.
 */
-   cmdNode = Lst_Member(&job->node->commands, cmd);
-
-   cmd = Buf_Peel(Var_Subst(cmd, job->node, FALSE));
-   cmdStart = cmd;
-
-   Lst_Replace(cmdNode, cmdStart);
-
-   cmdTemplate = "%s\n";
+   cmd = Buf_Peel(Var_Subst(Lst_Datum(cmdNode), job->node, FALSE));
+   if (strcmp(cmd, "...") == 0) {
+   free(cmd);
+   job->node->type |= OP_SAVE_CMDS;
+   if ((job->flags & JOB_IGNDOTS) == 0) {
+   job->tailCmds = Lst_Succ(cmdNode);
+   return (1);
+   }
+   return (0);
+   }
+   Lst_Replace(cmdNode, cmd);
 
/*
 * Check for leading @', -' or +'s to control echoing, error checking,
@@ -715,7 +705,7 @@ JobPrintCommand(char *cmd, Job *job)
 * but this one needs to be - use compat mode
 * just for it.
 */
-   Compat_RunCommand(cmd, job->node);
+   Compat_RunCommand(cmdNode, job->node);
return (0);
}
break;
@@ -726,6 +716,16 @@ JobPrintCommand(char *cmd, Job *job)
while (isspace((unsigned char)*cmd))
cmd++;
 
+   /*
+* Ignore empty commands
+*/
+   if (*cmd == '\0') {
+   return (0);
+   }
+
+   cmdTemplate = "%s\n";
+   numC

svn commit: r228158 - in head: . share/mk sys/conf

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

Log:
  - CTF knob is now implemented using common scheme: MK_CTF=yes/no is
  defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
  NO_CTF overrides WITH_CTF (used by Makefile.inc1)
  - CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
  if make(1) can handle empty commands

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

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Nov 30 18:07:38 2011(r228157)
+++ head/Makefile.inc1  Wed Nov 30 18:11:49 2011(r228158)
@@ -59,8 +59,6 @@ SUBDIR+=games
 .endif
 .if ${MK_CDDL} != "no"
 SUBDIR+=cddl
-.else
-NO_CTF=1
 .endif
 SUBDIR+=gnu include
 .if ${MK_KERBEROS} != "no"

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkWed Nov 30 18:07:38 2011(r228157)
+++ head/share/mk/bsd.lib.mkWed Nov 30 18:11:49 2011(r228158)
@@ -36,7 +36,7 @@ NO_WERROR=
 .if defined(DEBUG_FLAGS)
 CFLAGS+= ${DEBUG_FLAGS}
 
-.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "")
+.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
 CTFFLAGS+= -g
 .endif
 .endif
@@ -186,7 +186,7 @@ ${SHLIB_NAME}: ${SOBJS}
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
 .endif
-.if defined(WITH_CTF)
+.if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS}
 .endif
 .endif

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkWed Nov 30 18:07:38 2011(r228157)
+++ head/share/mk/bsd.own.mkWed Nov 30 18:11:49 2011(r228158)
@@ -189,12 +189,6 @@ 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
@@ -209,6 +203,7 @@ CTFCONVERT_CMD= @:
 # regardless of user's setting).
 #
 .for var in \
+CTF \
 INSTALLLIB \
 MAN \
 PROFILE
@@ -418,6 +413,7 @@ __DEFAULT_NO_OPTIONS = \
 BIND_LIBS \
 BIND_SIGCHASE \
 BIND_XML \
+CTF \
 HESIOD \
 ICONV \
 IDEA \
@@ -516,6 +512,7 @@ MK_BIND_ETC:=   no
 
 .if ${MK_CDDL} == "no"
 MK_ZFS:=   no
+MK_CTF:=   no
 .endif
 
 .if ${MK_CRYPT} == "no"
@@ -616,6 +613,14 @@ MK_${vv:H}:=   ${MK_${vv:T}}
 .endif
 .endfor
 
+.if ${MK_CTF} != "no"
+CTFCONVERT_CMD=${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.elif ${MAKE_VERSION} >= 520300
+CTFCONVERT_CMD=
+.else
+CTFCONVERT_CMD=@:
+.endif 
+
 .endif # !_WITHOUT_SRCCONF
 
 .endif # !target()

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Wed Nov 30 18:07:38 2011(r228157)
+++ head/share/mk/bsd.prog.mk   Wed Nov 30 18:11:49 2011(r228158)
@@ -19,7 +19,7 @@ NO_WERROR=
 CFLAGS+=${DEBUG_FLAGS}
 CXXFLAGS+=${DEBUG_FLAGS}
 
-.if defined(WITH_CTF) && (${DEBUG_FLAGS:M-g} != "")
+.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
 CTFFLAGS+= -g
 .endif
 .endif
@@ -55,7 +55,7 @@ ${PROG}: ${OBJS}
 .else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
 .endif
-.if defined(WITH_CTF)
+.if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
 .endif
 
@@ -85,7 +85,7 @@ ${PROG}: ${OBJS}
 .else
${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD}
 .endif
-.if defined(WITH_CTF)
+.if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS}
 .endif
 .endif

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Wed Nov 30 18:07:38 2011(r228157)
+++ head/sys/conf/kern.post.mk  Wed Nov 30 18:11:49 2011(r228158)
@@ -94,7 +94,7 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
@rm -f ${.TARGET}
@echo linking ${.TARGET}
${SYSTEM_LD}
-.if defined(WITH_CTF)
+.if ${MK_CTF} != "no"
${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
 .endif
 .if !defined(DEBUG)
@@ -249,7 +249,7 @@ kernel-reinstall:
 
 config.o env.o hints.o vers.o vnode_if.o:
${NORMAL_C}
-   @${NORMAL_CTFCONVERT}
+   ${NORMAL_CTFCONVERT}
 
 config.ln env.ln hints.ln vers.ln vnode_if.ln:
${NORMAL_LINT}

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Wed Nov 30 18:07:38 2011(r

svn commit: r228159 - head/tools/build/options

2011-11-30 Thread Max Khon
Author: fjoe
Date: Wed Nov 30 18:22:44 2011
New Revision: 228159
URL: http://svn.freebsd.org/changeset/base/228159

Log:
  Add WITH_CTF description.

Added:
  head/tools/build/options/WITH_CTF   (contents, props changed)

Added: head/tools/build/options/WITH_CTF
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_CTF   Wed Nov 30 18:22:44 2011
(r228159)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to compile with CTF (Compact C Type Format) data.
+CTF data encapsulates a reduced form of debugging information
+similar to DWARF and the venerable stabs and is required for DTrace.
___
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: r228160 - head/share/man/man5

2011-11-30 Thread Max Khon
Author: fjoe
Date: Wed Nov 30 18:24:43 2011
New Revision: 228160
URL: http://svn.freebsd.org/changeset/base/228160

Log:
  Regen.

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Nov 30 18:22:44 2011
(r228159)
+++ head/share/man/man5/src.conf.5  Wed Nov 30 18:24:43 2011
(r228160)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z 
ru
 .\" $FreeBSD$
-.Dd November 28, 2011
+.Dd December 1, 2011
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -258,6 +258,8 @@ When set, it also enforces the following
 .Pp
 .Bl -item -compact
 .It
+.Va WITHOUT_CTF
+.It
 .Va WITHOUT_ZFS
 .El
 .It Va WITHOUT_CLANG
@@ -300,6 +302,11 @@ When set, the following options are also
 .Va WITH_GSSAPI
 is set explicitly)
 .El
+.It Va WITH_CTF
+.\" $FreeBSD$
+Set to compile with CTF (Compact C Type Format) data.
+CTF data encapsulates a reduced form of debugging information
+similar to DWARF and the venerable stabs and is required for DTrace.
 .It Va WITHOUT_CTM
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 
22:02:26Z sam
 Set to not build
@@ -813,9 +820,9 @@ and related files.
 Set to not build
 .Xr ppp 8
 and related programs.
-.It Va WITHOUT_PROFILE
-.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 156932 2006-03-21 
07:50:50Z ru
-Set to avoid compiling profiled libraries.
+.It Va WITH_PROFILE
+.\" from FreeBSD: head/tools/build/options/WITH_PROFILE 228143 2011-11-29 
19:46:17Z fjoe
+Set to build profiled libraries.
 .It Va WITHOUT_QUOTAS
 .\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 
22:02:26Z sam
 Set to not build
___
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: r228161 - head/sys/dev/pci

2011-11-30 Thread John Baldwin
Author: jhb
Date: Wed Nov 30 18:33:23 2011
New Revision: 228161
URL: http://svn.freebsd.org/changeset/base/228161

Log:
  Add a constant for the Advisory Non-Fatal Error bit in AER corrected error
  status and mask.

Modified:
  head/sys/dev/pci/pcireg.h

Modified: head/sys/dev/pci/pcireg.h
==
--- head/sys/dev/pci/pcireg.h   Wed Nov 30 18:24:43 2011(r228160)
+++ head/sys/dev/pci/pcireg.h   Wed Nov 30 18:33:23 2011(r228161)
@@ -715,6 +715,7 @@
 #definePCIM_AER_COR_BAD_DLLP   0x0080
 #definePCIM_AER_COR_REPLAY_ROLLOVER0x0100
 #definePCIM_AER_COR_REPLAY_TIMEOUT 0x1000
+#definePCIM_AER_COR_ADVISORY_NF_ERROR  0x2000
 #definePCIR_AER_COR_MASK   0x14/* Shares bits with COR_STATUS 
*/
 #definePCIR_AER_CAP_CONTROL0x18
 #definePCIM_AER_FIRST_ERROR_PTR0x001f
___
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: r228162 - head/sys/xen/evtchn

2011-11-30 Thread John Baldwin
Author: jhb
Date: Wed Nov 30 18:52:30 2011
New Revision: 228162
URL: http://svn.freebsd.org/changeset/base/228162

Log:
  Use C99 initializers for members of evtchn_devsw.
  
  Submitted by: arundel

Modified:
  head/sys/xen/evtchn/evtchn_dev.c

Modified: head/sys/xen/evtchn/evtchn_dev.c
==
--- head/sys/xen/evtchn/evtchn_dev.cWed Nov 30 18:33:23 2011
(r228161)
+++ head/sys/xen/evtchn/evtchn_dev.cWed Nov 30 18:52:30 2011
(r228162)
@@ -318,15 +318,14 @@ evtchn_close(struct cdev *dev, int flag,
 }
 
 static struct cdevsw evtchn_devsw = {
-   d_version:   D_VERSION,
-   d_open:  evtchn_open,
-   d_close: evtchn_close,
-   d_read:  evtchn_read,
-   d_write: evtchn_write,
-   d_ioctl: evtchn_ioctl,
-   d_poll:  evtchn_poll,
-   d_name:  "evtchn",
-   d_flags: 0,
+   .d_version =D_VERSION,
+   .d_open =   evtchn_open,
+   .d_close =  evtchn_close,
+   .d_read =   evtchn_read,
+   .d_write =  evtchn_write,
+   .d_ioctl =  evtchn_ioctl,
+   .d_poll =   evtchn_poll,
+   .d_name =   "evtchn",
 };
 
 
___
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: r228163 - head

2011-11-30 Thread Jaakko Heinonen
Author: jh
Date: Wed Nov 30 20:08:30 2011
New Revision: 228163
URL: http://svn.freebsd.org/changeset/base/228163

Log:
  Add an entry for r227823.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 30 18:52:30 2011(r228162)
+++ head/UPDATING   Wed Nov 30 20:08:30 2011(r228163)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+2022:
+   The acpi_wmi(4) status device /dev/wmistat has been renamed to
+   /dev/wmistat0.
+
 2008:
The option VFS_ALLOW_NONMPSAFE option has been added in order to
explicitely support non-MPSAFE filesystems.
___
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: r226042 - in head/sys: kern sys

2011-11-30 Thread Giovanni Trematerra
On Wed, Oct 5, 2011 at 6:56 PM, Konstantin Belousov  wrote:
> Author: kib
> Date: Wed Oct  5 16:56:06 2011
> New Revision: 226042
> URL: http://svn.freebsd.org/changeset/base/226042
>
> Log:
>  Supply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes.
>
>  Reviewed by:  jhb, Peter Jeremy 
>  MFC after:    2 weeks
>
> Modified:
>  head/sys/kern/sys_pipe.c
>  head/sys/sys/pipe.h
>

Hi Konstantin,
unfortunately your commit introduces a performance penalty of about 3%
documented below in a real workload.
I guess that fstat(2) on the pipes is seldom used so we could just be lazy
and alloc a new unr number inside pipe_stat instead of during pipe creation.
In that case if an application doesn't need fstat(2) on the pipes it
won't be charged
the cost of alloc_unr/free_unr for the fake inode number.
The patch I propose, furthermore, fix a panic in the case alloc_unr
failed to allocate
a new unr number and return -1. This is because ino_t is unsigned and the test
pipe_ino > 0 into pipeclose would be true, calling then free_unr when
it hasn't to.
The proposed patch was tested with a regression test code that you can find here

http://www.trematerra.net/patches/pipe-fstat.c

Feel free to add it under tools/regression/pipe/

Here the proposed patch:

http://www.trematerra.net/patches/lazy_inoalloc.diff

Here the report of the benchmark:

Configuration
10.0-CURRENT updated to r22807.
kern.smp.disabled=1 in /boot/loader.conf
kernel config GENERIC without debugging options.

The first result of any test was discarded and not reported here.

here the result of three executions of
# make -s buildkernel
note that I managed to compile the same identical source files
for all the tests.

r22807 with r226042 reverted (time in seconds)
527, 527, 527

r22807 (time in seconds)
544, 544, 544

r22807M with the proposed patch (time in seconds)
527, 528, 528

ministat output:

x r22807 with r226042 reverted
+ r22807
* r22807M with the proposed patch
+--+
|+*   x|
|**   x|
||__A_M|  A|
+--+
N   Min   MaxMedian   AvgStddev
x   3   544   544   544   544 0
+   3   527   527   527   527 0
Difference at 95.0% confidence
-17 +/- 0
-3.125% +/- 0%
(Student's t, pooled s = 0)
*   3   527   528   528 527.70.57735027
Difference at 95.0% confidence
-16. +/- 0.925333
-3.00245% +/- 0.170098%
(Student's t, pooled s = 0.408248)

--
Gianni
___
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: r228157 - head/usr.bin/make

2011-11-30 Thread Alexander Best
On Wed Nov 30 11, Max Khon wrote:
> Author: fjoe
> Date: Wed Nov 30 18:07:38 2011
> New Revision: 228157
> URL: http://svn.freebsd.org/changeset/base/228157
> 
> Log:
>   - Fix segmentation fault when running "+command" when run with -jX -n due
>   to Compat_RunCommand() being called with `cmd' that is not on the 
> node->commands
>   list
>   - Make ellipsis ("..." command) handling consistent: check for "..." command
>   in job make after variables expansion to match compat make behavior
>   - Fix empty command handling (after variables expansion and @+- modifiers
>   are processed): now empty commands are ignored in compat make and are not
>   printed in job make case
>   - Bump MAKE_VERSION to 5-2011-11-30-0

it would also be nice, if at some point, somebody could dive into the code to
see why 'make buildkernel' will let clang produce coloured output, but
'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that command
fixes it).

cheers.
alex

> 
> Modified:
>   head/usr.bin/make/Makefile
>   head/usr.bin/make/job.c
> 
> Modified: head/usr.bin/make/Makefile
> ==
> --- head/usr.bin/make/MakefileWed Nov 30 17:39:00 2011
> (r228156)
> +++ head/usr.bin/make/MakefileWed Nov 30 18:07:38 2011
> (r228157)
> @@ -10,7 +10,9 @@ SRCS=   arch.c buf.c cond.c dir.c for.c ha
>  
>  NO_SHARED?=  YES
>  
> -CFLAGS+=-DMAKE_VERSION=\"5200408120\"
> +# Version has the RMMDDX format, where R is from RELENG_
> +CFLAGS+=-DMAKE_VERSION=\"520300\"
> +
>  # There is no obvious performance improvement currently.
>  # CFLAGS+=-DUSE_KQUEUE
>  
> 
> Modified: head/usr.bin/make/job.c
> ==
> --- head/usr.bin/make/job.c   Wed Nov 30 17:39:00 2011(r228156)
> +++ head/usr.bin/make/job.c   Wed Nov 30 18:07:38 2011(r228157)
> @@ -381,7 +381,7 @@ static int JobStart(GNode *, int, Job *)
>  static void JobDoOutput(Job *, Boolean);
>  static void JobInterrupt(int, int);
>  static void JobRestartJobs(void);
> -static int Compat_RunCommand(char *, struct GNode *);
> +static int Compat_RunCommand(LstNode *, struct GNode *);
>  
>  static GNode *curTarg = NULL;
>  static GNode *ENDNode;
> @@ -647,7 +647,7 @@ JobPassSig(int signo)
>   *   numCommands is incremented if the command is actually printed.
>   */
>  static int
> -JobPrintCommand(char *cmd, Job *job)
> +JobPrintCommand(LstNode *cmdNode, Job *job)
>  {
>   Boolean noSpecials; /* true if we shouldn't worry about
>* inserting special commands into
> @@ -658,40 +658,30 @@ JobPrintCommand(char *cmd, Job *job)
>* off before printing the command
>* and need to turn it back on */
>   const char *cmdTemplate;/* Template to use when printing the command */
> - char*cmdStart;  /* Start of expanded command */
> - LstNode *cmdNode;   /* Node for replacing the command */
> + char*cmd;   /* Expanded command */
>  
>   noSpecials = (noExecute && !(job->node->type & OP_MAKE));
>  
> - if (strcmp(cmd, "...") == 0) {
> - job->node->type |= OP_SAVE_CMDS;
> - if ((job->flags & JOB_IGNDOTS) == 0) {
> - job->tailCmds =
> - Lst_Succ(Lst_Member(&job->node->commands, cmd));
> - return (1);
> - }
> - return (0);
> - }
> -
>  #define  DBPRINTF(fmt, arg)  \
>   DEBUGF(JOB, (fmt, arg));\
>   fprintf(job->cmdFILE, fmt, arg);\
>   fflush(job->cmdFILE);
>  
> - numCommands += 1;
> -
>   /*
>* For debugging, we replace each command with the result of expanding
>* the variables in the command.
>*/
> - cmdNode = Lst_Member(&job->node->commands, cmd);
> -
> - cmd = Buf_Peel(Var_Subst(cmd, job->node, FALSE));
> - cmdStart = cmd;
> -
> - Lst_Replace(cmdNode, cmdStart);
> -
> - cmdTemplate = "%s\n";
> + cmd = Buf_Peel(Var_Subst(Lst_Datum(cmdNode), job->node, FALSE));
> + if (strcmp(cmd, "...") == 0) {
> + free(cmd);
> + job->node->type |= OP_SAVE_CMDS;
> + if ((job->flags & JOB_IGNDOTS) == 0) {
> + job->tailCmds = Lst_Succ(cmdNode);
> + return (1);
> + }
> + return (0);
> + }
> + Lst_Replace(cmdNode, cmd);
>  
>   /*
>* Check for leading @', -' or +'s to control echoing, error checking,
> @@ -715,7 +705,7 @@ JobPrintCommand(char *cmd, Job *job)
>* but this one needs to be - use compat mode
>* just for it.
>*/
> - Compat_RunCommand(cmd, job->node);
> +  

Re: svn commit: r228148 - head/sys/conf

2011-11-30 Thread Alexander Best
On Tue Nov 29 11, John Baldwin wrote:
> 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.sh  Tue Nov 29 20:06:27 2011(r228147)
> +++ head/sys/conf/newvers.sh  Tue 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`

any chance we could replace $svnversion with something like the following:

'svn info|grep ^Revision|sed 's/^Revision: //'' ?

this is much faster and the only downside seems to be the missing {MSP} at the
end.

running a standard hdd, svnversion takes almost half a minute, while the
command above finishes in < 0.1 seconds.

cheers.
alex

>   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"


Re: svn commit: r228148 - head/sys/conf

2011-11-30 Thread Garrett Cooper
On Wed, Nov 30, 2011 at 4:59 PM, Alexander Best  wrote:
> On Tue Nov 29 11, John Baldwin wrote:
>> 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.sh  Tue Nov 29 20:06:27 2011        (r228147)
>> +++ head/sys/conf/newvers.sh  Tue 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`
>
> any chance we could replace $svnversion with something like the following:
>
> 'svn info|grep ^Revision|sed 's/^Revision: //'' ?
>
> this is much faster and the only downside seems to be the missing {MSP} at the
> end.
>
> running a standard hdd, svnversion takes almost half a minute, while the
> command above finishes in < 0.1 seconds.

We already hashed over that in the last discussion. svnversion was
picked because it iterates over the entire tree and you know for an
absolute fact that it's running versions X-Y-Z, instead of the version
of the Makefile being X.
Thanks,
-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: r228157 - head/usr.bin/make

2011-11-30 Thread Max Khon
Alexander,

On Thu, Dec 1, 2011 at 7:16 AM, Alexander Best  wrote:

> Author: fjoe
> > Date: Wed Nov 30 18:07:38 2011
> > New Revision: 228157
> > URL: http://svn.freebsd.org/changeset/base/228157
> >
> > Log:
> >   - Fix segmentation fault when running "+command" when run with -jX -n
> due
> >   to Compat_RunCommand() being called with `cmd' that is not on the
> node->commands
> >   list
> >   - Make ellipsis ("..." command) handling consistent: check for "..."
> command
> >   in job make after variables expansion to match compat make behavior
> >   - Fix empty command handling (after variables expansion and @+-
> modifiers
> >   are processed): now empty commands are ignored in compat make and are
> not
> >   printed in job make case
> >   - Bump MAKE_VERSION to 5-2011-11-30-0
>
> it would also be nice, if at some point, somebody could dive into the code
> to
> see why 'make buildkernel' will let clang produce coloured output, but
> 'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that
> command
> fixes it).
>

This one is simple: job make (-jX) runs commands with stdin/stdout/stderr
redirected to pipes.
-B turns on compat mode for job make.

This can be demonstrated by running make with -jX or -jX -B with the
following Makefile:
--- cut here ---
all:
@if [ -t 1 ]; then echo "stdout is a tty"; else echo "stdout is not
a tty"; fi
--- cut here ---

If you really want to see colored output in -jX case you should teach clang
to output ANSI color sequences not only in isatty(1) case, but also
when MAKE_JOBS_FIFO environment variable is present (it is set when make
runs in job mode).

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: r228157 - head/usr.bin/make

2011-11-30 Thread Max Khon
Alexander,

On Thu, Dec 1, 2011 at 11:05 AM, Max Khon  wrote:

it would also be nice, if at some point, somebody could dive into the code
>> to
>> see why 'make buildkernel' will let clang produce coloured output, but
>> 'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that
>> command
>> fixes it).
>>
>
> This one is simple: job make (-jX) runs commands with stdin/stdout/stderr
> redirected to pipes.
> -B turns on compat mode for job make.
>
> This can be demonstrated by running make with -jX or -jX -B with the
> following Makefile:
> --- cut here ---
> all:
> @if [ -t 1 ]; then echo "stdout is a tty"; else echo "stdout is
> not a tty"; fi
> --- cut here ---
>
> If you really want to see colored output in -jX case you should teach
> clang to output ANSI color sequences not only in isatty(1) case, but also
> when MAKE_JOBS_FIFO environment variable is present (it is set when make
> runs in job mode).
>

This will not work for the cases when make(1) is itself redirected.
Something like attached patch should work, but it blocks sometimes in
"ttyout" state for some reason (needs more work).

Max
Index: usr.bin/make/Makefile
===
--- usr.bin/make/Makefile	(revision 228157)
+++ usr.bin/make/Makefile	(working copy)
@@ -7,6 +7,8 @@
 SRCS=	arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c	\
 	lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c	\
 	util.c var.c
+DPADD=	${LIBUTIL}
+LDADD=	-lutil
 
 NO_SHARED?=	YES
 
Index: usr.bin/make/job.c
===
--- usr.bin/make/job.c	(revision 228157)
+++ usr.bin/make/job.c	(working copy)
@@ -115,6 +115,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1798,8 +1799,13 @@
 		if (usePipes) {
 			int fd[2];
 
-			if (pipe(fd) == -1)
-Punt("Cannot create pipe: %s", strerror(errno));
+			if (isatty(1)) {
+if (openpty(fd, fd + 1, NULL, NULL, NULL) == -1)
+	Punt("Cannot open pty: %s", strerror(errno));
+			} else {
+if (pipe(fd) == -1)
+	Punt("Cannot create pipe: %s", strerror(errno));
+			}
 			job->inPipe = fd[0];
 			job->outPipe = fd[1];
 			fcntl(job->inPipe, F_SETFD, 1);
___
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: r228157 - head/usr.bin/make

2011-11-30 Thread Jan Beich
Max Khon  writes:

> On Thu, Dec 1, 2011 at 7:16 AM, Alexander Best  wrote:
>> it would also be nice, if at some point, somebody could dive into the code
>> to
>> see why 'make buildkernel' will let clang produce coloured output, but
>> 'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that
>> command
>> fixes it).
>>
>
> This one is simple: job make (-jX) runs commands with stdin/stdout/stderr
> redirected to pipes.
> -B turns on compat mode for job make.
>
> This can be demonstrated by running make with -jX or -jX -B with the
> following Makefile:
> --- cut here ---
> all:
> @if [ -t 1 ]; then echo "stdout is a tty"; else echo "stdout is not
> a tty"; fi
> --- cut here ---
>
> If you really want to see colored output in -jX case you should teach clang
> to output ANSI color sequences not only in isatty(1) case, but also
> when MAKE_JOBS_FIFO environment variable is present (it is set when make
> runs in job mode).

Any way to distinguish between `make -jX' connected to tty and `make
-jX' redirected to a file then? Otherwise, inconsistent coloring
is still there, e.g.

  $ make >&build.log
  $ make -j8 >&build.log

Index: contrib/llvm/tools/clang/lib/Driver/Tools.cpp
===
--- contrib/llvm/tools/clang/lib/Driver/Tools.cpp   (revision 228149)
+++ contrib/llvm/tools/clang/lib/Driver/Tools.cpp   (working copy)
@@ -2115,7 +2115,8 @@ void Clang::ConstructJob(Compilation &C, const Job
   // them.
   if (Args.hasFlag(options::OPT_fcolor_diagnostics,
options::OPT_fno_color_diagnostics,
-   llvm::sys::Process::StandardErrHasColors()))
+   llvm::sys::Process::StandardErrHasColors() ||
+   ::getenv("MAKE_JOBS_FIFO")))
 CmdArgs.push_back("-fcolor-diagnostics");
 
   if (!Args.hasFlag(options::OPT_fshow_source_location,
___
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: r228173 - in head/sys: kern sys

2011-11-30 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  1 07:19:13 2011
New Revision: 228173
URL: http://svn.freebsd.org/changeset/base/228173

Log:
  Revise the sysctl handling code and restructure the hierarchy of sysctls
  introduced when feed-forward clock support is enabled in the kernel:
  
  - Rename the "choice" variable to "available".
  
  - Streamline the implementation of the "active" variable's sysctl handler
function.
  
  - Create a kern.sysclock sysctl node for general sysclock related 
configuration
options. Place the "available" and "active" variables under this node.
  
  - Create a kern.sysclock.ffclock sysctl node for feed-forward clock specific
configuration options. Place the "version" and "ffcounter_bypass" variables
under this node.
  
  - Tweak some of the description strings.
  
  Discussed with:   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.cThu Dec  1 05:54:22 2011
(r228172)
+++ head/sys/kern/kern_ffclock.cThu Dec  1 07:19:13 2011
(r228173)
@@ -148,31 +148,33 @@ ffclock_difftime(ffcounter ffdelta, stru
 }
 
 /*
- * Sysctl for the Feed-Forward Clock.
+ * Create a new kern.sysclock sysctl node, which will be home to some generic
+ * sysclock configuration variables. Feed-forward clock specific variables will
+ * live under the ffclock subnode.
  */
 
-static int ffclock_version = 2;
-SYSCTL_NODE(_kern, OID_AUTO, ffclock, CTLFLAG_RW, 0,
-"Feed-Forward Clock Support");
-SYSCTL_INT(_kern_ffclock, OID_AUTO, version, CTLFLAG_RD, &ffclock_version, 0,
-"Version of Feed-Forward Clock Support");
-
-/*
- * Sysctl to select which clock is read when calling any of the
- * [get]{bin,nano,micro}[up]time() functions.
- */
-char *sysclocks[] = {"feedback", "feed-forward"};
+SYSCTL_NODE(_kern, OID_AUTO, sysclock, CTLFLAG_RW, 0,
+"System clock related configuration");
+SYSCTL_NODE(_kern_sysclock, OID_AUTO, ffclock, CTLFLAG_RW, 0,
+"Feed-forward clock configuration");
 
+static char *sysclocks[] = {"feedback", "feed-forward"};
+#defineMAX_SYSCLOCK_NAME_LEN 16
 #defineNUM_SYSCLOCKS (sizeof(sysclocks) / sizeof(*sysclocks))
 
-/* Report or change the active timecounter hardware. */
+static int ffclock_version = 2;
+SYSCTL_INT(_kern_sysclock_ffclock, OID_AUTO, version, CTLFLAG_RD,
+&ffclock_version, 0, "Feed-forward clock kernel version");
+
+/* List available sysclocks. */
 static int
-sysctl_kern_ffclock_choice(SYSCTL_HANDLER_ARGS)
+sysctl_kern_sysclock_available(SYSCTL_HANDLER_ARGS)
 {
struct sbuf *s;
int clk, error;
 
-   s = sbuf_new_for_sysctl(NULL, NULL, 16 * NUM_SYSCLOCKS, req);
+   s = sbuf_new_for_sysctl(NULL, NULL,
+   MAX_SYSCLOCK_NAME_LEN * NUM_SYSCLOCKS, req);
if (s == NULL)
return (ENOMEM);
 
@@ -187,47 +189,51 @@ sysctl_kern_ffclock_choice(SYSCTL_HANDLE
return (error);
 }
 
-SYSCTL_PROC(_kern_ffclock, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD,
-0, 0, sysctl_kern_ffclock_choice, "A", "Clock paradigms available");
+SYSCTL_PROC(_kern_sysclock, OID_AUTO, available, CTLTYPE_STRING | CTLFLAG_RD,
+0, 0, sysctl_kern_sysclock_available, "A",
+"List of available system clocks");
 
+/*
+ * Return the name of the active system clock if read, or attempt to change
+ * the active system clock to the user specified one if written to. The active
+ * system clock is read when calling any of the [get]{bin,nano,micro}[up]time()
+ * functions.
+ */
 static int
-sysctl_kern_ffclock_active(SYSCTL_HANDLER_ARGS)
+sysctl_kern_sysclock_active(SYSCTL_HANDLER_ARGS)
 {
-   char newclock[32];
-   int error;
+   char newclock[MAX_SYSCLOCK_NAME_LEN];
+   int clk, error;
 
-   switch (sysclock_active) {
-   case SYSCLOCK_FBCK:
-   strlcpy(newclock, sysclocks[SYSCLOCK_FBCK], sizeof(newclock));
-   break;
-   case SYSCLOCK_FFWD:
-   strlcpy(newclock, sysclocks[SYSCLOCK_FFWD], sizeof(newclock));
-   break;
+   if (req->newptr == NULL) {
+   /* Return the name of the current active sysclock. */
+   strlcpy(newclock, sysclocks[sysclock_active], sizeof(newclock));
+   error = sysctl_handle_string(oidp, newclock,
+   sizeof(newclock), req);
+   } else {
+   /* Change the active sysclock to the user specified one. */
+   error = EINVAL;
+   for (clk = 0; clk < NUM_SYSCLOCKS; clk++) {
+   if (strncmp((char *)req->newptr, sysclocks[clk],
+   strlen(sysclocks[clk])) == 0) {
+   sysclock_active = clk;
+   error = 0;
+   break;
+   }
+   }
}
 
-  

svn commit: r228174 - head/share/man/man4

2011-11-30 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  1 07:41:30 2011
New Revision: 228174
URL: http://svn.freebsd.org/changeset/base/228174

Log:
  Add a man page describing the feed-forward clock kernel support, including how
  to enable and configure the functionality.
  
  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)

Added:
  head/share/man/man4/ffclock.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Dec  1 07:19:13 2011
(r228173)
+++ head/share/man/man4/MakefileThu Dec  1 07:41:30 2011
(r228174)
@@ -123,6 +123,7 @@ MAN=aac.4 \
fdc.4 \
fdt.4 \
fdtbus.4 \
+   ffclock.4 \
firewire.4 \
fpa.4 \
fwe.4 \

Added: head/share/man/man4/ffclock.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/ffclock.4   Thu Dec  1 07:41:30 2011
(r228174)
@@ -0,0 +1,128 @@
+.\" Copyright (c) 2011 The University of Melbourne
+.\" All rights reserved.
+.\"
+.\" This documentation was written 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:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd December 1, 2011
+.Dt FFCLOCK 4
+.Os
+.Sh NAME
+.Nm FFCLOCK
+.Nd Feed-forward system clock
+.Sh SYNOPSIS
+.Cd options FFCLOCK
+.Sh DESCRIPTION
+The
+.Xr ntpd 8
+daemon has been the dominant solution for system clock synchronisation for many
+years, which has in turn influenced the design of the system clock.
+The ntpd daemon implements a feedback control algorithm which has been
+demonstrated to perform poorly in common use cases.
+.Pp
+Feed-forward clock synchronisation algorithms implemented by an appropriate
+daemon, in concert with the
+.Nm
+kernel support, have been shown to provide highly robust and accurate clock
+synchronisation.
+In addition to time keeping, the
+.Nm
+kernel mechanism provides new timestamping capabilities and the ability to
+use specialised clocks.
+Feed-forward synchronisation is also very well suited for virtualised
+environments, reducing the overhead of timekeeping in guests and ensuring
+continued smooth operation of the system clock during guest live migration.
+.Pp
+The
+.Nm
+kernel support provides feed-forward timestamping functions within the kernel
+and system calls to support feed-forward synchronisation daemons
+.Po see
+.Xr ffclock 2
+.Pc .
+.Ss Kernel Options
+The following kernel configuration options are related to
+.Nm :
+.Pp
+.Bl -tag -width ".Dv FFCLOCK" -compact
+.It Dv FFCLOCK
+Enable feed-forward clock support.
+.El
+.Ss Configuration
+When feed-forward clock support is compiled into the kernel, multiple system
+clocks become available to choose from.
+System clock configuration is possible via the
+.Va kern.sysclock
+.Xr sysctl 8
+tree which provides the following variables:
+.Bl -tag -width "" -offset indent
+.It Va kern.sysclock.active
+Name of the current active system clock which is serving time.
+Set to one of the names in
+.Va kern.sysclock.available
+in order to change the default active system clock.
+.It Va kern.sysclock.available
+

Re: svn commit: r228174 - head/share/man/man4

2011-11-30 Thread Doug Barton
On 11/30/2011 23:41, Lawrence Stewart wrote:
> +.\" Copyright (c) 2011 The University of Melbourne

Out of curiosity, if the foundation paid for the work, how is it that
the University of Melbourne gets to own the copyright?


-- 

"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: r228157 - head/usr.bin/make

2011-11-30 Thread Max Khon
Alexander,

On Thu, Dec 1, 2011 at 12:03 PM, Max Khon  wrote:

it would also be nice, if at some point, somebody could dive into the code
>>> to
>>> see why 'make buildkernel' will let clang produce coloured output, but
>>> 'make -j(N>1) buildkernel' doesn't (and why adding a -B switch to that
>>> command
>>> fixes it).
>>>
>>
>> This one is simple: job make (-jX) runs commands with stdin/stdout/stderr
>> redirected to pipes.
>> -B turns on compat mode for job make.
>>
>> This can be demonstrated by running make with -jX or -jX -B with the
>> following Makefile:
>> --- cut here ---
>> all:
>> @if [ -t 1 ]; then echo "stdout is a tty"; else echo "stdout is
>> not a tty"; fi
>> --- cut here ---
>>
>> If you really want to see colored output in -jX case you should teach
>> clang to output ANSI color sequences not only in isatty(1) case, but also
>> when MAKE_JOBS_FIFO environment variable is present (it is set when make
>> runs in job mode).
>>
>
> This will not work for the cases when make(1) is itself redirected.
> Something like attached patch should work, but it blocks sometimes in
> "ttyout" state for some reason (needs more work).
>

It hangs when tty_drain() is called when make(1) closes slave pty. Looks
like a race condition there when tty_wait() is called from tty_drain().

If I exchange pty master and slave hangs disappear. So attached patch works
for me.
It may add performance penalty but I think that the impact will be
negligible.

Max
Index: usr.bin/make/Makefile
===
--- usr.bin/make/Makefile	(revision 228157)
+++ usr.bin/make/Makefile	(working copy)
@@ -7,6 +7,8 @@
 SRCS=	arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c	\
 	lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c	\
 	util.c var.c
+DPADD=	${LIBUTIL}
+LDADD=	-lutil
 
 NO_SHARED?=	YES
 
Index: usr.bin/make/job.c
===
--- usr.bin/make/job.c	(revision 228157)
+++ usr.bin/make/job.c	(working copy)
@@ -115,6 +115,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1798,8 +1799,13 @@
 		if (usePipes) {
 			int fd[2];
 
-			if (pipe(fd) == -1)
-Punt("Cannot create pipe: %s", strerror(errno));
+			if (isatty(1)) {
+if (openpty(fd + 1, fd + 0, NULL, NULL, NULL) == -1)
+	Punt("Cannot open pty: %s", strerror(errno));
+			} else {
+if (pipe(fd) == -1)
+	Punt("Cannot create pipe: %s", strerror(errno));
+			}
 			job->inPipe = fd[0];
 			job->outPipe = fd[1];
 			fcntl(job->inPipe, F_SETFD, 1);
___
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"