Re: svn commit: r334604 - head/usr.bin/top

2018-06-04 Thread Bruce Evans

On Mon, 4 Jun 2018, Ian Lepore wrote:


On Mon, 2018-06-04 at 05:27 +, Eitan Adler wrote:

...
Log:
\xa0 top(1): some nitpicks
\xa0\xa0
\xa0 - prefer fully spelled names to "u_long"


Why? I though we preferred the u_char, u_int, u_long spellings in BSD
code? (I certainly prefer them, and I thought style(9) did too, but I
seem to be remembering that wrong).


u_foo is only prefered in system-y code (like top and the kernel).
However, top used to be portable and using u_foo in it just breaks
portability.  However2, u_foo was only used in the MD parts of top,
and was only used twice, and 1 of these uses is wrong (*).

Top doesn't suffer much from unsigned poisoning, so it has little need
for u_foo.  It mostly uses int, and that is mostly correct.  In the
old MD code (just machine.c), it used 'unsigned xxx' just 3 times,
and all 3 were wrong:
- unsigned int swap_delay.  swap_delay is boolean, but should have been
  int and not churned to bool.  It has not been churned.
- casts of len and nlen to unsigned long to print them in getsysctl().
  Although the values in these variables are or should be small, the
  variables need to have type size_t to use them conveniently with
  APIs like sysctl(3).  Then to print them, we bogusly cast them to
  unsigned long.  Old versions used the wrong format %d so were broken
  on non-32-bit arches, and instead of fixing this properly using %zu,
  the warning was broken by changing the format to %lu and casting to
  unsigned long.  unsigned long of course works unless the values are
  preposterous, and unsigned long is large enough for even preposterous
  values on all supported arches, but verifying this is more work than
  using %zu.  Casting to int to match the old format would also work
  for non-preposterous values.

  The bogus fix was committed in 2001.  I think libc supported %zu then
  theough this was not long after C99 standardized %zu.  top/machine.c is
  FreeBSD-only, so it should have used the unportable %zu.

(*) The use of u_long for swap_maxpages is correct.  This variable is read
from a kernel variable with type u_long using SYSCTL_ULONG().

The use of u_long for cpumask is now very wrong.  Originally, the correct
type was cpumask_t.  This was u_int even on amd64.  u_long was originally
only slightly wrong since it is larger than u_int and cpumask is populated
without asking the kernel what the CPUs are.  (This method was OK.  It
checks for activity on all CPU numbers between 0 and ncpus - 1.)  FreeBSD
had fancy cpusets implemented as of arrays of (signed) long when this was
new, but the kernel also used simple masks of type cpumask_t or worse, so
it was limited to 32 CPUs too.  Now the kernel can handle many more than
32 CPUs, but top can only handle 8 * sizeof(u_long) CPUs.  top's display
is also limited to 2-digit CPU numbers.

style(9) says nothing about this.  Its only literal match for either u_ or
unsigned is in a rule saying that the C99 spelling [for fixed-width types]
of uintXX_t should be used instead of the BSD spelling u_intXX_t.  It
hasn't suffered from unsigned poisoning and uses plain int in most
examples.  It doesn't even have much typedef poisoning or any examples or
many rules for foo_t.  Its only matches for _t are for u*_t as above, and
in a rule that allows churning bool_t to bool, and in a rule that says to
not use [private] typedefs ending in _t [because POSIX reserves names
ending in _t].

Bruce
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334649 - in head/sys: arm/conf arm64/conf

2018-06-04 Thread Kevin Lo
Author: kevlo
Date: Tue Jun  5 05:24:42 2018
New Revision: 334649
URL: https://svnweb.freebsd.org/changeset/base/334649

Log:
  Since we don't enable BUF_TRACKING and FULL_BUF_TRACKING buffer debugging
  options in GENERIC kernels on arm and arm64, there's no need to disable
  them.
  
  Sponsored by: MSI/FUNTORO

Modified:
  head/sys/arm/conf/GENERIC-NODEBUG
  head/sys/arm64/conf/GENERIC-NODEBUG

Modified: head/sys/arm/conf/GENERIC-NODEBUG
==
--- head/sys/arm/conf/GENERIC-NODEBUG   Tue Jun  5 05:19:04 2018
(r334648)
+++ head/sys/arm/conf/GENERIC-NODEBUG   Tue Jun  5 05:24:42 2018
(r334649)
@@ -34,7 +34,5 @@ nooptions   INVARIANTS
 nooptions   INVARIANT_SUPPORT
 nooptions   WITNESS
 nooptions   WITNESS_SKIPSPIN
-nooptions   BUF_TRACKING
 nooptions   DEADLKRES
-nooptions   FULL_BUF_TRACKING
 

Modified: head/sys/arm64/conf/GENERIC-NODEBUG
==
--- head/sys/arm64/conf/GENERIC-NODEBUG Tue Jun  5 05:19:04 2018
(r334648)
+++ head/sys/arm64/conf/GENERIC-NODEBUG Tue Jun  5 05:24:42 2018
(r334649)
@@ -34,7 +34,5 @@ nooptions   INVARIANTS
 nooptions   INVARIANT_SUPPORT
 nooptions   WITNESS
 nooptions   WITNESS_SKIPSPIN
-nooptions   BUF_TRACKING
 nooptions   DEADLKRES
-nooptions   FULL_BUF_TRACKING
 nooptions   USB_DEBUG
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334648 - in head/sys/dev/usb: . serial

2018-06-04 Thread Kevin Lo
Author: kevlo
Date: Tue Jun  5 05:19:04 2018
New Revision: 334648
URL: https://svnweb.freebsd.org/changeset/base/334648

Log:
  Add support for SIMCom SIM7600E.
  
  Sponsored by: MSI/FUNTORO

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Tue Jun  5 04:26:40 2018
(r334647)
+++ head/sys/dev/usb/serial/u3g.c   Tue Jun  5 05:19:04 2018
(r334648)
@@ -208,6 +208,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = {
U3G_DEV(ALINK, 3G, 0),
U3G_DEV(ALINK, 3GU, 0),
U3G_DEV(ALINK, DWM652U5, 0),
+   U3G_DEV(ALINK, SIM7600E, 0),
U3G_DEV(AMOI, H01, 0),
U3G_DEV(AMOI, H01A, 0),
U3G_DEV(AMOI, H02, 0),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Jun  5 04:26:40 2018(r334647)
+++ head/sys/dev/usb/usbdevsTue Jun  5 05:19:04 2018(r334648)
@@ -1022,6 +1022,7 @@ product ALCOR AU6390  0x6390  AU6390 USB-IDE converter
 /* Alink products */
 product ALINK DWM652U5 0xce16  DWM-652
 product ALINK 3G   0x9000  3G modem
+product ALINK SIM7600E 0x9001  LTE modem
 product ALINK 3GU  0x9200  3G modem
 
 /* Altec Lansing products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events

2018-06-04 Thread Kyle Evans
On Mon, Jun 4, 2018 at 10:11 PM, Kyle Evans  wrote:
> On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery  wrote:
>> Author: bdrewery
>> Date: Fri May 25 21:46:07 2018
>> New Revision: 334226
>> URL: https://svnweb.freebsd.org/changeset/base/334226
>>
>> Log:
>>   Cleanup style
>>
>> Modified:
>>   head/lib/libpmcstat/pmu-events/Makefile
>>
>> Modified: head/lib/libpmcstat/pmu-events/Makefile
>> ==
>> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2018 
>>(r334225)
>> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2018 
>>(r334226)
>> @@ -1,9 +1,10 @@
>>  # $FreeBSD$
>>
>> -PROG=jevents
>> -SRCS=jevents.c jsmn.c json.c
>> +PROG=  jevents
>> +SRCS=  jevents.c jsmn.c json.c
>>  CFLAGS+= -Wno-cast-qual
>> -.PATH: ${.CURDIR}
>> -build-tools: jevents
>>  MAN=
>> +
>> +build-tools: jevents
>> +
>>  .include 
>>
>
> Hi Bryan,
>
> Something about this appears to be subtly wrong, but I can't quite pin
> down what. I'm getting a failure in the lib32 build of libpmc:
>
> sh: ./pmu-events/jevents: not found
>
> My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents
> exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents.
> ${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and
> libpmc_events.c.meta. I'm guessing this is the problem- that
> obj-lib32/... doesn't have the built jevents, but it's not obvious to
> me why this is the case.

Some additional context:

SRCCONF is defined to a file that looks like this:

WITH_BSD_GREP="YES"
WITHOUT_BSD_GREP_FASTMATCH="YES"
WITH_LOADER_LUA="YES"
WITHOUT_FORTH="YES"

_SRC_ENV_CONF and __MAKE_CONF are set to /dev/null; all three set in
arguments to make(1). OBJDIR has been completely wiped before-hand.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334647 - in head: lib/libpmc sys/dev/hwpmc sys/kern sys/sys usr.sbin usr.sbin/pmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Tue Jun  5 04:26:40 2018
New Revision: 334647
URL: https://svnweb.freebsd.org/changeset/base/334647

Log:
  hwpmc: log name->pid, name->tid mappings
  
  By logging all threads and processes 'pmc filter'
  can now filter on process or thread name, relieving
  the user of the burden of determining which tid or
  pid was which when the sample was taken.
  
  % pmc filter -T if_io_tqg -P nginx pmc.log pmc-iflib.log
  
  % pmc filter -x -T idle pmc.log pmc-noidle.log

Added:
  head/usr.sbin/pmc/cmd_pmc_filter.cc
 - copied, changed from r334645, head/usr.sbin/pmc/cmd_pmc_filter.c
Deleted:
  head/usr.sbin/pmc/cmd_pmc_filter.c
Modified:
  head/lib/libpmc/pmclog.c
  head/lib/libpmc/pmclog.h
  head/sys/dev/hwpmc/hwpmc_logging.c
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/kern/kern_kthread.c
  head/sys/kern/kern_thr.c
  head/sys/kern/kern_thread.c
  head/sys/sys/pmc.h
  head/sys/sys/pmckern.h
  head/sys/sys/pmclog.h
  head/usr.sbin/Makefile
  head/usr.sbin/pmc/Makefile   (contents, props changed)
  head/usr.sbin/pmc/cmd_pmc.h   (contents, props changed)

Modified: head/lib/libpmc/pmclog.c
==
--- head/lib/libpmc/pmclog.cTue Jun  5 01:05:58 2018(r334646)
+++ head/lib/libpmc/pmclog.cTue Jun  5 04:26:40 2018(r334647)
@@ -404,6 +404,19 @@ pmclog_get_event(void *cookie, char **data, ssize_t *l
case PMCLOG_TYPE_USERDATA:
PMCLOG_READ32(le,ev->pl_u.pl_u.pl_userdata);
break;
+   case PMCLOG_TYPE_THR_CREATE:
+   PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_tid);
+   PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_pid);
+   PMCLOG_READ32(le,noop);
+   memcpy(ev->pl_u.pl_tc.pl_tdname, le, MAXCOMLEN+1);
+   break;
+   case PMCLOG_TYPE_THR_EXIT:
+   PMCLOG_READ32(le,ev->pl_u.pl_te.pl_tid);
+   break;
+   case PMCLOG_TYPE_PROC_CREATE:
+   PMCLOG_READ32(le,ev->pl_u.pl_pc.pl_pid);
+   memcpy(ev->pl_u.pl_pc.pl_pcomm, le, MAXCOMLEN+1);
+   break;
default:/* unknown record type */
ps->ps_state = PL_STATE_ERROR;
ev->pl_state = PMCLOG_ERROR;

Modified: head/lib/libpmc/pmclog.h
==
--- head/lib/libpmc/pmclog.hTue Jun  5 01:05:58 2018(r334646)
+++ head/lib/libpmc/pmclog.hTue Jun  5 04:26:40 2018(r334647)
@@ -120,6 +120,11 @@ struct pmclog_ev_proccsw {
pmc_value_t pl_value;
 };
 
+struct pmclog_ev_proccreate {
+   pid_t   pl_pid;
+   charpl_pcomm[MAXCOMLEN+1];
+};
+
 struct pmclog_ev_procexec {
pid_t   pl_pid;
pmc_id_tpl_pmcid;
@@ -142,6 +147,16 @@ struct pmclog_ev_sysexit {
pid_t   pl_pid;
 };
 
+struct pmclog_ev_threadcreate {
+   pid_t   pl_tid;
+   pid_t   pl_pid;
+   charpl_tdname[MAXCOMLEN+1];
+};
+
+struct pmclog_ev_threadexit {
+   pid_t   pl_tid;
+};
+
 struct pmclog_ev_userdata {
uint32_tpl_userdata;
 };
@@ -166,10 +181,13 @@ struct pmclog_ev {
struct pmclog_ev_pmcattach  pl_t;
struct pmclog_ev_pmcdetach  pl_d;
struct pmclog_ev_proccswpl_c;
+   struct pmclog_ev_proccreate pl_pc;
struct pmclog_ev_procexec   pl_x;
struct pmclog_ev_procexit   pl_e;
struct pmclog_ev_procfork   pl_f;
struct pmclog_ev_sysexitpl_se;
+   struct pmclog_ev_threadcreate   pl_tc;
+   struct pmclog_ev_threadexit pl_te;
struct pmclog_ev_userdata   pl_u;
} pl_u;
 };

Modified: head/sys/dev/hwpmc/hwpmc_logging.c
==
--- head/sys/dev/hwpmc/hwpmc_logging.c  Tue Jun  5 01:05:58 2018
(r334646)
+++ head/sys/dev/hwpmc/hwpmc_logging.c  Tue Jun  5 04:26:40 2018
(r334647)
@@ -229,7 +229,7 @@ static void pmclog_loop(void *arg);
 static void pmclog_release(struct pmc_owner *po);
 static uint32_t *pmclog_reserve(struct pmc_owner *po, int length);
 static void pmclog_schedule_io(struct pmc_owner *po, int wakeup);
-static void pmclog_schedule_all(struct pmc_owner *po);
+static void pmclog_schedule_all(struct pmc_owner *po, int force);
 static void pmclog_stop_kthread(struct pmc_owner *po);
 
 /*
@@ -808,7 +808,7 @@ pmclog_deconfigure_log(struct pmc_owner *po)
  */
 
 int
-pmclog_flush(struct pmc_owner *po)
+pmclog_flush(struct pmc_owner *po, int force)
 {
int error;
 
@@ -832,7 +832,7 @@ pmclog_flush(struct pmc_owner *po)
goto error;
}
 
-   pmclog_schedule_all(po);
+   pmclog_schedule_all(po, force);
  error:
mtx_unlock(_kthread_mtx);
 
@@ -840,9 +840,8 @@ 

Re: svn commit: r334226 - head/lib/libpmcstat/pmu-events

2018-06-04 Thread Kyle Evans
On Fri, May 25, 2018 at 4:46 PM, Bryan Drewery  wrote:
> Author: bdrewery
> Date: Fri May 25 21:46:07 2018
> New Revision: 334226
> URL: https://svnweb.freebsd.org/changeset/base/334226
>
> Log:
>   Cleanup style
>
> Modified:
>   head/lib/libpmcstat/pmu-events/Makefile
>
> Modified: head/lib/libpmcstat/pmu-events/Makefile
> ==
> --- head/lib/libpmcstat/pmu-events/Makefile Fri May 25 20:42:28 2018  
>   (r334225)
> +++ head/lib/libpmcstat/pmu-events/Makefile Fri May 25 21:46:07 2018  
>   (r334226)
> @@ -1,9 +1,10 @@
>  # $FreeBSD$
>
> -PROG=jevents
> -SRCS=jevents.c jsmn.c json.c
> +PROG=  jevents
> +SRCS=  jevents.c jsmn.c json.c
>  CFLAGS+= -Wno-cast-qual
> -.PATH: ${.CURDIR}
> -build-tools: jevents
>  MAN=
> +
> +build-tools: jevents
> +
>  .include 
>

Hi Bryan,

Something about this appears to be subtly wrong, but I can't quite pin
down what. I'm getting a failure in the lib32 build of libpmc:

sh: ./pmu-events/jevents: not found

My observations are that ${OBJDIR}/lib/libpmc/pmu-events/jevents
exists, as does ${SRCTOP}/lib/libpmc/pmu-events/jevents.
${OBJDIR}/obj-lib32/lib/libpmc, OTOH, only contains _INCSINS.meta and
libpmc_events.c.meta. I'm guessing this is the problem- that
obj-lib32/... doesn't have the built jevents, but it's not obvious to
me why this is the case.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Rodney W. Grimes
> On Mon, Jun 4, 2018, 8:47 PM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
> 
> > [ Charset ISO-8859-1 unsupported, converting... ]
> > > On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote:
> > > > >
> > > > > Author: pstef
> > > > > Date: Mon Jun??4 20:24:31 2018
> > > > > New Revision: 334630
> > > > > URL: https://svnweb.freebsd.org/changeset/base/334630
> > > > >
> > > > > Log:
> > > > > ? indent(1): remove static const char copyright[]
> > > > > ??
> > > > > ? It repeats what is already said in the heading comment and it's
> > optimized out
> > > > > ? so serves no purpose.
> > > > The purpose would be to put a copyright into the binary, and why that
> > is not
> > > > happening when the original authors intended that is not good.
> > > >
> > > > This is a regression, as 5.4p8 shows:
> > > > {108}% strings /usr/bin/indent | grep -i copy
> > > > bcopy
> > > > @(#) Copyright (c) 1985 Sun Microsystems, Inc.
> > > > @(#) Copyright (c) 1976 Board of Trustees of the University of
> > Illinois.
> > > > @(#) Copyright (c) 1980, 1993
> > > >
> > > > Please walk very very very carefully around all things "copyright".
> > > >
> > >
> > > Does it matter what the original author intended?
> > Yes, it does.
> >
> > > Nothing in the
> > > license text itself requires that copyright info be included in the
> > > binary (it just has to be in the docs and accompanying materials). So
> > > why would an edit to remove that from the binary be any different than
> > > any other edit to the code that any committer chooses to make?
> >
> > Because he deleted lines that contain the word "copyright"
> > and that is just a dangerious place to play.
> >
> 
> It looked fine to me. All the dates predate the adoption of the Berne
> Convention.

Which means exactly what?  That Berne does not apply, or does apply?

> Marking isn't needed anymore for a copyright.
Marking was needed at the time that copyright was applied, so that
marking should stay intact.

> The same text is
> earlier in the file. I'm not sure there is a problem here...

I dont make legal bets on "not sure", do you?

> Warner

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Warner Losh
On Mon, Jun 4, 2018, 8:47 PM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> [ Charset ISO-8859-1 unsupported, converting... ]
> > On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote:
> > > >
> > > > Author: pstef
> > > > Date: Mon Jun??4 20:24:31 2018
> > > > New Revision: 334630
> > > > URL: https://svnweb.freebsd.org/changeset/base/334630
> > > >
> > > > Log:
> > > > ? indent(1): remove static const char copyright[]
> > > > ??
> > > > ? It repeats what is already said in the heading comment and it's
> optimized out
> > > > ? so serves no purpose.
> > > The purpose would be to put a copyright into the binary, and why that
> is not
> > > happening when the original authors intended that is not good.
> > >
> > > This is a regression, as 5.4p8 shows:
> > > {108}% strings /usr/bin/indent | grep -i copy
> > > bcopy
> > > @(#) Copyright (c) 1985 Sun Microsystems, Inc.
> > > @(#) Copyright (c) 1976 Board of Trustees of the University of
> Illinois.
> > > @(#) Copyright (c) 1980, 1993
> > >
> > > Please walk very very very carefully around all things "copyright".
> > >
> >
> > Does it matter what the original author intended?
> Yes, it does.
>
> > Nothing in the
> > license text itself requires that copyright info be included in the
> > binary (it just has to be in the docs and accompanying materials). So
> > why would an edit to remove that from the binary be any different than
> > any other edit to the code that any committer chooses to make?
>
> Because he deleted lines that contain the word "copyright"
> and that is just a dangerious place to play.
>

It looked fine to me. All the dates predate the adoption of the Berne
Convention. Marking isn't needed anymore for a copyright. The same text is
earlier in the file. I'm not sure there is a problem here...

Warner

Warner

>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Rodney W. Grimes
[ Charset ISO-8859-1 unsupported, converting... ]
> On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote:
> > > 
> > > Author: pstef
> > > Date: Mon Jun??4 20:24:31 2018
> > > New Revision: 334630
> > > URL: https://svnweb.freebsd.org/changeset/base/334630
> > > 
> > > Log:
> > > ? indent(1): remove static const char copyright[]
> > > ??
> > > ? It repeats what is already said in the heading comment and it's 
> > > optimized out
> > > ? so serves no purpose.
> > The purpose would be to put a copyright into the binary, and why that is not
> > happening when the original authors intended that is not good.
> > 
> > This is a regression, as 5.4p8 shows:
> > {108}% strings /usr/bin/indent | grep -i copy
> > bcopy
> > @(#) Copyright (c) 1985 Sun Microsystems, Inc.
> > @(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.
> > @(#) Copyright (c) 1980, 1993
> > 
> > Please walk very very very carefully around all things "copyright".
> > 
> 
> Does it matter what the original author intended?
Yes, it does.

> Nothing in the
> license text itself requires that copyright info be included in the
> binary (it just has to be in the docs and accompanying materials). So
> why would an edit to remove that from the binary be any different than
> any other edit to the code that any committer chooses to make?

Because he deleted lines that contain the word "copyright"
and that is just a dangerious place to play.


-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Ian Lepore
On Mon, 2018-06-04 at 17:00 -0700, Rodney W. Grimes wrote:
> > 
> > Author: pstef
> > Date: Mon Jun  4 20:24:31 2018
> > New Revision: 334630
> > URL: https://svnweb.freebsd.org/changeset/base/334630
> > 
> > Log:
> >   indent(1): remove static const char copyright[]
> >   
> >   It repeats what is already said in the heading comment and it's optimized 
> > out
> >   so serves no purpose.
> The purpose would be to put a copyright into the binary, and why that is not
> happening when the original authors intended that is not good.
> 
> This is a regression, as 5.4p8 shows:
> {108}% strings /usr/bin/indent | grep -i copy
> bcopy
> @(#) Copyright (c) 1985 Sun Microsystems, Inc.
> @(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.
> @(#) Copyright (c) 1980, 1993
> 
> Please walk very very very carefully around all things "copyright".
> 

Does it matter what the original author intended? Nothing in the
license text itself requires that copyright info be included in the
binary (it just has to be in the docs and accompanying materials). So
why would an edit to remove that from the binary be any different than
any other edit to the code that any committer chooses to make?

-- Ian
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Rodney W. Grimes
> Author: pstef
> Date: Mon Jun  4 20:24:31 2018
> New Revision: 334630
> URL: https://svnweb.freebsd.org/changeset/base/334630
> 
> Log:
>   indent(1): remove static const char copyright[]
>   
>   It repeats what is already said in the heading comment and it's optimized 
> out
>   so serves no purpose.

The purpose would be to put a copyright into the binary, and why that is not
happening when the original authors intended that is not good.

This is a regression, as 5.4p8 shows:
{108}% strings /usr/bin/indent | grep -i copy
bcopy
@(#) Copyright (c) 1985 Sun Microsystems, Inc.
@(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.
@(#) Copyright (c) 1980, 1993

Please walk very very very carefully around all things "copyright".

> Modified:
>   head/usr.bin/indent/indent.c
> 
> Modified: head/usr.bin/indent/indent.c
> ==
> --- head/usr.bin/indent/indent.c  Mon Jun  4 20:21:51 2018
> (r334629)
> +++ head/usr.bin/indent/indent.c  Mon Jun  4 20:24:31 2018
> (r334630)
> @@ -35,14 +35,6 @@
>   * SUCH DAMAGE.
>   */
>  
> -#ifndef lint
> -static const char copyright[] =
> -"@(#) Copyright (c) 1985 Sun Microsystems, Inc.\n\
> -@(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.\n\
> -@(#) Copyright (c) 1980, 1993\n\
> - The Regents of the University of California.  All rights reserved.\n";
> -#endif /* not lint */
> -
>  #if 0
>  #ifndef lint
>  static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334645 - head/usr.sbin/cxgbetool

2018-06-04 Thread Navdeep Parhar
Author: np
Date: Mon Jun  4 23:17:18 2018
New Revision: 334645
URL: https://svnweb.freebsd.org/changeset/base/334645

Log:
  cxgbetool: Disallow negative values for numeric parameters.
  
  Sponsored by: Chelsio Communications

Modified:
  head/usr.sbin/cxgbetool/cxgbetool.c

Modified: head/usr.sbin/cxgbetool/cxgbetool.c
==
--- head/usr.sbin/cxgbetool/cxgbetool.c Mon Jun  4 22:39:22 2018
(r334644)
+++ head/usr.sbin/cxgbetool/cxgbetool.c Mon Jun  4 23:17:18 2018
(r334645)
@@ -606,31 +606,33 @@ static int
 parse_val_mask(const char *param, const char *args[], uint32_t *val,
 uint32_t *mask, int hashfilter)
 {
+   long l;
char *p;
 
if (strcmp(param, args[0]) != 0)
return (EINVAL);
 
-   *val = strtoul(args[1], , 0);
-   if (p > args[1]) {
-   if (p[0] == 0) {
-   *mask = ~0;
-   return (0);
-   }
+   p = str_to_number(args[1], , NULL);
+   if (l >= 0 && l <= UINT32_MAX) {
+   *val = (uint32_t)l;
+   if (p > args[1]) {
+   if (p[0] == 0) {
+   *mask = ~0;
+   return (0);
+   }
 
-   if (p[0] == ':' && p[1] != 0) {
-   if (hashfilter) {
-   warnx("param %s: mask not allowed for "
-   "hashfilter or nat params", param);
-   return (EINVAL);
+   if (p[0] == ':' && p[1] != 0) {
+   if (hashfilter) {
+   warnx("param %s: mask not allowed for "
+   "hashfilter or nat params", param);
+   return (EINVAL);
+   }
+   p = str_to_number(p + 1, , NULL);
+   if (l >= 0 && l <= UINT32_MAX && p[0] == 0) {
+   *mask = (uint32_t)l;
+   return (0);
+   }
}
-   *mask = strtoul(p+1, , 0);
-   if (p[0] == 0)
-   return (0);
-   } else {
-   warnx("param %s: mask not allowed for hashfilter",
-   param);
-   return (EINVAL);
}
}
 
@@ -767,16 +769,19 @@ static int
 parse_val(const char *param, const char *args[], uint32_t *val)
 {
char *p;
+   long l;
 
if (strcmp(param, args[0]) != 0)
return (EINVAL);
 
-   *val = strtoul(args[1], , 0);
-   if (p > args[1] && p[0] == 0)
-   return (0);
+   p = str_to_number(args[1], , NULL);
+   if (*p || l < 0 || l > UINT32_MAX) {
+   warnx("parameter \"%s\" has bad \"value\" %s", args[0], 
args[1]);
+   return (EINVAL);
+   }
 
-   warnx("parameter \"%s\" has bad \"value\" %s", args[0], args[1]);
-   return (EINVAL);
+   *val = (uint32_t)l;
+   return (0);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Crypto Connect

2018-06-04 Thread Shayla Ari
Hi

 

I hope all is well!

 

I found your company categorized under Bitcoin services. Quickly wanted to
check if you would be interested in High Net worth Individuals and Decision
Makers list Who Accepts Bitcoins as Payment Platform for their company?

 

We have 4,931 active companies 12,509 Decision Makers accepting Bitcoin
payment.

 

Each record in the list contains: - Contact Name, Job Title,
Company/Business Name, Complete Mailing Details, email, Tel/Fax Number,
Website/URL etc.

 

If you are interested, please let me know your thoughts, so that I can share
the sample file for your review.

 

I look forward to hearing from you.

 

Regards,

Shayla Ari,

Business Coordinator

 

If you wish to opt-out from our mailing list, reply as 'Unsubscribe" in the
subject line.

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


svn commit: r334644 - head/usr.sbin/pmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 22:39:22 2018
New Revision: 334644
URL: https://svnweb.freebsd.org/changeset/base/334644

Log:
  pmc stat: add debug option for intermediate state

Modified:
  head/usr.sbin/pmc/cmd_pmc_stat.c   (contents, props changed)

Modified: head/usr.sbin/pmc/cmd_pmc_stat.c
==
--- head/usr.sbin/pmc/cmd_pmc_stat.cMon Jun  4 22:26:47 2018
(r334643)
+++ head/usr.sbin/pmc/cmd_pmc_stat.cMon Jun  4 22:39:22 2018
(r334644)
@@ -244,11 +244,26 @@ pmc_stat_print_stat(struct rusage *ru)
uint64_t ticks, value;
int hz, i;
 
-   hz = getstathz();
-   ticks = hz * (ru->ru_utime.tv_sec + ru->ru_stime.tv_sec) +
-   hz * (ru->ru_utime.tv_usec + ru->ru_stime.tv_usec) / 100;
-   if (clock_gettime(CLOCK_MONOTONIC, ))
-   err(1, "clock_gettime");
+   if (ru) {
+   hz = getstathz();
+   ticks = hz * (ru->ru_utime.tv_sec + ru->ru_stime.tv_sec) +
+   hz * (ru->ru_utime.tv_usec + ru->ru_stime.tv_usec) / 
100;
+   if (clock_gettime(CLOCK_MONOTONIC, ))
+   err(1, "clock_gettime");
+   /*
+* If our round-off on the tick calculation still puts us at 0,
+* then always assume at least one tick.
+*/
+   if (ticks == 0)
+   ticks = 1;
+   fprintf(pmc_args.pa_printfile, "%16ld  %s\t\t#\t%02.03f 
M/sec\n",
+   ru->ru_minflt, "page faults", ((double)ru->ru_minflt / 
(double)ticks) / hz);
+   fprintf(pmc_args.pa_printfile, "%16ld  %s\t\t#\t%02.03f 
M/sec\n",
+   ru->ru_nvcsw, "voluntary csw", ((double)ru->ru_nvcsw / 
(double)ticks) / hz);
+   fprintf(pmc_args.pa_printfile, "%16ld  %s\t#\t%02.03f M/sec\n",
+   ru->ru_nivcsw, "involuntary csw", 
((double)ru->ru_nivcsw / (double)ticks) / hz);
+   }
+
bzero(, sizeof(cvals));
STAILQ_FOREACH(ev, _args.pa_events, ev_next) {
if (pmc_read(ev->ev_pmcid, ) < 0)
@@ -259,19 +274,6 @@ pmc_stat_print_stat(struct rusage *ru)
cvals[i] += value;
}
 
-   /*
-* If our round-off on the tick calculation still puts us at 0,
-* then always assume at least one tick.
-*/
-   if (ticks == 0)
-   ticks = 1;
-   fprintf(pmc_args.pa_printfile, "%16ld  %s\t\t#\t%02.03f M/sec\n",
-   ru->ru_minflt, "page faults", ((double)ru->ru_minflt / 
(double)ticks) / hz);
-   fprintf(pmc_args.pa_printfile, "%16ld  %s\t\t#\t%02.03f M/sec\n",
-   ru->ru_nvcsw, "voluntary csw", ((double)ru->ru_nvcsw / 
(double)ticks) / hz);
-   fprintf(pmc_args.pa_printfile, "%16ld  %s\t#\t%02.03f M/sec\n",
-   ru->ru_nivcsw, "involuntary csw", ((double)ru->ru_nivcsw / 
(double)ticks) / hz);
-
fprintf(pmc_args.pa_printfile, "%16jd  %s\n", (uintmax_t)cvals[CYCLES], 
stat_mode_names[CYCLES]);
fprintf(pmc_args.pa_printfile, "%16jd  %s\t\t#\t%01.03f inst/cycle\n", 
(uintmax_t)cvals[INST], stat_mode_names[INST],
(double)cvals[INST] / cvals[CYCLES]);
@@ -294,8 +296,8 @@ pmc_stat_print_stat(struct rusage *ru)
fprintf(pmc_args.pa_printfile, "\t\t#\t%.03f%%\n",
100 * ((double)cvals[CACHE_MISS] / cvals[CACHE]));
 
-
-   showtime(pmc_args.pa_printfile, _ts, , ru);
+   if (ru)
+   showtime(pmc_args.pa_printfile, _ts, , ru);
 }
 
 static struct option longopts[] = {
@@ -313,15 +315,18 @@ pmc_stat_internal(int argc, char **argv, int system_mo
struct winsize ws;
struct pmcstat_ev *ev;
int c, option, runstate;
-   int waitstatus, ru_valid;
+   int waitstatus, ru_valid, do_debug;
 
-   ru_valid = 0;
+   do_debug = ru_valid = 0;
r = event = NULL;
-   while ((option = getopt_long(argc, argv, "j:", longopts, NULL)) != -1) {
+   while ((option = getopt_long(argc, argv, "dj:", longopts, NULL)) != -1) 
{
switch (option) {
case 'j':
r = event = strdup(optarg);
break;
+   case 'd':
+   do_debug = 1;
+   break;
case '?':
default:
usage();
@@ -342,6 +347,10 @@ pmc_stat_internal(int argc, char **argv, int system_mo
EV_SET(, SIGIO, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL);
if (kevent(pmc_kq, , 1, NULL, 0, NULL) < 0)
err(EX_OSERR, "ERROR: Cannot register kevent for SIGIO");
+   EV_SET(, 0, EVFILT_TIMER, EV_ADD, 0, 1000, NULL);
+   if (kevent(pmc_kq, , 1, NULL, 0, NULL) < 0)
+   err(EX_OSERR,
+   "ERROR: Cannot register kevent for timer");
 
STAILQ_FOREACH(ev, _args.pa_events, ev_next) {
   

svn commit: r334643 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/utilities inc...

2018-06-04 Thread Jung-uk Kim
Author: jkim
Date: Mon Jun  4 22:26:47 2018
New Revision: 334643
URL: https://svnweb.freebsd.org/changeset/base/334643

Log:
  MFV:  r334448
  
  Import ACPICA 20180531.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/acfileio.c
  head/sys/contrib/dev/acpica/common/dmtbdump2.c
  head/sys/contrib/dev/acpica/common/dmtbinfo2.c
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/dttable1.c
  head/sys/contrib/dev/acpica/compiler/dttemplate.h
  head/sys/contrib/dev/acpica/components/debugger/dbnames.c
  head/sys/contrib/dev/acpica/components/debugger/dbobject.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/namespace/nsdump.c
  head/sys/contrib/dev/acpica/components/parser/psloop.c
  head/sys/contrib/dev/acpica/components/parser/psobject.c
  head/sys/contrib/dev/acpica/components/parser/pswalk.c
  head/sys/contrib/dev/acpica/components/utilities/uterror.c
  head/sys/contrib/dev/acpica/include/acdisasm.h
  head/sys/contrib/dev/acpica/include/aclocal.h
  head/sys/contrib/dev/acpica/include/acoutput.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actbinfo.h
  head/sys/contrib/dev/acpica/include/actbl2.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Mon Jun  4 22:15:24 2018
(r334642)
+++ head/sys/contrib/dev/acpica/changes.txt Mon Jun  4 22:26:47 2018
(r334643)
@@ -1,4 +1,86 @@
 
+31 May 2018. Summary of changes for version 20180531:
+
+
+1) ACPICA kernel-resident Subsystem:
+
+Implemented additional support to help ensure that a DSDT or SSDT is 
+fully loaded even if errors are incurred during the load. The majority of 
+the problems that are seen is the failure of individual AML operators 
+that occur during execution of any module-level code (MLC) existing in 
+the table. This support adds a mechanism to abort the current ASL 
+statement (AML opcode), emit an error message, and to simply move on to 
+the next opcode -- instead of aborting the entire table load. This is 
+different than the execution of a control method where the entire method 
+is aborted upon any error. The goal is to perform a very "best effort" to 
+load the ACPI tables. The most common MLC errors that have been seen in 
+the field are direct references to unresolved ASL/AML symbols (referenced 
+directly without the use of the CondRefOf operator to validate the 
+symbol). This new ACPICA behavior is now compatible with other ACPI 
+implementations.
+
+Interpreter: The Unload AML operator is no longer supported for the 
+reasons below. An AE_NOT_IMPLEMENTED exception is returned.
+1) A correct implementation on at least some hosts may not be possible.
+2) Other ACPI implementations do not correctly/fully support it.
+3) It requires host device driver support which is not known to exist.
+(To properly support namespace unload out from underneath.)
+4) This AML operator has never been seen in the field.
+
+Parser: Added a debug option to dump AML parse sub-trees as they are 
+being executed. Used with ACPI_DEBUG_PRINT, the enabling debug level is 
+ACPI_DB_PARSE_TREES.
+
+Debugger: Reduced the verbosity for errors incurred during table load and 
+module-level code execution.
+
+Completed an investigation into adding a namespace node "owner list" 
+instead of the current "owner ID" associated with namespace nodes. This 
+list would link together all nodes that are owned by an individual 
+control method. The purpose would be to enhance control method execution 
+by speeding up cleanup during method exit (all namespace nodes created by 
+a method are deleted upon method termination.) Currently, the entire 
+namespace must be searched for matching owner IDs if (and only if) the 
+method creates named objects outside of the local scope. However, by far 
+the most common case is that methods create objects locally, not outside 
+the method scope. There is already an ACPICA optimization in place that 
+only searches the entire namespace in the rare case of a method creating 
+objects elsewhere in the namespace. Therefore, it is felt that the 
+overhead of adding an additional pointer to each namespace node to 
+implement the owner list makes this feature unnecessary.
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL, Disassembler, and Template generator: Implemented support for 
+Revision D of the IORT table. Adds a new subtable that is used to specify 
+SMMUv3 PMCGs. rmurphy-arm.
+
+Disassembler: Restored correct table header validation for the "special" 
+ACPI tables -- RSDP and FACS. These tables do not contain a standard ACPI 
+table header and must 

svn commit: r334641 - head/usr.sbin/pmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 21:42:21 2018
New Revision: 334641
URL: https://svnweb.freebsd.org/changeset/base/334641

Log:
  pmc stat: fix offset of specified counter

Modified:
  head/usr.sbin/pmc/cmd_pmc_stat.c   (contents, props changed)

Modified: head/usr.sbin/pmc/cmd_pmc_stat.c
==
--- head/usr.sbin/pmc/cmd_pmc_stat.cMon Jun  4 21:21:55 2018
(r334640)
+++ head/usr.sbin/pmc/cmd_pmc_stat.cMon Jun  4 21:42:21 2018
(r334641)
@@ -86,6 +86,7 @@ getstathz(void)
 }
 
 #define STAT_MODE_NPMCS 6
+#define FIXED_MODE_NPMCS 2
 static struct timespec before_ts;
 #define CYCLES 0
 #define INST   1
@@ -179,7 +180,7 @@ pmc_stat_setup_stat(int system_mode, const char *arg)
if (pmc_pmu_sample_rate_get(counter) == 
DEFAULT_SAMPLE_COUNT)
errx(EX_USAGE, "ERROR: %s not recognized on 
host", counter);
}
-   start = IAP_START + STAT_MODE_NPMCS - newcnt;
+   start = IAP_START + STAT_MODE_NPMCS - FIXED_MODE_NPMCS - newcnt;
for (i = 0; i < newcnt; i++) {
stat_mode_cntrs[start + i] = new_cntrs[i];
stat_mode_names[start + i] = new_cntrs[i];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334640 - head/usr.bin/indent

2018-06-04 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jun  4 21:21:55 2018
New Revision: 334640
URL: https://svnweb.freebsd.org/changeset/base/334640

Log:
  indent(1): fix buildworld after r334632
  
  Fix
  error: comparison of integers of different signs: 'int' and 'unsigned long'
  by casting nitems() to int.
  
  Reported by:  mjg

Modified:
  head/usr.bin/indent/parse.c

Modified: head/usr.bin/indent/parse.c
==
--- head/usr.bin/indent/parse.c Mon Jun  4 21:17:46 2018(r334639)
+++ head/usr.bin/indent/parse.c Mon Jun  4 21:21:55 2018(r334640)
@@ -211,7 +211,7 @@ parse(int tk) /* tk: the code for the construct scanne
 
 }  /* end of switch */
 
-if (ps.tos >= nitems(ps.p_stack) - 1)
+if (ps.tos >= (int)nitems(ps.p_stack) - 1)
errx(1, "Parser stack overflow");
 
 reduce();  /* see if any reduction can be done */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334637 - head/sys/dev/hwpmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 21:17:30 2018
New Revision: 334637
URL: https://svnweb.freebsd.org/changeset/base/334637

Log:
  hwpmc: don't defer user callchain capture completion to ast

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jun  4 21:05:56 2018
(r334636)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jun  4 21:17:30 2018
(r334637)
@@ -1715,11 +1715,9 @@ pmc_process_thread_delete(struct thread *td)
 static void
 pmc_process_thread_userret(struct thread *td)
 {
-
-   thread_lock(td);
-   curthread->td_flags |= TDF_ASTPENDING;
-   thread_unlock(td);
-   pmc_post_callchain_callback();
+   sched_pin();
+   pmc_capture_user_callchain(curcpu, PMC_UR, td->td_frame);
+   sched_unpin();
 }
 
 /*
@@ -2253,8 +2251,6 @@ pmc_hook_handler(struct thread *td, int function, void
 
cpu = PCPU_GET(cpuid);
pmc_capture_user_callchain(cpu, PMC_SR,
-   (struct trapframe *) arg);
-   pmc_capture_user_callchain(cpu, PMC_UR,
(struct trapframe *) arg);
 
KASSERT(td->td_pinned == 1,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334639 - head/lib/libpmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 21:17:46 2018
New Revision: 334639
URL: https://svnweb.freebsd.org/changeset/base/334639

Log:
  libpmc: improve arg checking

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cMon Jun  4 21:17:42 2018(r334638)
+++ head/lib/libpmc/libpmc.cMon Jun  4 21:17:46 2018(r334639)
@@ -37,12 +37,14 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "libpmcinternal.h"
@@ -1035,13 +1037,16 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
 */
r = spec_copy = strdup(ctrspec);
ctrname = strsep(, ",");
-   if (pmc_pmu_pmcallocate(ctrname, _config) == 0) {
-   if (PMC_CALL(PMCALLOCATE, _config) < 0) {
+   if (pmc_pmu_enabled()) {
+   if (pmc_pmu_pmcallocate(ctrname, _config) == 0) {
+   if (PMC_CALL(PMCALLOCATE, _config) < 0) {
+   goto out;
+   }
+   retval = 0;
+   *pmcid = pmc_config.pm_pmcid;
goto out;
}
-   retval = 0;
-   *pmcid = pmc_config.pm_pmcid;
-   goto out;
+   errx(EX_USAGE, "ERROR: pmc_pmu_allocate failed, check for 
ctrname %s\n", ctrname);
} else {
free(spec_copy);
spec_copy = NULL;
@@ -1068,7 +1073,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
ev = NULL;
for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++) {
pcd = pmc_class_table[n];
-   if (pmc_mdep_is_compatible_class(pcd->pm_evc_class) &&
+   if (pcd && pmc_mdep_is_compatible_class(pcd->pm_evc_class) &&
strncasecmp(ctrname, pcd->pm_evc_name,
pcd->pm_evc_name_size) == 0) {
if ((ev = pmc_match_event_class(ctrname +
@@ -1086,7 +1091,7 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
 */
for (n = 0; ev == NULL && n < PMC_CLASS_TABLE_SIZE; n++) {
pcd = pmc_class_table[n];
-   if (pmc_mdep_is_compatible_class(pcd->pm_evc_class))
+   if (pcd && pmc_mdep_is_compatible_class(pcd->pm_evc_class))
ev = pmc_match_event_class(ctrname, pcd);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334638 - head/lib/libpmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 21:17:42 2018
New Revision: 334638
URL: https://svnweb.freebsd.org/changeset/base/334638

Log:
  libpmc / stat: use westmere supported counter

Modified:
  head/lib/libpmc/libpmc_pmu_util.c   (contents, props changed)

Modified: head/lib/libpmc/libpmc_pmu_util.c
==
--- head/lib/libpmc/libpmc_pmu_util.c   Mon Jun  4 21:17:30 2018
(r334637)
+++ head/lib/libpmc/libpmc_pmu_util.c   Mon Jun  4 21:17:42 2018
(r334638)
@@ -410,7 +410,7 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc
  * Ultimately rely on AMD calling theirs the same
  */
 static const char *stat_mode_cntrs[] = {
-   "cpu_clk_unhalted.thread_any",
+   "cpu_clk_unhalted.thread",
"inst_retired.any",
"br_inst_retired.all_branches",
"br_misp_retired.all_branches",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334636 - head/usr.bin/indent

2018-06-04 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jun  4 21:05:56 2018
New Revision: 334636
URL: https://svnweb.freebsd.org/changeset/base/334636

Log:
  indent(1): add --version option
  
  There exist multi-platform programs that check indent's version in order to
  know what they can expect from it. GNU indent provides that via --version,
  so implement the same option here.

Modified:
  head/usr.bin/indent/args.c
  head/usr.bin/indent/indent.1

Modified: head/usr.bin/indent/args.c
==
--- head/usr.bin/indent/args.c  Mon Jun  4 20:55:25 2018(r334635)
+++ head/usr.bin/indent/args.c  Mon Jun  4 21:05:56 2018(r334636)
@@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$");
 #include "indent_globs.h"
 #include "indent.h"
 
+#define INDENT_VERSION "2.0"
+
 /* profile types */
 #definePRO_SPECIAL 1   /* special case */
 #definePRO_BOOL2   /* boolean */
@@ -76,6 +78,7 @@ __FBSDID("$FreeBSD$");
 static void scan_profile(FILE *);
 
 #defineKEY_FILE5   /* only used for args */
+#define VERSION6   /* only used for args */
 
 const char *option_source = "?";
 
@@ -97,6 +100,7 @@ struct pro {
 
 {"T", PRO_SPECIAL, 0, KEY, 0},
 {"U", PRO_SPECIAL, 0, KEY_FILE, 0},
+{"-version", PRO_SPECIAL, 0, VERSION, 0},
 {"P", PRO_SPECIAL, 0, IGN, 0},
 {"bacc", PRO_BOOL, false, ON, _around_conditional_compilation},
 {"badp", PRO_BOOL, false, ON, _after_declarations_at_proctop},
@@ -301,6 +305,10 @@ found:
goto need_param;
add_typedefs_from_file(param_start);
break;
+
+   case VERSION:
+   printf("FreeBSD indent %s\n", INDENT_VERSION);
+   exit(0);
 
default:
errx(1, "set_option: internal error: p_special %d", p->p_special);

Modified: head/usr.bin/indent/indent.1
==
--- head/usr.bin/indent/indent.1Mon Jun  4 20:55:25 2018
(r334635)
+++ head/usr.bin/indent/indent.1Mon Jun  4 21:05:56 2018
(r334636)
@@ -30,7 +30,7 @@
 .\"@(#)indent.18.1 (Berkeley) 7/1/93
 .\" $FreeBSD$
 .\"
-.Dd August 7, 2017
+.Dd June 4, 2018
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -90,6 +90,7 @@
 .Op Fl U Ns Ar file
 .Op Fl ut | Fl nut
 .Op Fl v | Fl \
+.Op Fl -version
 .Sh DESCRIPTION
 The
 .Nm
@@ -491,6 +492,10 @@ reports when it splits one line of input into two or m
 and gives some size statistics at completion.
 The default is
 .Fl \ .
+.It Fl -version
+Causes
+.Nm
+to print its version number and exit.
 .El
 .Pp
 You may set up your own `profile' of defaults to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334635 - stable/10/sys/fs/nfsclient

2018-06-04 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  4 20:55:25 2018
New Revision: 334635
URL: https://svnweb.freebsd.org/changeset/base/334635

Log:
  MFC: r334252
  Fix the sleep event for layout recall.
  
  The sleep for I/O completion during an NFSv4.1 pNFS layout recall used
  the wrong event value and could result in the "[nfscl]" thread hung
  for the mount.
  This patch fixes the event to be the correct.
  This bug will only affect NFSv4.1 pnfs mounts and only when the server
  does a layout recall callback, so it won't affect many. Without the patch,
  a mount without the "pnfs" option will avoid the problem.
  Found during testing of the pNFS server.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c
==
--- stable/10/sys/fs/nfsclient/nfs_clstate.cMon Jun  4 20:47:37 2018
(r334634)
+++ stable/10/sys/fs/nfsclient/nfs_clstate.cMon Jun  4 20:55:25 2018
(r334635)
@@ -2719,7 +2719,7 @@ tryagain2:
 NFSV4LOCK_LOCK) != 0) {
lyp->nfsly_lock.nfslock_lock |=
NFSV4LOCK_WANTED;
-   (void)nfsmsleep(>nfsly_lock,
+   nfsmsleep(>nfsly_lock.nfslock_lock,
NFSCLSTATEMUTEXPTR, PZERO, "nfslyp",
NULL);
goto tryagain2;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334634 - stable/11/sys/fs/nfsclient

2018-06-04 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  4 20:47:37 2018
New Revision: 334634
URL: https://svnweb.freebsd.org/changeset/base/334634

Log:
  MFC: r334252
  Fix the sleep event for layout recall.
  
  The sleep for I/O completion during an NFSv4.1 pNFS layout recall used
  the wrong event value and could result in the "[nfscl]" thread hung
  for the mount.
  This patch fixes the event to be the correct.
  This bug will only affect NFSv4.1 pnfs mounts and only when the server
  does a layout recall callback, so it won't affect many. Without the patch,
  a mount without the "pnfs" option will avoid the problem.
  Found during testing of the pNFS server.

Modified:
  stable/11/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c
==
--- stable/11/sys/fs/nfsclient/nfs_clstate.cMon Jun  4 20:40:22 2018
(r334633)
+++ stable/11/sys/fs/nfsclient/nfs_clstate.cMon Jun  4 20:47:37 2018
(r334634)
@@ -2719,7 +2719,7 @@ tryagain2:
 NFSV4LOCK_LOCK) != 0) {
lyp->nfsly_lock.nfslock_lock |=
NFSV4LOCK_WANTED;
-   (void)nfsmsleep(>nfsly_lock,
+   nfsmsleep(>nfsly_lock.nfslock_lock,
NFSCLSTATEMUTEXPTR, PZERO, "nfslyp",
NULL);
goto tryagain2;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334633 - stable/10/sys/fs/nfsserver

2018-06-04 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  4 20:40:22 2018
New Revision: 334633
URL: https://svnweb.freebsd.org/changeset/base/334633

Log:
  MFC: r333592
  Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID.
  
  In the reply to an ExchangeID operation, the NFSv4.1 server returns a
  "scope" value (eir_server_scope). If this value is the same, it indicates
  that two servers share state, which is never the case for FreeBSD servers.
  As such, the value needs to be unique and it was without this patch.
  However, I just found out that it is not supposed to change when the
  server reboots and without this patch, it did change.
  This patch fixes eir_server_scope so that it does not change when the
  server is rebooted.
  The only affect not having this patch has is that Linux clients don't
  reclaim opens and locks after a server reboot, which meant they lost
  any byte range locks held before the server rebooted.
  It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not
  affected by this bug.

Modified:
  stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Mon Jun  4 20:39:58 2018
(r334632)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c   Mon Jun  4 20:40:22 2018
(r334633)
@@ -3800,9 +3800,9 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused 
txdr_hyper(owner_minor, tl);/* Minor */
(void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */
-   NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED);
-   *tl++ = txdr_unsigned(NFSX_UNSIGNED);
-   *tl++ = time_uptime;/* Make scope a unique value. */
+   (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
+   strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(1);
(void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org"));
(void)nfsm_strtom(nd, version, strlen(version));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334632 - head/usr.bin/indent

2018-06-04 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jun  4 20:39:58 2018
New Revision: 334632
URL: https://svnweb.freebsd.org/changeset/base/334632

Log:
  indent(1): remove the STACKSIZE macro and all of its use
  
  It conflicts with a system-provided macro of the same name on another OS.

Modified:
  head/usr.bin/indent/indent_globs.h
  head/usr.bin/indent/parse.c

Modified: head/usr.bin/indent/indent_globs.h
==
--- head/usr.bin/indent/indent_globs.h  Mon Jun  4 20:34:53 2018
(r334631)
+++ head/usr.bin/indent/indent_globs.h  Mon Jun  4 20:39:58 2018
(r334632)
@@ -219,13 +219,11 @@ int   auto_typedefs;  /* set true to 
recognize ident
 intspace_after_cast;   /* "b = (int) a" vs "b = (int)a" */
 inttabsize;/* the size of a tab */
 
-#defineSTACKSIZE 256
-
 struct parser_state {
 int last_token;
-int p_stack[STACKSIZE];/* this is the parsers stack */
-int il[STACKSIZE]; /* this stack stores indentation levels */
-float   cstk[STACKSIZE];/* used to store case stmt indentation levels 
*/
+int p_stack[256];  /* this is the parsers stack */
+int il[64];/* this stack stores indentation levels 
*/
+float   cstk[32];  /* used to store case stmt indentation levels */
 int box_com;   /* set to true when we are in a "boxed"
 * comment. In that case, the first non-blank
 * char should be lined up with the / in / 
followed by * */

Modified: head/usr.bin/indent/parse.c
==
--- head/usr.bin/indent/parse.c Mon Jun  4 20:34:53 2018(r334631)
+++ head/usr.bin/indent/parse.c Mon Jun  4 20:39:58 2018(r334632)
@@ -42,10 +42,12 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6
 #endif
 
 #include 
+#include 
 __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+
 #include "indent_globs.h"
 #include "indent_codes.h"
 #include "indent.h"
@@ -209,7 +211,7 @@ parse(int tk) /* tk: the code for the construct scanne
 
 }  /* end of switch */
 
-if (ps.tos >= STACKSIZE - 1)
+if (ps.tos >= nitems(ps.p_stack) - 1)
errx(1, "Parser stack overflow");
 
 reduce();  /* see if any reduction can be done */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334631 - in releng/11.2/sys/dev/cxgbe: . common

2018-06-04 Thread Navdeep Parhar
Author: np
Date: Mon Jun  4 20:34:53 2018
New Revision: 334631
URL: https://svnweb.freebsd.org/changeset/base/334631

Log:
  Merge r334562 from stable/11 to releng/11.2.  r334562 MFC'd the
  following revisions to stable/11: r333650, r333652, r333682, r334406,
  r334409-r334410, and r334489.
  
  r333650:
  cxgbe(4): Claim some more T5 and T6 boards.
  
  r333652:
  cxgbe(4): Add support for two more flash parts.
  
  r333682:
  cxgbe(4): Fall back to a failsafe configuration built into the firmware
  if an error is reported while pre-processing the configuration file that
  the driver attempted to use.
  
  Also, allow the user to explicitly use the built-in configuration with
  hw.cxgbe.config_file="built-in"
  
  r334406:
  cxgbe(4): Consider all supported speeds when building the ifmedia list
  for a port.  Fix other related issues while here:
  - Require port lock for access to link_config.
  - Allow 100Mbps operation by tracking the speed in Mbps.  Yes, really.
  - New port flag to indicate that the media list is immutable.  It will
be used in future refinements.
  
  This also fixes a bug where the driver reports incorrect media with
  recent firmwares.
  
  r334409:
  cxgbe(4): Implement ifm_change callback.
  
  r334410:
  cxgbe(4): Use ifm for ifmedia just like the rest of the kernel.
  
  No functional change.
  
  r334489:
  cxgbe(4): Include full duplex mediaopt in media that can be reported as
  active.  Always report full duplex in active media.
  
  Approved by:  re@ (gjb@, kib@)
  Sponsored by: Chelsio Communications

Modified:
  releng/11.2/sys/dev/cxgbe/adapter.h
  releng/11.2/sys/dev/cxgbe/common/common.h
  releng/11.2/sys/dev/cxgbe/common/t4_hw.c
  releng/11.2/sys/dev/cxgbe/t4_main.c
Directory Properties:
  releng/11.2/   (props changed)

Modified: releng/11.2/sys/dev/cxgbe/adapter.h
==
--- releng/11.2/sys/dev/cxgbe/adapter.h Mon Jun  4 20:24:31 2018
(r334630)
+++ releng/11.2/sys/dev/cxgbe/adapter.h Mon Jun  4 20:34:53 2018
(r334631)
@@ -162,6 +162,7 @@ enum {
 
/* port flags */
HAS_TRACEQ  = (1 << 3),
+   FIXED_IFMEDIA   = (1 << 4), /* ifmedia list doesn't change. */
 
/* VI flags */
DOOMED  = (1 << 0),

Modified: releng/11.2/sys/dev/cxgbe/common/common.h
==
--- releng/11.2/sys/dev/cxgbe/common/common.h   Mon Jun  4 20:24:31 2018
(r334630)
+++ releng/11.2/sys/dev/cxgbe/common/common.h   Mon Jun  4 20:34:53 2018
(r334631)
@@ -413,12 +413,12 @@ struct link_config {
unsigned char  requested_aneg;   /* link aneg user has requested */
unsigned char  requested_fc; /* flow control user has requested */
unsigned char  requested_fec;/* FEC user has requested */
-   unsigned int   requested_speed;  /* speed user has requested */
+   unsigned int   requested_speed;  /* speed user has requested (Mbps) */
 
unsigned short supported;/* link capabilities */
unsigned short advertising;  /* advertised capabilities */
unsigned short lp_advertising;   /* peer advertised capabilities */
-   unsigned int   speed;/* actual link speed */
+   unsigned int   speed;/* actual link speed (Mbps) */
unsigned char  fc;   /* actual link flow control */
unsigned char  fec;  /* actual FEC */
unsigned char  link_ok;  /* link up? */

Modified: releng/11.2/sys/dev/cxgbe/common/t4_hw.c
==
--- releng/11.2/sys/dev/cxgbe/common/t4_hw.cMon Jun  4 20:24:31 2018
(r334630)
+++ releng/11.2/sys/dev/cxgbe/common/t4_hw.cMon Jun  4 20:34:53 2018
(r334631)
@@ -3725,21 +3725,24 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m
lc->requested_aneg == AUTONEG_DISABLE) {
aneg = 0;
switch (lc->requested_speed) {
-   case 100:
+   case 10:
speed = FW_PORT_CAP_SPEED_100G;
break;
-   case 40:
+   case 4:
speed = FW_PORT_CAP_SPEED_40G;
break;
-   case 25:
+   case 25000:
speed = FW_PORT_CAP_SPEED_25G;
break;
-   case 10:
+   case 1:
speed = FW_PORT_CAP_SPEED_10G;
break;
-   case 1:
+   case 1000:
speed = FW_PORT_CAP_SPEED_1G;
break;
+   case 100:
+   speed = FW_PORT_CAP_SPEED_100M;
+   break;
default:
return -EINVAL;

svn commit: r334630 - head/usr.bin/indent

2018-06-04 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jun  4 20:24:31 2018
New Revision: 334630
URL: https://svnweb.freebsd.org/changeset/base/334630

Log:
  indent(1): remove static const char copyright[]
  
  It repeats what is already said in the heading comment and it's optimized out
  so serves no purpose.

Modified:
  head/usr.bin/indent/indent.c

Modified: head/usr.bin/indent/indent.c
==
--- head/usr.bin/indent/indent.cMon Jun  4 20:21:51 2018
(r334629)
+++ head/usr.bin/indent/indent.cMon Jun  4 20:24:31 2018
(r334630)
@@ -35,14 +35,6 @@
  * SUCH DAMAGE.
  */
 
-#ifndef lint
-static const char copyright[] =
-"@(#) Copyright (c) 1985 Sun Microsystems, Inc.\n\
-@(#) Copyright (c) 1976 Board of Trustees of the University of Illinois.\n\
-@(#) Copyright (c) 1980, 1993\n\
-   The Regents of the University of California.  All rights reserved.\n";
-#endif /* not lint */
-
 #if 0
 #ifndef lint
 static char sccsid[] = "@(#)indent.c   5.17 (Berkeley) 6/7/93";
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334629 - stable/11/sys/fs/nfsserver

2018-06-04 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  4 20:21:51 2018
New Revision: 334629
URL: https://svnweb.freebsd.org/changeset/base/334629

Log:
  MFC: r333592
  Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID.
  
  In the reply to an ExchangeID operation, the NFSv4.1 server returns a
  "scope" value (eir_server_scope). If this value is the same, it indicates
  that two servers share state, which is never the case for FreeBSD servers.
  As such, the value needs to be unique and it was without this patch.
  However, I just found out that it is not supposed to change when the
  server reboots and without this patch, it did change.
  This patch fixes eir_server_scope so that it does not change when the
  server is rebooted.
  The only affect not having this patch has is that Linux clients don't
  reclaim opens and locks after a server reboot, which meant they lost
  any byte range locks held before the server rebooted.
  It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not
  affected by this bug.

Modified:
  stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Mon Jun  4 19:47:24 2018
(r334628)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c   Mon Jun  4 20:21:51 2018
(r334629)
@@ -3831,9 +3831,9 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused 
txdr_hyper(owner_minor, tl);/* Minor */
(void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */
-   NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED);
-   *tl++ = txdr_unsigned(NFSX_UNSIGNED);
-   *tl++ = time_uptime;/* Make scope a unique value. */
+   (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid,
+   strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */
+   NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(1);
(void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org"));
(void)nfsm_strtom(nd, version, strlen(version));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334628 - head/usr.bin/indent

2018-06-04 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jun  4 19:47:24 2018
New Revision: 334628
URL: https://svnweb.freebsd.org/changeset/base/334628

Log:
  indent(1): replace BSD bcopy() with C memmove()

Modified:
  head/usr.bin/indent/indent.c

Modified: head/usr.bin/indent/indent.c
==
--- head/usr.bin/indent/indent.cMon Jun  4 19:36:47 2018
(r334627)
+++ head/usr.bin/indent/indent.cMon Jun  4 19:47:24 2018
(r334628)
@@ -1136,7 +1136,7 @@ check_type:
}
if (sc_end - save_com + com_end - com_start > sc_size)
errx(1, "input too long");
-   bcopy(s_lab + com_start, sc_end, com_end - com_start);
+   memmove(sc_end, s_lab + com_start, com_end - com_start);
sc_end += com_end - com_start;
e_lab = s_lab + com_start;
while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == 
'\t'))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334627 - in head/sys: compat/freebsd32 kern

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 19:36:47 2018
New Revision: 334627
URL: https://svnweb.freebsd.org/changeset/base/334627

Log:
  Regen after r334626.

Modified:
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Jun  4 19:35:15 
2018(r334626)
+++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Jun  4 19:36:47 
2018(r334627)
@@ -8889,7 +8889,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
/* obreak */
case 17:
if (ndx == 0 || ndx == 1)
-   p = "int";
+   p = "caddr_t";
break;
/* getpid */
case 20:

Modified: head/sys/kern/systrace_args.c
==
--- head/sys/kern/systrace_args.c   Mon Jun  4 19:35:15 2018
(r334626)
+++ head/sys/kern/systrace_args.c   Mon Jun  4 19:36:47 2018
(r334627)
@@ -8838,7 +8838,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
/* obreak */
case 17:
if (ndx == 0 || ndx == 1)
-   p = "int";
+   p = "caddr_t";
break;
/* getpid */
case 20:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334626 - in head: lib/libc/amd64 lib/libc/amd64/sys lib/libc/arm lib/libc/arm/sys lib/libc/i386 lib/libc/i386/sys lib/libc/mips lib/libc/mips/sys lib/libc/powerpc lib/libc/powerpc/sys ...

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 19:35:15 2018
New Revision: 334626
URL: https://svnweb.freebsd.org/changeset/base/334626

Log:
  Reimplement brk() and sbrk() to avoid the use of _end.
  
  Previously, libc.so would initialize its notion of the break address
  using _end, a special symbol emitted by the static linker following
  the bss section.  Compatibility issues between lld and ld.bfd could
  cause the wrong definition of _end (libc.so's definition rather than
  that of the executable) to be used, breaking the brk()/sbrk()
  interface.
  
  Avoid this problem and future interoperability issues by simply not
  relying on _end.  Instead, modify the break() system call to return
  the kernel's view of the current break address, and have libc
  initialize its state using an extra syscall upon the first use of the
  interface.  As a side effect, this appears to fix brk()/sbrk() usage
  in executables run with rtld direct exec, since the kernel and libc.so
  no longer maintain separate views of the process' break address.
  
  PR:   228574
  Reviewed by:  kib (previous version)
  MFC after:2 months
  Differential Revision:https://reviews.freebsd.org/D15663

Added:
  head/lib/libc/sys/brk.c   (contents, props changed)
  head/lib/libc/tests/sys/brk_test.c   (contents, props changed)
Deleted:
  head/lib/libc/amd64/sys/brk.S
  head/lib/libc/amd64/sys/sbrk.S
  head/lib/libc/arm/sys/brk.S
  head/lib/libc/arm/sys/sbrk.S
  head/lib/libc/i386/sys/brk.S
  head/lib/libc/i386/sys/sbrk.S
  head/lib/libc/mips/sys/brk.S
  head/lib/libc/mips/sys/sbrk.S
  head/lib/libc/powerpc/sys/brk.S
  head/lib/libc/powerpc/sys/sbrk.S
  head/lib/libc/powerpc64/sys/brk.S
  head/lib/libc/powerpc64/sys/sbrk.S
  head/lib/libc/sparc64/sys/brk.S
  head/lib/libc/sparc64/sys/sbrk.S
Modified:
  head/lib/libc/amd64/Symbol.map
  head/lib/libc/amd64/sys/Makefile.inc
  head/lib/libc/arm/Symbol.map
  head/lib/libc/arm/sys/Makefile.inc
  head/lib/libc/i386/Symbol.map
  head/lib/libc/i386/sys/Makefile.inc
  head/lib/libc/mips/Symbol.map
  head/lib/libc/mips/sys/Makefile.inc
  head/lib/libc/powerpc/Symbol.map
  head/lib/libc/powerpc/sys/Makefile.inc
  head/lib/libc/powerpc64/Symbol.map
  head/lib/libc/powerpc64/sys/Makefile.inc
  head/lib/libc/riscv/sys/Makefile.inc
  head/lib/libc/sparc64/Symbol.map
  head/lib/libc/sparc64/sys/Makefile.inc
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/brk.2
  head/lib/libc/tests/sys/Makefile
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/syscalls.master
  head/sys/vm/vm_unix.c

Modified: head/lib/libc/amd64/Symbol.map
==
--- head/lib/libc/amd64/Symbol.map  Mon Jun  4 18:51:06 2018
(r334625)
+++ head/lib/libc/amd64/Symbol.map  Mon Jun  4 19:35:15 2018
(r334626)
@@ -63,7 +63,6 @@ FBSDprivate_1.0 {
signalcontext;
__siglongjmp;
_brk;
-   _end;
__sys_vfork;
_vfork;
 };

Modified: head/lib/libc/amd64/sys/Makefile.inc
==
--- head/lib/libc/amd64/sys/Makefile.incMon Jun  4 18:51:06 2018
(r334625)
+++ head/lib/libc/amd64/sys/Makefile.incMon Jun  4 19:35:15 2018
(r334626)
@@ -8,7 +8,7 @@ SRCS+=  \
amd64_set_fsbase.c \
amd64_set_gsbase.c
 
-MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S
+MDASM= vfork.S cerror.S getcontext.S
 
 # Don't generate default code for these syscalls:
-NOASM+=vfork.o
+NOASM+=sbrk.o vfork.o

Modified: head/lib/libc/arm/Symbol.map
==
--- head/lib/libc/arm/Symbol.mapMon Jun  4 18:51:06 2018
(r334625)
+++ head/lib/libc/arm/Symbol.mapMon Jun  4 19:35:15 2018
(r334626)
@@ -58,7 +58,6 @@ FBSDprivate_1.0 {
__sys_vfork;
_vfork;
_brk;
-   _end;
_sbrk;
 
_libc_arm_fpu_present;

Modified: head/lib/libc/arm/sys/Makefile.inc
==
--- head/lib/libc/arm/sys/Makefile.inc  Mon Jun  4 18:51:06 2018
(r334625)
+++ head/lib/libc/arm/sys/Makefile.inc  Mon Jun  4 19:35:15 2018
(r334626)
@@ -2,7 +2,7 @@
 
 SRCS+= __vdso_gettc.c
 
-MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S
+MDASM= Ovfork.S cerror.S syscall.S
 
 # Don't generate default code for these syscalls:
-NOASM+=vfork.o
+NOASM+=sbrk.o vfork.o

Modified: head/lib/libc/i386/Symbol.map
==
--- head/lib/libc/i386/Symbol.map   Mon Jun  4 18:51:06 2018
(r334625)
+++ head/lib/libc/i386/Symbol.map   Mon Jun  4 19:35:15 2018
(r334626)
@@ -61,6 +61,5 @@ FBSDprivate_1.0 {
__siglongjmp;
__sys_vfork;
_vfork;
-   _end;
_brk;
 };

Modified: head/lib/libc/i386/sys/Makefile.inc

Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Brad Davis
On Mon, Jun 4, 2018, at 12:47 PM, Rodney W. Grimes wrote:
> [ Charset UTF-8 unsupported, converting... ]
> > On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote:
> > > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote:
> > > > > [ Charset UTF-8 unsupported, converting... ]
> > > > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  
> > > > > > wrote:
> > > > > > > Author: brd
> > > > > > > Date: Mon Jun  4 15:17:24 2018
> > > > > > > New Revision: 334617
> > > > > > > URL: https://svnweb.freebsd.org/changeset/base/334617
> > > > > > >
> > > > > > > Log:
> > > > > > >   Move /sys symlink creating out of etc/Makefile.
> > > > > > >
> > > > > > >   This is prep for etc/Makefile going away.
> > > > > > >
> > > > > > >   Approved by:  bapt (mentor)
> > > > > > >
> > > > > > 
> > > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> > > > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and
> > > > > > needs to be fixed; this was on my 'some day to fix' list.
> > > > > 
> > > > > Yes please, much more information here.  I use some of the targets
> > > > > in src/etc/Makefile such as distribution:
> > > > 
> > > > All the config files need to be pushed back next to the source they 
> > > > belong to.
> > > 
> > > That is fine, but there is stuff other than config files, how do you plan
> > > to handle that?
> > 
> > Moving them as appropriate just like the above..
> 
> So another words you have no plan yet?

It is largely done here:

https://github.com/brd/freebsd/tree/etc-DIR/etc

I am working on stragglers..

> > > > What do you use these targets for?
> > > 
> > > Building custom installation sets, building nfs shares.
> > 
> > OK, what commands specifically are you calling in etc/ directly and why?
> 
> I said in my first reply specifically distribution:
> 
> > 
> > I would expect the targets in the root of the src tree would handle that 
> > stuff for you?
> 
> hierarchy: may

But why do you run them yourself?

> > > > > I believe there are also other external consumers of this.
> > > > 
> > > > Such as?
> > > 
> > > Iirc some of the make release stuff calls into here, but that
> > > may of changed to use src/Makefile targets.  distrib-dirs comes
> > > to mind.
> > 
> > Sure, but those can go away or be updated as needed..
> 
> So again, no plan yet?

Most of them are gone, I am still in progress on some of it.  See the github 
branch above.

My testing is all done by building release VMs and comparing them against a VM 
built from the last merge from HEAD.  So I will update the release stuff as I 
go.  It is my responsibility to keep the release stuff working as I change 
these.


Regards,
Brad Davis
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334625 - head/sys/netipsec

2018-06-04 Thread Conrad Meyer
Author: cem
Date: Mon Jun  4 18:51:06 2018
New Revision: 334625
URL: https://svnweb.freebsd.org/changeset/base/334625

Log:
  Correctly handle the padding for IPv6-AH, as specified by RFC4302
  
  The RFC specifies that under IPv6 the complete AH header must be 64 bit
  aligned, and under IPv4, 32 bit aligned. Prior to this change, we (along
  with other BSDs and MacOS) had violated this requirement.
  
  This makes it possible to set up IPv6-AH between Linux and BSD, and also
  probably between Windows and BSD.
  
  PR:   222684
  Reported and tested by:   Jason Mader 
  Obtained from:NetBSD xform_ah.c 1.105
(b939fe2483972eb43d71bf990cfb7f26dece7839 NetBSD/src on GH)
by Maxime Villard
  MFC after:35.2731 hours
  Relnotes: probably (breaks ipv6 compat with older FreeBSD/NetBSD/MacOS)
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/netipsec/xform_ah.c

Modified: head/sys/netipsec/xform_ah.c
==
--- head/sys/netipsec/xform_ah.cMon Jun  4 18:47:14 2018
(r334624)
+++ head/sys/netipsec/xform_ah.cMon Jun  4 18:51:06 2018
(r334625)
@@ -147,11 +147,21 @@ ah_hdrsiz(struct secasvar *sav)
size_t size;
 
if (sav != NULL) {
-   int authsize;
+   int authsize, rplen, align;
+
IPSEC_ASSERT(sav->tdb_authalgxform != NULL, ("null xform"));
/*XXX not right for null algorithm--does it matter??*/
+
+   /* RFC4302: use the correct alignment. */
+   align = sizeof(uint32_t);
+#ifdef INET6
+   if (sav->sah->saidx.dst.sa.sa_family == AF_INET6) {
+   align = sizeof(uint64_t);
+   }
+#endif
+   rplen = HDRSIZE(sav);
authsize = AUTHSIZE(sav);
-   size = roundup(authsize, sizeof (u_int32_t)) + HDRSIZE(sav);
+   size = roundup(rplen + authsize, align);
} else {
/* default guess */
size = sizeof (struct ah) + sizeof (u_int32_t) + 16;
@@ -535,7 +545,7 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski
struct xform_data *xd;
struct newah *ah;
uint64_t cryptoid;
-   int hl, rplen, authsize, error;
+   int hl, rplen, authsize, ahsize, error;
 
IPSEC_ASSERT(sav != NULL, ("null SA"));
IPSEC_ASSERT(sav->key_auth != NULL, ("null authentication key"));
@@ -569,23 +579,24 @@ ah_input(struct mbuf *m, struct secasvar *sav, int ski
SECASVAR_UNLOCK(sav);
 
/* Verify AH header length. */
-   hl = ah->ah_len * sizeof (u_int32_t);
+   hl = sizeof(struct ah) + (ah->ah_len * sizeof (u_int32_t));
ahx = sav->tdb_authalgxform;
authsize = AUTHSIZE(sav);
-   if (hl != authsize + rplen - sizeof (struct ah)) {
+   ahsize = ah_hdrsiz(sav);
+   if (hl != ahsize) {
DPRINTF(("%s: bad authenticator length %u (expecting %lu)"
" for packet in SA %s/%08lx\n", __func__, hl,
-   (u_long) (authsize + rplen - sizeof (struct ah)),
+   (u_long)ahsize,
ipsec_address(>sah->saidx.dst, buf, sizeof(buf)),
(u_long) ntohl(sav->spi)));
AHSTAT_INC(ahs_badauthl);
error = EACCES;
goto bad;
}
-   if (skip + authsize + rplen > m->m_pkthdr.len) {
+   if (skip + ahsize > m->m_pkthdr.len) {
DPRINTF(("%s: bad mbuf length %u (expecting %lu)"
" for packet in SA %s/%08lx\n", __func__,
-   m->m_pkthdr.len, (u_long) (skip + authsize + rplen),
+   m->m_pkthdr.len, (u_long)(skip + ahsize),
ipsec_address(>sah->saidx.dst, buf, sizeof(buf)),
(u_long) ntohl(sav->spi)));
AHSTAT_INC(ahs_badauthl);
@@ -689,7 +700,7 @@ ah_input_cb(struct cryptop *crp)
struct secasindex *saidx;
caddr_t ptr;
uint64_t cryptoid;
-   int authsize, rplen, error, skip, protoff;
+   int authsize, rplen, ahsize, error, skip, protoff;
uint8_t nxt;
 
m = (struct mbuf *) crp->crp_buf;
@@ -736,6 +747,7 @@ ah_input_cb(struct cryptop *crp)
/* Figure out header size. */
rplen = HDRSIZE(sav);
authsize = AUTHSIZE(sav);
+   ahsize = ah_hdrsiz(sav);
 
/* Copy authenticator off the packet. */
m_copydata(m, skip + rplen, authsize, calc);
@@ -784,7 +796,7 @@ ah_input_cb(struct cryptop *crp)
/*
 * Remove the AH header and authenticator from the mbuf.
 */
-   error = m_striphdr(m, skip, rplen + authsize);
+   error = m_striphdr(m, skip, ahsize);
if (error) {
DPRINTF(("%s: mangled mbuf chain for SA %s/%08lx\n", __func__,
ipsec_address(>dst, buf, sizeof(buf)),
@@ -839,7 +851,7 @@ 

svn commit: r334624 - head/sys/libkern

2018-06-04 Thread Conrad Meyer
Author: cem
Date: Mon Jun  4 18:47:14 2018
New Revision: 334624
URL: https://svnweb.freebsd.org/changeset/base/334624

Log:
  str(r)chr: Replace union abuse with __DECONST
  
  Writing one union member and reading another is technically illegal C,
  although we do it in many places in the tree.  Use the __DECONST macro
  instead, which is (technically) a valid C construct.
  
  Trivial style(9) cleanups to touched lines while here.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/libkern/strchr.c
  head/sys/libkern/strrchr.c

Modified: head/sys/libkern/strchr.c
==
--- head/sys/libkern/strchr.c   Mon Jun  4 17:49:34 2018(r334623)
+++ head/sys/libkern/strchr.c   Mon Jun  4 18:47:14 2018(r334624)
@@ -36,19 +36,16 @@ __FBSDID("$FreeBSD$");
 #include 
 
 char *
-strchr(const char *p, int ch)
+strchr(const char *cp, int ch)
 {
-   union {
-   const char *cp;
-   char *p;
-   } u;
+   char *p;
 
-   u.cp = p;
-   for (;; ++u.p) {
-   if (*u.p == ch)
-   return(u.p);
-   if (*u.p == '\0')
-   return(NULL);
+   p = __DECONST(char *, cp);
+   for (;; ++p) {
+   if (*p == ch)
+   return (p);
+   if (*p == '\0')
+   return (NULL);
}
/* NOTREACHED */
 }

Modified: head/sys/libkern/strrchr.c
==
--- head/sys/libkern/strrchr.c  Mon Jun  4 17:49:34 2018(r334623)
+++ head/sys/libkern/strrchr.c  Mon Jun  4 18:47:14 2018(r334624)
@@ -36,20 +36,16 @@ __FBSDID("$FreeBSD$");
 #include 
 
 char *
-strrchr(const char *p, int ch)
+strrchr(const char *cp, int ch)
 {
-   union {
-   const char *cp;
-   char *p;
-   } u;
-   char *save;
+   char *p, *save;
 
-   u.cp = p;
-   for (save = NULL;; ++u.p) {
-   if (*u.p == ch)
-   save = u.p;
-   if (*u.p == '\0')
-   return(save);
+   p = __DECONST(char *, cp);
+   for (save = NULL;; ++p) {
+   if (*p == ch)
+   save = p;
+   if (*p == '\0')
+   return (save);
}
/* NOTREACHED */
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote:
> > > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote:
> > > > [ Charset UTF-8 unsupported, converting... ]
> > > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > > > > > Author: brd
> > > > > > Date: Mon Jun  4 15:17:24 2018
> > > > > > New Revision: 334617
> > > > > > URL: https://svnweb.freebsd.org/changeset/base/334617
> > > > > >
> > > > > > Log:
> > > > > >   Move /sys symlink creating out of etc/Makefile.
> > > > > >
> > > > > >   This is prep for etc/Makefile going away.
> > > > > >
> > > > > >   Approved by:  bapt (mentor)
> > > > > >
> > > > > 
> > > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> > > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and
> > > > > needs to be fixed; this was on my 'some day to fix' list.
> > > > 
> > > > Yes please, much more information here.  I use some of the targets
> > > > in src/etc/Makefile such as distribution:
> > > 
> > > All the config files need to be pushed back next to the source they 
> > > belong to.
> > 
> > That is fine, but there is stuff other than config files, how do you plan
> > to handle that?
> 
> Moving them as appropriate just like the above..

So another words you have no plan yet?

> > > What do you use these targets for?
> > 
> > Building custom installation sets, building nfs shares.
> 
> OK, what commands specifically are you calling in etc/ directly and why?

I said in my first reply specifically distribution:

> 
> I would expect the targets in the root of the src tree would handle that 
> stuff for you?

hierarchy: may

> > > > I believe there are also other external consumers of this.
> > > 
> > > Such as?
> > 
> > Iirc some of the make release stuff calls into here, but that
> > may of changed to use src/Makefile targets.  distrib-dirs comes
> > to mind.
> 
> Sure, but those can go away or be updated as needed..

So again, no plan yet?

> Regards,
> Brad Davis

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Brad Davis
On Mon, Jun 4, 2018, at 10:57 AM, Rodney W. Grimes wrote:
> > On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote:
> > > [ Charset UTF-8 unsupported, converting... ]
> > > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > > > > Author: brd
> > > > > Date: Mon Jun  4 15:17:24 2018
> > > > > New Revision: 334617
> > > > > URL: https://svnweb.freebsd.org/changeset/base/334617
> > > > >
> > > > > Log:
> > > > >   Move /sys symlink creating out of etc/Makefile.
> > > > >
> > > > >   This is prep for etc/Makefile going away.
> > > > >
> > > > >   Approved by:  bapt (mentor)
> > > > >
> > > > 
> > > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> > > > is? Some of the NO_ROOT stuff there seems to be terribly broken and
> > > > needs to be fixed; this was on my 'some day to fix' list.
> > > 
> > > Yes please, much more information here.  I use some of the targets
> > > in src/etc/Makefile such as distribution:
> > 
> > All the config files need to be pushed back next to the source they belong 
> > to.
> 
> That is fine, but there is stuff other than config files, how do you plan
> to handle that?

Moving them as appropriate just like the above..

> > What do you use these targets for?
> 
> Building custom installation sets, building nfs shares.

OK, what commands specifically are you calling in etc/ directly and why?

I would expect the targets in the root of the src tree would handle that stuff 
for you?

> > > I believe there are also other external consumers of this.
> > 
> > Such as?
> 
> Iirc some of the make release stuff calls into here, but that
> may of changed to use src/Makefile targets.  distrib-dirs comes
> to mind.

Sure, but those can go away or be updated as needed..


Regards,
Brad Davis
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334623 - head/sys/dev/hwpmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 17:49:34 2018
New Revision: 334623
URL: https://svnweb.freebsd.org/changeset/base/334623

Log:
  hwpmc: remove gratuitous curthread checks

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jun  4 16:46:36 2018
(r334622)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Mon Jun  4 17:49:34 2018
(r334623)
@@ -4647,16 +4647,12 @@ pmc_add_sample(int cpu, int ring, struct pmc *pm, stru
 
counter_u64_add(pm->pm_runcount, 1);/* hold onto PMC */
 
+   td = curthread;
ps->ps_pmc = pm;
-   ps->ps_pid = -1;
-   ps->ps_tid = -1;
-   if ((td = curthread) != NULL) {
-   ps->ps_tid = td->td_tid;
-   if (td->td_proc)
-   ps->ps_pid = td->td_proc->p_pid;
-   }
-   ps->ps_cpu = cpu;
ps->ps_td = td;
+   ps->ps_pid = td->td_proc->p_pid;
+   ps->ps_tid = td->td_tid;
+   ps->ps_cpu = cpu;
ps->ps_flags = inuserspace ? PMC_CC_F_USERSPACE : 0;
 
callchaindepth = (pm->pm_flags & PMC_F_CALLCHAIN) ?
@@ -4715,9 +4711,8 @@ pmc_process_interrupt(int cpu, int ring, struct pmc *p
 
td = curthread;
if ((pm->pm_flags & PMC_F_USERCALLCHAIN) &&
-   td && td->td_proc &&
-   (td->td_proc->p_flag & P_KPROC) == 0 &&
-   !inuserspace) {
+   (td->td_proc->p_flag & P_KPROC) == 0 &&
+   !inuserspace) {
atomic_add_int(>td_pmcpend, 1);
return (pmc_add_sample(cpu, PMC_UR, pm, tf, 0));
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat

2018-06-04 Thread Matthew Macy
On Mon, Jun 4, 2018 at 5:08 AM, Konstantin Belousov  wrote:
> On Mon, Jun 04, 2018 at 01:10:23AM +, Matt Macy wrote:
>> @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void
>>
>>   pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR,
>>   (struct trapframe *) arg);
>> +
>> + KASSERT(td->td_pinned == 1,
>> + ("[pmc,%d] invalid td_pinned value", __LINE__));
>> + sched_unpin();  /* Can migrate safely now. */
> sched_pin() is called from pmc_post_callchain_callback(), which is
> called from userret(). userret() is executed with interrupts and
> preemption enabled, so there is a non-trivial chance that the thread
> already migrated.
>
> In fact, I do not see a need to disable migration for the thread if user
> callchain is planned to be gathered. You only need to remember the cpu
> where the interrupt occured, to match it against the request.  Or are
> per-cpu PMC registers still accessed during callchain collection ?

The buffers are pcpu. Although it would in principle be safe in this
case since I
don't modify the read/write indices. However, I'd have to add another field for
the CPU and it doesn't handle the case of multiple migrations.

>
>> +int
>> +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe 
>> *tf,
>> +int inuserspace)
>> +{
>> + struct thread *td;
>> +
>> + td = curthread;
>> + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) &&
>> + td && td->td_proc &&
>> + (td->td_proc->p_flag & P_KPROC) == 0 &&
>> + !inuserspace) {
> I am curious why a lot of the pmc code checks for curthread != NULL and,
> like this fragment, for curproc != NULL.  I am sure that at least on x86,
> we never let curthread point to the garbage, even during the context
> switches.  NMI handler has the same cargo-cult check, BTW.

I didn't think they could be NULL, but have been cargo culting the
existing code.

> Also, please fix the indentation of the conditions block.


>
>> + atomic_add_int(>td_pmcpend, 1);
> You can use atomic_store_int() there, I believe,  Then there would be
> no locked op executed at all, on x86.

Storing a 1 would enable me to early terminate the loop.

>
>> @@ -375,6 +375,7 @@ struct thread {
>>   void*td_lkpi_task;  /* LinuxKPI task struct pointer */
>>   TAILQ_ENTRY(thread) td_epochq;  /* (t) Epoch queue. */
>>   epoch_section_t td_epoch_section; /* (t) epoch section object */
>> + int td_pmcpend;
> Why this member was not put into the zeroed region ?  Wouldn't a garbage
> there cause uneccessary ASTs ?

It would cause _1_ unnecessary check for callchains after initial
creation. Putting it in the zero area would break the ABI.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Rodney W. Grimes
> On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> > > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > > > Author: brd
> > > > Date: Mon Jun  4 15:17:24 2018
> > > > New Revision: 334617
> > > > URL: https://svnweb.freebsd.org/changeset/base/334617
> > > >
> > > > Log:
> > > >   Move /sys symlink creating out of etc/Makefile.
> > > >
> > > >   This is prep for etc/Makefile going away.
> > > >
> > > >   Approved by:  bapt (mentor)
> > > >
> > > 
> > > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> > > is? Some of the NO_ROOT stuff there seems to be terribly broken and
> > > needs to be fixed; this was on my 'some day to fix' list.
> > 
> > Yes please, much more information here.  I use some of the targets
> > in src/etc/Makefile such as distribution:
> 
> All the config files need to be pushed back next to the source they belong to.

That is fine, but there is stuff other than config files, how do you plan
to handle that?

> What do you use these targets for?

Building custom installation sets, building nfs shares.

> 
> > I believe there are also other external consumers of this.
> 
> Such as?

Iirc some of the make release stuff calls into here, but that
may of changed to use src/Makefile targets.  distrib-dirs comes
to mind.


-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334622 - head/sys/vm

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 16:46:36 2018
New Revision: 334622
URL: https://svnweb.freebsd.org/changeset/base/334622

Log:
  Correct the description of vm_pageout_scan_inactive() after r334508.
  
  Reported by:  alc

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cMon Jun  4 16:28:06 2018(r334621)
+++ head/sys/vm/vm_pageout.cMon Jun  4 16:46:36 2018(r334622)
@@ -1347,9 +1347,8 @@ vm_pageout_reinsert_inactive(struct scan_state *ss, st
 }
 
 /*
- * Attempt to reclaim the requested number of pages.  Returns true if pass was
- * zero or enough pages were freed by the inactive queue scan to meet the
- * target.
+ * Attempt to reclaim the requested number of pages from the inactive queue.
+ * Returns true if the shortage was addressed.
  */
 static int
 vm_pageout_scan_inactive(struct vm_domain *vmd, int shortage,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334621 - in head/sys: kern vm

2018-06-04 Thread Alan Cox
Author: alc
Date: Mon Jun  4 16:28:06 2018
New Revision: 334621
URL: https://svnweb.freebsd.org/changeset/base/334621

Log:
  Use a single, consistent approach to returning success versus failure in
  vm_map_madvise().  Previously, vm_map_madvise() used a traditional Unix-
  style "return (0);" to indicate success in the common case, but Mach-
  style return values in the edge cases.  Since KERN_SUCCESS equals zero,
  the only problem with this inconsistency was stylistic.  vm_map_madvise()
  has exactly two callers in the entire source tree, and only one of them
  cares about the return value.  That caller, kern_madvise(), can be
  simplified if vm_map_madvise() consistently uses Unix-style return
  values.
  
  Since vm_map_madvise() uses the variable modify_map as a Boolean, make it
  one.
  
  Eliminate a redundant error check from kern_madvise().  Add a comment
  explaining where the check is performed.
  
  Explicitly note that exec_release_args_kva() doesn't care about
  vm_map_madvise()'s return value.  Since MADV_FREE is passed as the
  behavior, the return value will always be zero.
  
  Reviewed by:  kib, markj
  MFC after:7 days

Modified:
  head/sys/kern/kern_exec.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_mmap.c

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Mon Jun  4 16:21:18 2018(r334620)
+++ head/sys/kern/kern_exec.c   Mon Jun  4 16:28:06 2018(r334621)
@@ -1380,7 +1380,7 @@ exec_release_args_kva(struct exec_args_kva *argkva, u_
 
base = argkva->addr;
if (argkva->gen != gen) {
-   vm_map_madvise(exec_map, base, base + exec_map_entry_size,
+   (void)vm_map_madvise(exec_map, base, base + exec_map_entry_size,
MADV_FREE);
argkva->gen = gen;
}

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cMon Jun  4 16:21:18 2018(r334620)
+++ head/sys/vm/vm_map.cMon Jun  4 16:28:06 2018(r334621)
@@ -2215,7 +2215,7 @@ vm_map_madvise(
int behav)
 {
vm_map_entry_t current, entry;
-   int modify_map = 0;
+   bool modify_map;
 
/*
 * Some madvise calls directly modify the vm_map_entry, in which case
@@ -2232,19 +2232,20 @@ vm_map_madvise(
case MADV_NOCORE:
case MADV_CORE:
if (start == end)
-   return (KERN_SUCCESS);
-   modify_map = 1;
+   return (0);
+   modify_map = true;
vm_map_lock(map);
break;
case MADV_WILLNEED:
case MADV_DONTNEED:
case MADV_FREE:
if (start == end)
-   return (KERN_SUCCESS);
+   return (0);
+   modify_map = false;
vm_map_lock_read(map);
break;
default:
-   return (KERN_INVALID_ARGUMENT);
+   return (EINVAL);
}
 
/*

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Mon Jun  4 16:21:18 2018(r334620)
+++ head/sys/vm/vm_mmap.c   Mon Jun  4 16:28:06 2018(r334621)
@@ -683,11 +683,6 @@ kern_madvise(struct thread *td, uintptr_t addr0, size_
}
 
/*
-* Check for illegal behavior
-*/
-   if (behav < 0 || behav > MADV_CORE)
-   return (EINVAL);
-   /*
 * Check for illegal addresses.  Watch out for address wrap... Note
 * that VM_*_ADDRESS are not constants due to casts (argh).
 */
@@ -705,9 +700,10 @@ kern_madvise(struct thread *td, uintptr_t addr0, size_
start = trunc_page(addr);
end = round_page(addr + len);
 
-   if (vm_map_madvise(map, start, end, behav))
-   return (EINVAL);
-   return (0);
+   /*
+* vm_map_madvise() checks for illegal values of behav.
+*/
+   return (vm_map_madvise(map, start, end, behav));
 }
 
 #ifndef _SYS_SYSPROTO_H_
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334620 - head/share/mk

2018-06-04 Thread Ruslan Bukin
Author: br
Date: Mon Jun  4 16:21:18 2018
New Revision: 334620
URL: https://svnweb.freebsd.org/changeset/base/334620

Log:
  Sort GCC warning flags and remove duplicates.
  
  Sponsored by: DARPA, AFRL

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

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkMon Jun  4 16:20:22 2018(r334619)
+++ head/share/mk/bsd.sys.mkMon Jun  4 16:21:18 2018(r334620)
@@ -141,19 +141,17 @@ CWARNFLAGS+=  -Wno-error=misleading-indentation   
\
 
 # GCC 7.1.0
 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100
-CWARNFLAGS+=   -Wno-error=deprecated   \
-   -Wno-error=pointer-compare  \
+CWARNFLAGS+=   -Wno-error=bool-operation   \
+   -Wno-error=deprecated   \
+   -Wno-error=expansion-to-defined \
+   -Wno-error=format-overflow  \
-Wno-error=format-truncation\
-Wno-error=implicit-fallthrough \
-   -Wno-error=expansion-to-defined \
-Wno-error=int-in-bool-context  \
-   -Wno-error=bool-operation   \
-   -Wno-error=format-overflow  \
-   -Wno-error=stringop-overflow\
-Wno-error=memset-elt-size  \
-   -Wno-error=int-in-bool-context  \
-   -Wno-error=unused-const-variable\
-   -Wno-error=nonnull
+   -Wno-error=nonnull  \
+   -Wno-error=pointer-compare  \
+   -Wno-error=stringop-overflow
 .endif
 
 # How to handle FreeBSD custom printf format specifiers.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334619 - head/sys/conf

2018-06-04 Thread Ruslan Bukin
Author: br
Date: Mon Jun  4 16:20:22 2018
New Revision: 334619
URL: https://svnweb.freebsd.org/changeset/base/334619

Log:
  Fix build: ignore a GCC 7.2.0 warning which says that third argument of
  memset(3) should contain the number of elements multiplied by the element
  size.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/conf/kern.mk

Modified: head/sys/conf/kern.mk
==
--- head/sys/conf/kern.mk   Mon Jun  4 15:44:17 2018(r334618)
+++ head/sys/conf/kern.mk   Mon Jun  4 16:20:22 2018(r334619)
@@ -67,6 +67,9 @@ CWARNEXTRA+=  -Wno-error=misleading-indentation   
\
-Wno-error=shift-overflow   \
-Wno-error=tautological-compare
 .endif
+.if ${COMPILER_VERSION} >= 70200
+CWARNEXTRA+=   -Wno-error=memset-elt-size
+.endif
 .if ${COMPILER_VERSION} >= 8
 CWARNEXTRA+=   -Wno-error=packed-not-aligned
 .endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334543 - head/usr.bin/top

2018-06-04 Thread Warner Losh
On Mon, Jun 4, 2018 at 9:13 AM, Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> > On  2 Jun, Rodney W. Grimes wrote:
> > >> Author: eadler
> > >> Date: Sat Jun  2 22:06:27 2018
> > >> New Revision: 334543
> > >> URL: https://svnweb.freebsd.org/changeset/base/334543
> > >>
> > >> Log:
> > >>   top(1): chdir to / as init; remove unneeded comment
> > >>
> > >>   - chdir to / to allow unmounting of wd
> > >>   - remove warning about running top(1) as setuid. If this is a
> concern we
> > >>   should just drop privs instead.
> > >>
> > >> Modified:
> > >>   head/usr.bin/top/machine.c
> > >>   head/usr.bin/top/top.c
> > >>
> > >> Modified: head/usr.bin/top/machine.c
> > >> 
> ==
> > >> --- head/usr.bin/top/machine.c Sat Jun  2 21:50:00 2018
> (r334542)
> > >> +++ head/usr.bin/top/machine.c Sat Jun  2 22:06:27 2018
> (r334543)
> > >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void
> *arg2)
> > >>  /*
> > >>   * proc_owner(pid) - returns the uid that owns process "pid", or -1
> if
> > >>   *the process does not exist.
> > >> - *It is EXTREMELY IMPORTANT that this function work
> correctly.
> > >> - *If top runs setuid root (as in SVR4), then this
> function
> > >> - *is the only thing that stands in the way of a
> serious
> > >> - *security problem.  It validates requests for the
> "kill"
> > >> - *and "renice" commands.
> > >>   */
> > >>
> > >>  int
> > >>
> > >> Modified: head/usr.bin/top/top.c
> > >> 
> ==
> > >> --- head/usr.bin/top/top.c Sat Jun  2 21:50:00 2018(r334542)
> > >> +++ head/usr.bin/top/top.c Sat Jun  2 22:06:27 2018(r334543)
> > >> @@ -260,6 +260,15 @@ main(int argc, char *argv[])
> > >>  #define CMD_order 26
> > >>  #define CMD_pid   27
> > >>
> > >> +/*
> > >> + * Since top(1) is often long running and
> > >> + * doesn't typically care about where its running from
> > >> + * chdir to the root to allow unmounting of its
> > >> + * originall wd. Failure is alright as this is
> > >> + * just a courtesy for users.
> > >> + */
> > >> +chdir("/");
> > >> +
> > >
> > > Bad side effect of doing that is it is not hard to get a "core"
> > > from top when run as a user, as it is going to try to write
> > > to /, and it probably does not have permission for that.
> > >
> > > Better might be a cd to /tmp, or /var/tmp, which are usually
> > > hard to unmount for these reasons anyway.
> >
> > Unless you start top using the exec shell builtin, the shell that you
> > use to launch top will also be long running and will also prevent its
> > $cwd from being unmounted.
>
> Thats a good point, so that makes the chdir worthless.


Turns out it wasn't completely useless, but the usefulness ended before
FreeBSD 1.0 was released.


> > If you do use exec, then you will get logged out when you kill top ...
>
> :-(.
>
> The long standing (30 years) solution is to use lsof and find
> the processes that have cwd's in what ever it is you want to
> unmount.
>

30 years is a bit too long. lsof didn't exist until 1991. :) The issues
that prompted top to cd to / didn't get fixed until SysVr4 / early BSD
kernels in the early 90s, and didn't make it into some vendor code until
the mid 90's.


> Special casing top(1) is just a none solution to the
> can not unmount foo problem.
>

True. It used to be critically important to do.   Now, it's irrelevant. I
posted a longer version why after doing some research. Basically, through
the early System V releases, rebooting was weird and long running processes
had to take actions to ensure they didn't accidentally hold references to
non / filesystems. That did get fixed by the late 80's / early 90's, so
it's pointless these days. I'd misremembered the details over the weekend,
so forget I said it was a good change :)

Warner
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Brad Davis
On Mon, Jun 4, 2018, at 9:29 AM, Rodney W. Grimes wrote:
> [ Charset UTF-8 unsupported, converting... ]
> > On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > > Author: brd
> > > Date: Mon Jun  4 15:17:24 2018
> > > New Revision: 334617
> > > URL: https://svnweb.freebsd.org/changeset/base/334617
> > >
> > > Log:
> > >   Move /sys symlink creating out of etc/Makefile.
> > >
> > >   This is prep for etc/Makefile going away.
> > >
> > >   Approved by:  bapt (mentor)
> > >
> > 
> > Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> > is? Some of the NO_ROOT stuff there seems to be terribly broken and
> > needs to be fixed; this was on my 'some day to fix' list.
> 
> Yes please, much more information here.  I use some of the targets
> in src/etc/Makefile such as distribution:

All the config files need to be pushed back next to the source they belong to.

What do you use these targets for?

> I believe there are also other external consumers of this.

Such as?


Regards,
Brad Davis
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Brad Davis
On Mon, Jun 4, 2018, at 9:22 AM, Kyle Evans wrote:
> On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > Author: brd
> > Date: Mon Jun  4 15:17:24 2018
> > New Revision: 334617
> > URL: https://svnweb.freebsd.org/changeset/base/334617
> >
> > Log:
> >   Move /sys symlink creating out of etc/Makefile.
> >
> >   This is prep for etc/Makefile going away.
> >
> >   Approved by:  bapt (mentor)
> >
> 
> Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> is? Some of the NO_ROOT stuff there seems to be terribly broken and
> needs to be fixed; this was on my 'some day to fix' list.

It goes away in favor of using CONFS= and push the config files back to where 
the src lives for the particular config file.

So I would guess that this will fix the NO_ROOT stuff you are referring to, or 
at least move it to a central location (share/mk/)


Regards,
Brad Davis
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334604 - head/usr.bin/top

2018-06-04 Thread Ian Lepore
On Mon, 2018-06-04 at 05:27 +, Eitan Adler wrote:
> Author: eadler
> Date: Mon Jun  4 05:27:00 2018
> New Revision: 334604
> URL: https://svnweb.freebsd.org/changeset/base/334604
> 
> Log:
>   top(1): some nitpicks
>   
>   - prefer fully spelled names to "u_long"

Why? I though we preferred the u_char, u_int, u_long spellings in BSD
code? (I certainly prefer them, and I thought style(9) did too, but I
seem to be remembering that wrong).

-- Ian

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


Re: svn commit: r334543 - head/usr.bin/top

2018-06-04 Thread Ian Lepore
On Sun, 2018-06-03 at 14:33 -0700, Rodney W. Grimes wrote:
> > 
> > On Sat, Jun 2, 2018 at 11:08 PM, Eitan Adler  wrote:
> > 
> > > 
> > > On 2 June 2018 at 16:56, Rodney W. Grimes
> > >  wrote:
> > > > 
> > > > > 
> > > > > Author: eadler
> > > > > Date: Sat Jun  2 22:06:27 2018
> > > > > New Revision: 334543
> > > > > URL: https://svnweb.freebsd.org/changeset/base/334543
> > > > > 
> > > > > Log:
> > > > >   top(1): chdir to / as init; remove unneeded comment
> > > > > 
> > > > >   - chdir to / to allow unmounting of wd
> > > > >   - remove warning about running top(1) as setuid. If this is a 
> > > > > concern
> > > we
> > > > 
> > > > > 
> > > > >   should just drop privs instead.
> > > > > 
> > > > > Modified:
> > > > >   head/usr.bin/top/machine.c
> > > > >   head/usr.bin/top/top.c
> > > > > 
> > > > > Modified: head/usr.bin/top/machine.c
> > > > > 
> > > ==
> > > > 
> > > > > 
> > > > > --- head/usr.bin/top/machine.cSat Jun  2 21:50:00 2018
> > > (r334542)
> > > > 
> > > > > 
> > > > > +++ head/usr.bin/top/machine.cSat Jun  2 22:06:27 2018
> > > (r334543)
> > > > 
> > > > > 
> > > > > @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void 
> > > > > *arg2)
> > > > >  /*
> > > > >   * proc_owner(pid) - returns the uid that owns process "pid", or -1 
> > > > > if
> > > > >   *   the process does not exist.
> > > > > - *   It is EXTREMELY IMPORTANT that this function work
> > > correctly.
> > > > 
> > > > > 
> > > > > - *   If top runs setuid root (as in SVR4), then this function
> > > > > - *   is the only thing that stands in the way of a serious
> > > > > - *   security problem.  It validates requests for the "kill"
> > > > > - *   and "renice" commands.
> > > > >   */
> > > > > 
> > > > >  int
> > > > > 
> > > > > Modified: head/usr.bin/top/top.c
> > > > > 
> > > ==
> > > > 
> > > > > 
> > > > > --- head/usr.bin/top/top.cSat Jun  2 21:50:00 2018
> > > > > (r334542)
> > > > > +++ head/usr.bin/top/top.cSat Jun  2 22:06:27 2018
> > > > > (r334543)
> > > > > @@ -260,6 +260,15 @@ main(int argc, char *argv[])
> > > > >  #define CMD_order26
> > > > >  #define CMD_pid  27
> > > > > 
> > > > > +/*
> > > > > + * Since top(1) is often long running and
> > > > > + * doesn't typically care about where its running from
> > > > > + * chdir to the root to allow unmounting of its
> > > > > + * originall wd. Failure is alright as this is
> > > > > + * just a courtesy for users.
> > > > > + */
> > > > > +chdir("/");
> > > > > +
> > > > Bad side effect of doing that is it is not hard to get a "core"
> > > > from top when run as a user, as it is going to try to write
> > > > to /, and it probably does not have permission for that.
> > > Another person made the point that other similar applications don't do
> > > this, so I just reverted it.
> > > 
> > Actually,  it was a good change.
> > 
> > I've had issues on other systems where I couldn't unmount a filesystem for
> > reasons unknown.
> lsof is your friend here.  That is the tool of choice for finding
> cwd of processes that are in directories you can not unmount.
> 

Actually, rather than lsof (which I never even bother to install
anymore), I think the newer version of this advice is to use
procstat(1) from base. For example, to see why you can't umount /foo:

  procstat -af | grep /foo

-- Ian

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


Re: svn commit: r334552 - head/usr.bin/top

2018-06-04 Thread Warner Losh
On Sun, Jun 03, 2018 at 05:07:46AM +, Eitan Adler wrote:
> > New Revision: 334552
> > URL: https://svnweb.freebsd.org/changeset/base/334552
> >
> > Log:
> >   top(1): remove chdir to /
> >
> >   While this came out of a conversation in IRC, it turn out that some
> >   people don't like it. Since this was a courtesy feature, just remove
> it.
>

At first I thought you were nuts to remove it, since I thought this was a
wise change. However, I've changed my mind.

I've done some research behind this practice. A long time ago, it used to
be critical to the operation of the system: long running processes could
prevent a reboot. The 7th Edithion and earlier didn't even have a reboot
system call[*]. In System III and original System V based systems, you even
had to cd / before doing a shutdown. Otherwise the umounts of all the
filesystems except / would fail. There were no forcing provisions in the
code at that time. Long running processes would cd to / to avoid problems
with people needing to unmount a filesystem and secondarily to ensure that
the umounts would work if there were issues with the process dying at
reboot time. Somewhere around SysV r3 or so, these restrictions were
lessoned and by the time Solaris forked from SysV r4, they were mostly
gone. BSD kernels appear to have had similar issues, but they were fixed
(or became moot) very early on (maybe between 2.8 and 2.9, google isn't as
helpful as I'd had hoped here, and I didn't want to sink a ton of time
reading code on TUHS).

Fast forward to today, and they are unneeded. There's no issue with reboot.
There can be minor issues with umounting filesystems. fstat(1) can be used,
though it's a bit cumbersome, to find stray references.

Warner

[*] OK, a system call number was reserved for reboot, but it wasn't
implemented.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334609 - head/usr.sbin/pmc

2018-06-04 Thread Rodney W. Grimes
> > On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes
> >  wrote:
> > > [ Charset UTF-8 unsupported, converting... ]
> > >> Author: mmacy
> > >> Date: Mon Jun  4 06:30:35 2018
> > >> New Revision: 334609
> > >> URL: https://svnweb.freebsd.org/changeset/base/334609
> > >>
> > >> Log:
> > >>   pmc filter: avoid spurious gcc uninitialized warning
> > >
> > > Is it truely uninitialzized, or are you silencing a bogus warning,
> > > this commit and the code does not make that clear, and that should
> > > be made clear.
> > I didn't check the code, but given he said "spurious", I don't think
> > there's much ambiguity.
> 
> So your silencing a compiler warning without even figuring out if
 ^Mmacy 
> it is true or not.  Please do not do that.  That is not helpful to
> the code base.
> 
> If it is a bogus warning, the code needs marked as such.
> If it is a valid warning, then what you did is the proper solution.
  ^Mmacy

> 
> > Matt
Sorry, didnt realize this was a different Matt replying.


> > 
> > >
> > > Thanks,
> > > Rod
> > >>
> > >> Modified:
> > >>   head/usr.sbin/pmc/cmd_pmc_filter.c
> > >>
> > >> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c
> > >> ==
> > >> --- head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 05:55:40 2018   
> > >>  (r334608)
> > >> +++ head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 06:30:35 2018   
> > >>  (r334609)
> > >> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, 
> > >> ui
> > >>   if ((ps = pmclog_open(infd)) == NULL)
> > >>   errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: 
> > >> %s\n", strerror(errno));
> > >>
> > >> - pmccount = 0;
> > >> + eventcount = pmccount = 0;
> > >>   while (pmclog_read(ps, ) == 0) {
> > >>   if (ev.pl_type == PMCLOG_TYPE_INITIALIZE)
> > >>   memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, 
> > >> PMC_CPUID_LEN);
> > >>
> > >>
> > >
> > > --
> > > Rod Grimes 
> > > rgri...@freebsd.org
> > >
> > 
> > 
> 
> -- 
> Rod Grimes rgri...@freebsd.org
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334618 - head/sys/vm

2018-06-04 Thread Justin Hibbits
Author: jhibbits
Date: Mon Jun  4 15:44:17 2018
New Revision: 334618
URL: https://svnweb.freebsd.org/changeset/base/334618

Log:
  Align UMA data to 128 byte cacheline size
  
  Suggested by: mjg

Modified:
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Mon Jun  4 15:17:24 2018(r334617)
+++ head/sys/vm/uma_int.h   Mon Jun  4 15:44:17 2018(r334618)
@@ -176,7 +176,7 @@ struct uma_hash {
 /*
  * align field or structure to cache line
  */
-#if defined(__amd64__)
+#if defined(__amd64__) || defined(__powerpc64__)
 #define UMA_ALIGN  __aligned(128)
 #else
 #define UMA_ALIGN
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334609 - head/usr.sbin/pmc

2018-06-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes
>  wrote:
> > [ Charset UTF-8 unsupported, converting... ]
> >> Author: mmacy
> >> Date: Mon Jun  4 06:30:35 2018
> >> New Revision: 334609
> >> URL: https://svnweb.freebsd.org/changeset/base/334609
> >>
> >> Log:
> >>   pmc filter: avoid spurious gcc uninitialized warning
> >
> > Is it truely uninitialzized, or are you silencing a bogus warning,
> > this commit and the code does not make that clear, and that should
> > be made clear.
> I didn't check the code, but given he said "spurious", I don't think
> there's much ambiguity.

So your silencing a compiler warning without even figuring out if
it is true or not.  Please do not do that.  That is not helpful to
the code base.

If it is a bogus warning, the code needs marked as such.
If it is a valid warning, then what you did is the proper solution.

> Matt
> 
> >
> > Thanks,
> > Rod
> >>
> >> Modified:
> >>   head/usr.sbin/pmc/cmd_pmc_filter.c
> >>
> >> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c
> >> ==
> >> --- head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 05:55:40 2018 
> >>(r334608)
> >> +++ head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 06:30:35 2018 
> >>(r334609)
> >> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui
> >>   if ((ps = pmclog_open(infd)) == NULL)
> >>   errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: 
> >> %s\n", strerror(errno));
> >>
> >> - pmccount = 0;
> >> + eventcount = pmccount = 0;
> >>   while (pmclog_read(ps, ) == 0) {
> >>   if (ev.pl_type == PMCLOG_TYPE_INITIALIZE)
> >>   memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN);
> >>
> >>
> >
> > --
> > Rod Grimes 
> > rgri...@freebsd.org
> >
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> > Author: brd
> > Date: Mon Jun  4 15:17:24 2018
> > New Revision: 334617
> > URL: https://svnweb.freebsd.org/changeset/base/334617
> >
> > Log:
> >   Move /sys symlink creating out of etc/Makefile.
> >
> >   This is prep for etc/Makefile going away.
> >
> >   Approved by:  bapt (mentor)
> >
> 
> Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
> is? Some of the NO_ROOT stuff there seems to be terribly broken and
> needs to be fixed; this was on my 'some day to fix' list.

Yes please, much more information here.  I use some of the targets
in src/etc/Makefile such as distribution:

I believe there are also other external consumers of this.

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334609 - head/usr.sbin/pmc

2018-06-04 Thread Matt Joras
On Mon, Jun 4, 2018 at 8:18 AM, Rodney W. Grimes
 wrote:
> [ Charset UTF-8 unsupported, converting... ]
>> Author: mmacy
>> Date: Mon Jun  4 06:30:35 2018
>> New Revision: 334609
>> URL: https://svnweb.freebsd.org/changeset/base/334609
>>
>> Log:
>>   pmc filter: avoid spurious gcc uninitialized warning
>
> Is it truely uninitialzized, or are you silencing a bogus warning,
> this commit and the code does not make that clear, and that should
> be made clear.
I didn't check the code, but given he said "spurious", I don't think
there's much ambiguity.

Matt

>
> Thanks,
> Rod
>>
>> Modified:
>>   head/usr.sbin/pmc/cmd_pmc_filter.c
>>
>> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c
>> ==
>> --- head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 05:55:40 2018   
>>  (r334608)
>> +++ head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 06:30:35 2018   
>>  (r334609)
>> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui
>>   if ((ps = pmclog_open(infd)) == NULL)
>>   errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: 
>> %s\n", strerror(errno));
>>
>> - pmccount = 0;
>> + eventcount = pmccount = 0;
>>   while (pmclog_read(ps, ) == 0) {
>>   if (ev.pl_type == PMCLOG_TYPE_INITIALIZE)
>>   memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN);
>>
>>
>
> --
> Rod Grimes rgri...@freebsd.org
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334617 - in head: . etc

2018-06-04 Thread Kyle Evans
On Mon, Jun 4, 2018 at 10:17 AM, Brad Davis  wrote:
> Author: brd
> Date: Mon Jun  4 15:17:24 2018
> New Revision: 334617
> URL: https://svnweb.freebsd.org/changeset/base/334617
>
> Log:
>   Move /sys symlink creating out of etc/Makefile.
>
>   This is prep for etc/Makefile going away.
>
>   Approved by:  bapt (mentor)
>

Woah, woah, woah, woah. =) May I ask what your plan for etc/Makefile
is? Some of the NO_ROOT stuff there seems to be terribly broken and
needs to be fixed; this was on my 'some day to fix' list.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334609 - head/usr.sbin/pmc

2018-06-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: mmacy
> Date: Mon Jun  4 06:30:35 2018
> New Revision: 334609
> URL: https://svnweb.freebsd.org/changeset/base/334609
> 
> Log:
>   pmc filter: avoid spurious gcc uninitialized warning

Is it truely uninitialzized, or are you silencing a bogus warning,
this commit and the code does not make that clear, and that should
be made clear.

Thanks,
Rod
> 
> Modified:
>   head/usr.sbin/pmc/cmd_pmc_filter.c
> 
> Modified: head/usr.sbin/pmc/cmd_pmc_filter.c
> ==
> --- head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 05:55:40 2018
> (r334608)
> +++ head/usr.sbin/pmc/cmd_pmc_filter.cMon Jun  4 06:30:35 2018
> (r334609)
> @@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui
>   if ((ps = pmclog_open(infd)) == NULL)
>   errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: 
> %s\n", strerror(errno));
>  
> - pmccount = 0;
> + eventcount = pmccount = 0;
>   while (pmclog_read(ps, ) == 0) {
>   if (ev.pl_type == PMCLOG_TYPE_INITIALIZE)
>   memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN);
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334617 - in head: . etc

2018-06-04 Thread Brad Davis
Author: brd
Date: Mon Jun  4 15:17:24 2018
New Revision: 334617
URL: https://svnweb.freebsd.org/changeset/base/334617

Log:
  Move /sys symlink creating out of etc/Makefile.
  
  This is prep for etc/Makefile going away.
  
  Approved by:  bapt (mentor)

Modified:
  head/Makefile.inc1
  head/etc/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Jun  4 14:56:02 2018(r334616)
+++ head/Makefile.inc1  Mon Jun  4 15:17:24 2018(r334617)
@@ -1239,6 +1239,7 @@ distributeworld installworld stageworld: _installcheck
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
+   ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
 .endif
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
${IMAKEENV} rm -rf ${INSTALLTMP}

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Mon Jun  4 14:56:02 2018(r334616)
+++ head/etc/Makefile   Mon Jun  4 15:17:24 2018(r334617)
@@ -386,7 +386,6 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
${METALOG.add} ; \
done; true
 .endif
-   ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
 .if ${MK_NLS} != "no"
set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
while [ $$# -gt 0 ] ; do \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334543 - head/usr.bin/top

2018-06-04 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On 04/06/2018 00:33, Rodney W. Grimes wrote:
> > lsof is your friend here.  That is the tool of choice for finding
> > cwd of processes that are in directories you can not unmount.
> 
> s/lsof/fstat -f [-m]/
> :-)

I forget we have that tool!!   Old finger memory spells it lsof no
matter what my brain says.  I even forget when I dont have lsof
installed that I can get what I want from fstat!

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334543 - head/usr.bin/top

2018-06-04 Thread Rodney W. Grimes
> On  2 Jun, Rodney W. Grimes wrote:
> >> Author: eadler
> >> Date: Sat Jun  2 22:06:27 2018
> >> New Revision: 334543
> >> URL: https://svnweb.freebsd.org/changeset/base/334543
> >> 
> >> Log:
> >>   top(1): chdir to / as init; remove unneeded comment
> >>   
> >>   - chdir to / to allow unmounting of wd
> >>   - remove warning about running top(1) as setuid. If this is a concern we
> >>   should just drop privs instead.
> >> 
> >> Modified:
> >>   head/usr.bin/top/machine.c
> >>   head/usr.bin/top/top.c
> >> 
> >> Modified: head/usr.bin/top/machine.c
> >> ==
> >> --- head/usr.bin/top/machine.c Sat Jun  2 21:50:00 2018
> >> (r334542)
> >> +++ head/usr.bin/top/machine.c Sat Jun  2 22:06:27 2018
> >> (r334543)
> >> @@ -1613,11 +1613,6 @@ compare_ivcsw(const void *arg1, const void *arg2)
> >>  /*
> >>   * proc_owner(pid) - returns the uid that owns process "pid", or -1 if
> >>   *the process does not exist.
> >> - *It is EXTREMELY IMPORTANT that this function work 
> >> correctly.
> >> - *If top runs setuid root (as in SVR4), then this function
> >> - *is the only thing that stands in the way of a serious
> >> - *security problem.  It validates requests for the "kill"
> >> - *and "renice" commands.
> >>   */
> >>  
> >>  int
> >> 
> >> Modified: head/usr.bin/top/top.c
> >> ==
> >> --- head/usr.bin/top/top.c Sat Jun  2 21:50:00 2018(r334542)
> >> +++ head/usr.bin/top/top.c Sat Jun  2 22:06:27 2018(r334543)
> >> @@ -260,6 +260,15 @@ main(int argc, char *argv[])
> >>  #define CMD_order 26
> >>  #define CMD_pid   27
> >>  
> >> +/*
> >> + * Since top(1) is often long running and
> >> + * doesn't typically care about where its running from
> >> + * chdir to the root to allow unmounting of its
> >> + * originall wd. Failure is alright as this is
> >> + * just a courtesy for users.
> >> + */
> >> +chdir("/");
> >> +
> > 
> > Bad side effect of doing that is it is not hard to get a "core"
> > from top when run as a user, as it is going to try to write
> > to /, and it probably does not have permission for that.
> > 
> > Better might be a cd to /tmp, or /var/tmp, which are usually
> > hard to unmount for these reasons anyway.
> 
> Unless you start top using the exec shell builtin, the shell that you
> use to launch top will also be long running and will also prevent its
> $cwd from being unmounted.

Thats a good point, so that makes the chdir worthless.

> If you do use exec, then you will get logged out when you kill top ...

:-(.

The long standing (30 years) solution is to use lsof and find 
the processes that have cwd's in what ever it is you want to
unmount.

Special casing top(1) is just a none solution to the
can not unmount foo problem.


-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334616 - head/sys/dev/acpica

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 14:56:02 2018
New Revision: 334616
URL: https://svnweb.freebsd.org/changeset/base/334616

Log:
  Fix the NUMA build for non-x86 platforms.
  
  acpi_map_pxm_to_vm_domainid() is currently implemented only on x86.
  
  MFC after:1 week

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Jun  4 14:42:13 2018(r334615)
+++ head/sys/dev/acpica/acpi.c  Mon Jun  4 14:56:02 2018(r334616)
@@ -1090,6 +1090,7 @@ static int
 acpi_parse_pxm(device_t dev)
 {
 #ifdef NUMA
+#if defined(__i386__) || defined(__amd64__)
ACPI_HANDLE handle;
ACPI_STATUS status;
int pxm;
@@ -1102,6 +1103,7 @@ acpi_parse_pxm(device_t dev)
return (acpi_map_pxm_to_vm_domainid(pxm));
if (status == AE_NOT_FOUND)
return (-2);
+#endif
 #endif
return (-1);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334615 - head/usr.sbin/bsdinstall/scripts

2018-06-04 Thread Justin Hibbits
Author: jhibbits
Date: Mon Jun  4 14:42:13 2018
New Revision: 334615
URL: https://svnweb.freebsd.org/changeset/base/334615

Log:
  Set kernelname in bootconfig to the kernel file
  
  Summary:
  The kernel reads 'kernelname' to set the kern.bootfile sysctl.  By setting 
this,
  'make installkernel' will backup the running kernel as appropriate.
  
  Reviewed by:  nwhitehorn
  Differential Revision: https://reviews.freebsd.org/D15660

Modified:
  head/usr.sbin/bsdinstall/scripts/bootconfig

Modified: head/usr.sbin/bsdinstall/scripts/bootconfig
==
--- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Jun  4 14:23:04 2018
(r334614)
+++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Jun  4 14:42:13 2018
(r334615)
@@ -31,7 +31,7 @@ if [ `uname -m` == powerpc ]; then
if [ "$platform" == ps3 -o "$platform" == powernv ]; then
rootpart=$(awk '{ if($2 == "/") printf("%s:%s\n", $3, $1); }' 
$PATH_FSTAB)
mkdir -p $BSDINSTALL_CHROOT/boot/etc/
-   echo FreeBSD=\'/kernel/kernel vfs.root.mountfrom=${rootpart}\' 
> $BSDINSTALL_CHROOT/boot/etc/kboot.conf
+   echo FreeBSD=\'/kernel/kernel kernelname=/boot/kernel/kernel 
vfs.root.mountfrom=${rootpart}\' > $BSDINSTALL_CHROOT/boot/etc/kboot.conf
fi
 fi
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334614 - stable/11/cddl/usr.sbin/dtrace/tests/tools

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 14:23:04 2018
New Revision: 334614
URL: https://svnweb.freebsd.org/changeset/base/334614

Log:
  MFC r319792:
  Override the locale so that file lists get a consistent sort order.

Modified:
  stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
==
--- stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh  Mon Jun  4 
14:16:01 2018(r334613)
+++ stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh  Mon Jun  4 
14:23:04 2018(r334614)
@@ -89,6 +89,8 @@ if [ $# -ne 0 ]; then
 usage
 fi
 
+export LC_ALL=C
+
 readonly ORIGINDIR=$(realpath $(dirname $0))
 readonly TOPDIR=$(realpath ${ORIGINDIR}/../../../../..)
 readonly 
CONTRIB_TESTDIR=${TOPDIR}/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334613 - stable/11/sys/cddl/dev/dtrace/aarch64

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 14:16:01 2018
New Revision: 334613
URL: https://svnweb.freebsd.org/changeset/base/334613

Log:
  MFC r333570:
  DTrace aarch64: Avoid calling unwind_frame() in the probe context.

Modified:
  stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c
==
--- stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c  Mon Jun  4 14:15:03 
2018(r334612)
+++ stable/11/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c  Mon Jun  4 14:16:01 
2018(r334613)
@@ -70,7 +70,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in
 {
struct unwind_state state;
int scp_offset;
-   register_t sp;
+   register_t sp, fp;
int depth;
 
depth = 0;
@@ -88,11 +88,15 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in
state.pc = (uint64_t)dtrace_getpcstack;
 
while (depth < pcstack_limit) {
-   if (unwind_frame())
-   break;
-
if (!INKERNEL(state.pc) || !INKERNEL(state.fp))
break;
+
+   fp = state.fp;
+   state.sp = fp + 0x10;
+   /* FP to previous frame (X29) */
+   state.fp = *(register_t *)(fp);
+   /* LR (X30) */
+   state.pc = *(register_t *)(fp + 8) - 4;
 
/*
 * NB: Unlike some other architectures, we don't need to
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334612 - stable/11/share/man/man9

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 14:15:03 2018
New Revision: 334612
URL: https://svnweb.freebsd.org/changeset/base/334612

Log:
  MFC r334100:
  Document the return value of sbuf_bcat(9).

Modified:
  stable/11/share/man/man9/sbuf.9
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/sbuf.9
==
--- stable/11/share/man/man9/sbuf.9 Mon Jun  4 14:13:04 2018
(r334611)
+++ stable/11/share/man/man9/sbuf.9 Mon Jun  4 14:15:03 2018
(r334612)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 5, 2017
+.Dd May 23, 2018
 .Dt SBUF 9
 .Os
 .Sh NAME
@@ -616,6 +616,7 @@ function returns \-1 if
 was invalid, and zero otherwise.
 .Pp
 The
+.Fn sbuf_bcat ,
 .Fn sbuf_cat ,
 .Fn sbuf_cpy ,
 .Fn sbuf_printf ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334611 - stable/11/sys/geom/mirror

2018-06-04 Thread Mark Johnston
Author: markj
Date: Mon Jun  4 14:13:04 2018
New Revision: 334611
URL: https://svnweb.freebsd.org/changeset/base/334611

Log:
  MFC r333278, r333279:
  Avoid dropping the topology lock in gmirror's dumpconf implementation.

Modified:
  stable/11/sys/geom/mirror/g_mirror.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/mirror/g_mirror.c
==
--- stable/11/sys/geom/mirror/g_mirror.cMon Jun  4 11:35:04 2018
(r334610)
+++ stable/11/sys/geom/mirror/g_mirror.cMon Jun  4 14:13:04 2018
(r334611)
@@ -275,8 +275,6 @@ g_mirror_ndisks(struct g_mirror_softc *sc, int state)
struct g_mirror_disk *disk;
u_int n = 0;
 
-   sx_assert(>sc_lock, SX_LOCKED);
-
LIST_FOREACH(disk, >sc_disks, d_next) {
if (state == -1 || disk->d_state == state)
n++;
@@ -493,7 +491,9 @@ g_mirror_destroy_disk(struct g_mirror_disk *disk)
sc = disk->d_softc;
sx_assert(>sc_lock, SX_XLOCKED);
 
+   g_topology_lock();
LIST_REMOVE(disk, d_next);
+   g_topology_unlock();
g_mirror_event_cancel(disk);
if (sc->sc_hint == disk)
sc->sc_hint = NULL;
@@ -520,6 +520,8 @@ static void
 g_mirror_free_device(struct g_mirror_softc *sc)
 {
 
+   g_topology_assert();
+
mtx_destroy(>sc_queue_mtx);
mtx_destroy(>sc_events_mtx);
mtx_destroy(>sc_done_mtx);
@@ -2624,6 +2626,7 @@ again:
DISK_STATE_CHANGED();
 
disk->d_state = state;
+   g_topology_lock();
if (LIST_EMPTY(>sc_disks))
LIST_INSERT_HEAD(>sc_disks, disk, d_next);
else {
@@ -2641,6 +2644,7 @@ again:
if (dp != NULL)
LIST_INSERT_AFTER(dp, disk, d_next);
}
+   g_topology_unlock();
G_MIRROR_DEBUG(1, "Device %s: provider %s detected.",
sc->sc_name, g_mirror_get_diskname(disk));
if (sc->sc_state == G_MIRROR_DEVICE_STATE_STARTING)
@@ -3326,24 +3330,20 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent,
disk = cp->private;
if (disk == NULL)
return;
-   g_topology_unlock();
-   sx_xlock(>sc_lock);
sbuf_printf(sb, "%s%u\n", indent, (u_int)disk->d_id);
if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) {
sbuf_printf(sb, "%s", indent);
if (disk->d_sync.ds_offset == 0)
sbuf_printf(sb, "0%%");
-   else {
+   else
sbuf_printf(sb, "%u%%",
(u_int)((disk->d_sync.ds_offset * 100) /
-   sc->sc_provider->mediasize));
-   }
+   sc->sc_mediasize));
sbuf_printf(sb, "\n");
-   if (disk->d_sync.ds_offset > 0) {
+   if (disk->d_sync.ds_offset > 0)
sbuf_printf(sb, "%s%jd"
"\n", indent,
(intmax_t)disk->d_sync.ds_offset);
-   }
}
sbuf_printf(sb, "%s%u\n", indent,
disk->d_sync.ds_syncid);
@@ -3378,11 +3378,7 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent,
disk->d_priority);
sbuf_printf(sb, "%s%s\n", indent,
g_mirror_disk_state2str(disk->d_state));
-   sx_xunlock(>sc_lock);
-   g_topology_lock();
} else {
-   g_topology_unlock();
-   sx_xlock(>sc_lock);
sbuf_printf(sb, "%s", indent);
switch (sc->sc_type) {
case G_MIRROR_TYPE_AUTOMATIC:
@@ -3434,8 +3430,6 @@ g_mirror_dumpconf(struct sbuf *sb, const char *indent,
else
sbuf_printf(sb, "%s", "DEGRADED");
sbuf_printf(sb, "\n");
-   sx_xunlock(>sc_lock);
-   g_topology_lock();
}
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat

2018-06-04 Thread Konstantin Belousov
On Mon, Jun 04, 2018 at 03:08:15PM +0300, Konstantin Belousov wrote:
> On Mon, Jun 04, 2018 at 01:10:23AM +, Matt Macy wrote:
> > @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, 
> > void
> >  
> > pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR,
> > (struct trapframe *) arg);
> > +
> > +   KASSERT(td->td_pinned == 1,
> > +   ("[pmc,%d] invalid td_pinned value", __LINE__));
> > +   sched_unpin();  /* Can migrate safely now. */
> sched_pin() is called from pmc_post_callchain_callback(), which is
> called from userret(). userret() is executed with interrupts and
> preemption enabled, so there is a non-trivial chance that the thread
> already migrated.
> 
> In fact, I do not see a need to disable migration for the thread if user
> callchain is planned to be gathered. You only need to remember the cpu
> where the interrupt occured, to match it against the request.  Or are
> per-cpu PMC registers still accessed during callchain collection ?

And more, it is safe to access userspace from userret() so you can
walk usermode stack in the pmc callback directly, without scheduling
an ast.

> 
> > +int
> > +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe 
> > *tf,
> > +int inuserspace)
> > +{
> > +   struct thread *td;
> > +
> > +   td = curthread;
> > +   if ((pm->pm_flags & PMC_F_USERCALLCHAIN) &&
> > +   td && td->td_proc &&
> > +   (td->td_proc->p_flag & P_KPROC) == 0 &&
> > +   !inuserspace) {
> I am curious why a lot of the pmc code checks for curthread != NULL and,
> like this fragment, for curproc != NULL.  I am sure that at least on x86,
> we never let curthread point to the garbage, even during the context
> switches.  NMI handler has the same cargo-cult check, BTW.
> 
> Also, please fix the indentation of the conditions block.
> 
> > +   atomic_add_int(>td_pmcpend, 1);
> You can use atomic_store_int() there, I believe,  Then there would be
> no locked op executed at all, on x86.
> 
> > @@ -375,6 +375,7 @@ struct thread {
> > void*td_lkpi_task;  /* LinuxKPI task struct pointer */
> > TAILQ_ENTRY(thread) td_epochq;  /* (t) Epoch queue. */
> > epoch_section_t td_epoch_section; /* (t) epoch section object */
> > +   int td_pmcpend;
> Why this member was not put into the zeroed region ?  Wouldn't a garbage
> there cause uneccessary ASTs ?
> 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334595 - in head: sys/dev/hwpmc sys/kern sys/sys usr.sbin/pmcstat

2018-06-04 Thread Konstantin Belousov
On Mon, Jun 04, 2018 at 01:10:23AM +, Matt Macy wrote:
> @@ -2214,6 +2236,11 @@ pmc_hook_handler(struct thread *td, int function, void
>  
>   pmc_capture_user_callchain(PCPU_GET(cpuid), PMC_HR,
>   (struct trapframe *) arg);
> +
> + KASSERT(td->td_pinned == 1,
> + ("[pmc,%d] invalid td_pinned value", __LINE__));
> + sched_unpin();  /* Can migrate safely now. */
sched_pin() is called from pmc_post_callchain_callback(), which is
called from userret(). userret() is executed with interrupts and
preemption enabled, so there is a non-trivial chance that the thread
already migrated.

In fact, I do not see a need to disable migration for the thread if user
callchain is planned to be gathered. You only need to remember the cpu
where the interrupt occured, to match it against the request.  Or are
per-cpu PMC registers still accessed during callchain collection ?

> +int
> +pmc_process_interrupt(int cpu, int ring, struct pmc *pm, struct trapframe 
> *tf,
> +int inuserspace)
> +{
> + struct thread *td;
> +
> + td = curthread;
> + if ((pm->pm_flags & PMC_F_USERCALLCHAIN) &&
> + td && td->td_proc &&
> + (td->td_proc->p_flag & P_KPROC) == 0 &&
> + !inuserspace) {
I am curious why a lot of the pmc code checks for curthread != NULL and,
like this fragment, for curproc != NULL.  I am sure that at least on x86,
we never let curthread point to the garbage, even during the context
switches.  NMI handler has the same cargo-cult check, BTW.

Also, please fix the indentation of the conditions block.

> + atomic_add_int(>td_pmcpend, 1);
You can use atomic_store_int() there, I believe,  Then there would be
no locked op executed at all, on x86.

> @@ -375,6 +375,7 @@ struct thread {
>   void*td_lkpi_task;  /* LinuxKPI task struct pointer */
>   TAILQ_ENTRY(thread) td_epochq;  /* (t) Epoch queue. */
>   epoch_section_t td_epoch_section; /* (t) epoch section object */
> + int td_pmcpend;
Why this member was not put into the zeroed region ?  Wouldn't a garbage
there cause uneccessary ASTs ?

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


svn commit: r334610 - head/sys/fs/nfsserver

2018-06-04 Thread Rick Macklem
Author: rmacklem
Date: Mon Jun  4 11:35:04 2018
New Revision: 334610
URL: https://svnweb.freebsd.org/changeset/base/334610

Log:
  Revert r334586 since I now think __unused is the better way to handle this.

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon Jun  4 06:30:35 2018
(r334609)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon Jun  4 11:35:04 2018
(r334610)
@@ -1574,10 +1574,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram,
struct nfsvattr at;
int nlen, error = 0, getret = 1;
int siz, cnt, fullsiz, eofflag, ncookies;
-   u_int64_t off, toff;
-#if 0
-   u_int64_t verf;
-#endif
+   u_int64_t off, toff, verf;
u_long *cookies = NULL, *cookiep;
struct uio io;
struct iovec iv;
@@ -1594,9 +1591,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd, int isdgram,
NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
off = fxdr_hyper(tl);
tl += 2;
-#if 0
verf = fxdr_hyper(tl);
-#endif
tl += 2;
}
toff = off;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334474 - head/usr.bin/top

2018-06-04 Thread Florian Smeets via svn-src-all
On Mon, Jun 04, 2018 at 03:42:40AM -0700, Eitan Adler wrote:
> On 3 June 2018 at 22:45, Baptiste Daroussin  wrote:
> >> Hi,
> >>
> > IMHO showing TIDs should
> >> be a separate flag, 'h' maybe, as this commit changes current/expected
> >> behavior (POLA?).
> 
> Its a reasonable idea to split this out into a separate flag. I'll do that.
> 

Ok, thanks.

> >> Also, this is not documented in the man page.
> 
> It is: see the commit.
> 

Yeah, I should have been more specific, sorry. It is not documented in the 
OPTIONS
section for -H, only in the INTERACTIVE MODE section.

Florian
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334474 - head/usr.bin/top

2018-06-04 Thread Eitan Adler
On 3 June 2018 at 22:45, Baptiste Daroussin  wrote:
>> Hi,
>>
> IMHO showing TIDs should
>> be a separate flag, 'h' maybe, as this commit changes current/expected
>> behavior (POLA?).

Its a reasonable idea to split this out into a separate flag. I'll do that.

>> Also, this is not documented in the man page.

It is: see the commit.



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334552 - head/usr.bin/top

2018-06-04 Thread Alexey Dokuchaev
On Sun, Jun 03, 2018 at 05:07:46AM +, Eitan Adler wrote:
> New Revision: 334552
> URL: https://svnweb.freebsd.org/changeset/base/334552
> 
> Log:
>   top(1): remove chdir to /
>   
>   While this came out of a conversation in IRC, it turn out that some
>   people don't like it. Since this was a courtesy feature, just remove it.

Thank you.  I was also quite surprized by this change (chdir to /).

./danfe
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r334609 - head/usr.sbin/pmc

2018-06-04 Thread Matt Macy
Author: mmacy
Date: Mon Jun  4 06:30:35 2018
New Revision: 334609
URL: https://svnweb.freebsd.org/changeset/base/334609

Log:
  pmc filter: avoid spurious gcc uninitialized warning

Modified:
  head/usr.sbin/pmc/cmd_pmc_filter.c

Modified: head/usr.sbin/pmc/cmd_pmc_filter.c
==
--- head/usr.sbin/pmc/cmd_pmc_filter.c  Mon Jun  4 05:55:40 2018
(r334608)
+++ head/usr.sbin/pmc/cmd_pmc_filter.c  Mon Jun  4 06:30:35 2018
(r334609)
@@ -145,7 +145,7 @@ pmc_filter_handler(uint32_t *lwplist, int lwpcount, ui
if ((ps = pmclog_open(infd)) == NULL)
errx(EX_OSERR, "ERROR: Cannot allocate pmclog parse state: 
%s\n", strerror(errno));
 
-   pmccount = 0;
+   eventcount = pmccount = 0;
while (pmclog_read(ps, ) == 0) {
if (ev.pl_type == PMCLOG_TYPE_INITIALIZE)
memcpy(cpuid, ev.pl_u.pl_i.pl_cpuid, PMC_CPUID_LEN);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r334543 - head/usr.bin/top

2018-06-04 Thread Andriy Gapon
On 04/06/2018 00:33, Rodney W. Grimes wrote:
> lsof is your friend here.  That is the tool of choice for finding
> cwd of processes that are in directories you can not unmount.

s/lsof/fstat -f [-m]/
:-)

-- 
Andriy Gapon
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"