aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* pmc: silence scan-build warningsMatt Macy2018-05-291-10/+7
| | | | Notes: svn path=/head/; revision=334353
* pmc: Add new sub-command structured "pmc" utilityMatt Macy2018-05-296-0/+826
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will manage pmc functionality with a more manageable structure of subcommands rather than the gradually accreted spaghetti logic of overlapping flags that exists in pmcstat. This is intended to ultimately have all the same functionality as pmcannotate+pmccontrol+pmcstat. Currently it just has "stat" and "system-stat" - counters for the process itself and counters for the system as a whole respectively (i.e. system-stat includes kernel threads). Note that the rusage results (page faults/context switches/ user/sys) for stat-system will not account for the system as a whole - only for the child process specified on the command line. Implementing stat was suggested by mjg@ and the output is based on that from Linux's "perf stat". % pmc stat -- make -j32 buildkernel -DNO_MODULES -ss > /dev/null 9598393 page faults # 0.674 M/sec 387085 voluntary csw # 0.027 M/sec 106989 involuntary csw # 0.008 M/sec 2763965982317 cycles 2542953049760 instructions # 0.920 inst/cycle 511562750157 branches 12917006881 branch-misses # 2.525% 17944429878 cache-references # 0.007 refs/inst 2205119560 cache-misses # 12.289% 43.74 real # 2019.72% cpu 795.09 user # 1817.72% cpu 88.35 sys # 202.00% cpu % make -j32 buildkernel -DNO_MODULES -ss > /dev/null & % sudo pmc stat-system cat ^C 103 page faults # 0.811 M/sec 4 voluntary csw # 0.031 M/sec 0 involuntary csw # 0.000 M/sec 2843639070514 cycles 2606171217438 instructions # 0.916 inst/cycle 522450422783 branches 13092862839 branch-misses # 2.506% 18592101113 cache-references # 0.007 refs/inst 2562878667 cache-misses # 13.785% 44.85 real # 0.00% cpu 0.00 user # 0.00% cpu 0.00 sys # 0.00% cpu Notes: svn path=/head/; revision=334350
* Simplify macros EFPRINTF and EFFLUSH. [0]Marcelo Araujo2018-05-291-36/+5
| | | | | | | | | | | | | | | Also stdarg(3) says that each invocation of va_start() must be paired with a corresponding invocation of va_end() in the same function. [1] Reported by: Coverity CID: 1194318[0] and 1194332[1] Discussed with: jhb MFC after: 4 weeks. Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15548 Notes: svn path=/head/; revision=334307
* sysrc(8): Test variable names for invalid charactersDevin Teske2018-05-281-0/+12
| | | | | | | | | | | PR: bin/187461 Reported by: ebay@looksharp.net MFC after: 4 weeks X-MFC-to: stable/11 (after 11.2-R) Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=334303
* Buildfix for GCC after r334277.Hans Petter Selasky2018-05-281-0/+2
| | | | | | | | MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=334279
* MFV r333789: libpcap 1.9.0 (pre-release)Hans Petter Selasky2018-05-281-0/+1
| | | | | | | | MFC after: 1 month Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=334277
* bhyve: guarantee NUL terminationEric van Gyzen2018-05-281-1/+1
| | | | | | | | | | | | Use strlcpy to guarantee NUL termination of the path to a virtio console socket. Reported by: Coverity CID: 1362874 Sponsored by: Dell EMC Notes: svn path=/head/; revision=334272
* bhyve: fix small memory leak in virtio consoleEric van Gyzen2018-05-281-1/+1
| | | | | | | | | Reported by: Coverity CID: 1363284 Sponsored by: Dell EMC Notes: svn path=/head/; revision=334271
* tcpdrop: ensure NUL termination of a stringEric van Gyzen2018-05-281-3/+3
| | | | | | | | | | | | | strncpy did not guarantee NUL termination of the "stack" string. Use strlcpy instead. While I'm here, avoid unnecessary memset and strnlen calls. Reported by: Coverity CID: 1381035 Sponsored by: Dell EMC Notes: svn path=/head/; revision=334265
* pmcstat: suppress uninitialized warning of eventMatt Macy2018-05-271-0/+1
| | | | Notes: svn path=/head/; revision=334256
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-263-29/+62
| | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Notes: svn path=/head/; revision=334244
* Revert r334242 "pmc(3)/hwpmc(4): update supported Intel processors to rely ↵Matt Macy2018-05-263-62/+29
| | | | | | | | | fully on the" because of squash commit messages Notes: svn path=/head/; revision=334243
* pmc(3)/hwpmc(4): update supported Intel processors to rely fully on theMatt Macy2018-05-263-29/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vendor provided pmu-events tables and sundry cleanups. The vendor pmu-events tables provide counter descriptions, default sample rates, event, umask, and flag values for all the counter configuration permutations. Using this gives us: - much simpler kernel code for the MD component - helpful long and short event descriptions - simpler user code - sample rates that won't overload the system Update man page with newer sample types and remove unused sample type. Squashed commit of the following: commit 4459d43eff815bec08ccc5533dbe5de846f03128 Author: Matt Macy <mmacy@mattmacy.io> Date: Sat May 26 00:06:31 2018 -0700 libpmc: fix pmu function signatures for non amd64 commit a2cb8bbc586c65d41f9b291430a2261ec67b59fe Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:38:11 2018 -0700 pmcstat: fix indentation of usage commit f686954b15ff56a833ac80404898977cb80a265b Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:49 2018 -0700 pmclog(3): add callchain and pmcallocatedyn, remove pcsample commit 73e13a0d2e9498c81c150d14d022050cee7511bb Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:19:00 2018 -0700 pmclog.h: GC pcsample field commit 3e93ffd65da641fa657539dad3c48e281f8b5798 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:05:57 2018 -0700 hwpmc: make Intel core CPUs use external event tables commit 634f5fae1e1644ac324003136c66cd9c619d1c93 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 22:00:06 2018 -0700 pmclog: update log record types, bump PMC_MAJOR - explicitly make log record types a multiple of 8 bytes - hook in pmu event types for pmc_allocate records - remove references to no longer PCSAMPLE record commit 83d84fcd2d65bdf6ddcb2e155a22f0cfa2a9c225 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 21:52:10 2018 -0700 libpmc: add support for having vendor table driven pmc_allocate commit 9e6ad63c40c2fce8404847ace5078ca6cb33a736 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:11:33 2018 -0700 hwpmc_core: add accessors for EVSEL & UMASK, make IAP_UMASK useful to user commit 859dceb93daa6419a48c794db99b6758e5b041c9 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 19:09:45 2018 -0700 pmcstat: update usage and man page as well as make -L consistent with pmccontrol commit 79c7d8597e28c2eb13f5f9113e65ec2792ca57b1 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 18:07:03 2018 -0700 pmu_util: add support for all current intel event keywords commit d8089c7f6a6c8527f38324252b1ffb47004694c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:45:00 2018 -0700 add description for new arguments commit 058336740bab53c62ec88a3a026ea848cf3878c6 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 17:38:15 2018 -0700 libpmc: move pmu_events table and pmu_utils out of libpmcstat so that they can be used by pmc_allocate commit 049b66b382e2f833c3f47bc8df9e750cb265709f Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:12:41 2018 -0700 pmcstat: hook pmu_events counter description utility routines in commit f5e01e7b37a691dc045e1aa16b3ebdd162515de8 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:11:59 2018 -0700 pmu_events: add utility routines for listing counters and their descriptions commit cba4d4f8907f772279f86f18f915e0d74d33ac56 Author: Matt Macy <mmacy@mattmacy.io> Date: Fri May 25 16:09:50 2018 -0700 pmu-events: expand out skylake regex to simplify string matches Notes: svn path=/head/; revision=334242
* We don't need check if str is NULL as free(3) will handle NULLMarcelo Araujo2018-05-251-2/+1
| | | | | | | | | argument. Reported by: kib@ Notes: svn path=/head/; revision=334219
* After a long discussion about assert(3), we gonna use a HardenedBSDMarcelo Araujo2018-05-251-2/+5
| | | | | | | | | | | approach to chek strdup(3) memory allocation. Submitted by: Shaw Webb <shawn.webb@hardenedbsd.org> Reported by: brooks Obtained from: HardenedBSD Notes: svn path=/head/; revision=334216
* pmcstat(8)Sean Bruno2018-05-252-3/+14
| | | | | | | | | | | - Document per thread filtering. Submitted by: kbowling Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15549 Notes: svn path=/head/; revision=334215
* Fix a memory leak on topology_parse().Marcelo Araujo2018-05-251-2/+9
| | | | | | | | | | | | | | | | | | | strdup(3) allocates memory for a copy of the string, does the copy and returns a pointer to it. If there is no sufficient memory NULL is returned and the global errno is set to ENOMEM. We do a sanity check to see if it was possible to allocate enough memory. Also as we allocate memory, we need to free this memory used. Or it will going out of scope leaks the storage it points to. Reviewed by: rgrimes MFC after: 3 weeks. X-MFC: r332298 Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15550 Notes: svn path=/head/; revision=334199
* pmcstat: add usage strings for -L and -IMatt Macy2018-05-241-0/+2
| | | | Notes: svn path=/head/; revision=334135
* pmcstat top mode + -I - use fully qualified addressMatt Macy2018-05-241-1/+1
| | | | Notes: svn path=/head/; revision=334133
* pmcstat: don't compare signed and unsignedMatt Macy2018-05-241-1/+2
| | | | Notes: svn path=/head/; revision=334131
* libpmcstat: compile in events based on json descriptionMatt Macy2018-05-242-4/+2
| | | | Notes: svn path=/head/; revision=334128
* pmc: bump PMC major version to reflect ABI breakage and make warning not ↵Matt Macy2018-05-231-1/+1
| | | | | | | require verbose Notes: svn path=/head/; revision=334114
* hwpmc: add thread id field to callchain and context switch records to allow ↵Matt Macy2018-05-231-1/+5
| | | | | | | | | | | | | | | filtering on thread in post-processing. To generate stacks for just ${THREADID}: pmcstat -R ${PREFIX}.pmcstat -L ${THREADID} -z100 -G ${PREFIX}.stacks Sponsored by: Limelight Networks Notes: svn path=/head/; revision=334108
* mpsutil: correct styleEitan Adler2018-05-231-2/+1
| | | | | | | Reported by: bapt Notes: svn path=/head/; revision=334085
* pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error numberMarcelo Araujo2018-05-231-11/+21
| | | | | | | | | | | | | | will be returned to indicate the error, so I'm applying an assert(3) to do a sanity check of the return value. Reported by: Coverity CID: 1391235, 1193654 and 1193651 Reviewed by: grehan MFC after: 4 weeks. Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15533 Notes: svn path=/head/; revision=334084
* mpsutil: add missing bracesEitan Adler2018-05-231-2/+4
| | | | | | | Obtained from: DragonFly (c5d53f11a9510c5c79e196857a1200925fffacc8) Notes: svn path=/head/; revision=334075
* Revert: r334016Marcelo Araujo2018-05-221-1/+2
| | | | | | | Revert for now this change, it in somehow breaks init_pci. Notes: svn path=/head/; revision=334021
* Include atkbdc header where there are declared the prototype functionsMarcelo Araujo2018-05-221-0/+1
| | | | | | | | | | atkbdc_event and atkbdc_init. MFC after: 4 weeks. Sponsored by: iXsystems Inc. Notes: svn path=/head/; revision=334019
* pmcstat: add option to not decode the leaf function in top modeMatt Macy2018-05-222-5/+8
| | | | | | | | -I will allow the user to see the hot instruction in question as opposed getting the name of the function Notes: svn path=/head/; revision=334017
* We must free the variable str.Marcelo Araujo2018-05-221-2/+1
| | | | | | | | | | | | Spotted by: clang's static analyzer Submitted by: Tom Rix <trix_juniper.net> Reviewed by: grehan MFC after: 4 weeks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D10009 Notes: svn path=/head/; revision=334016
* mtest: build with WARNS=3Eitan Adler2018-05-192-3/+4
| | | | Notes: svn path=/head/; revision=333894
* Use sysrc(8) in the documentation rather than echoing things to rc.confNathan Whitehorn2018-05-181-2/+2
| | | | | | | | | | | in order to encourage good habits. PR: 228325 Submitted by: Mateusz Piotrowski MFC after: 2 weeks Notes: svn path=/head/; revision=333804
* Fix math error in the computation of the free space after the last partitionNathan Whitehorn2018-05-181-1/+1
| | | | | | | | | | | on a disk. This resulted in one sector always remaining free at the end. PR: bin/228322 Submitted by: Rikiya Yonemoto MFC after: 2 weeks Notes: svn path=/head/; revision=333803
* Teach pmcannotate about $TMPDIR and _PATH_TMPAndrew Gallatin2018-05-181-2/+15
| | | | | | | | | | | | | Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard coding /tmp for temporary files. Pmcannotate sometimes needs quite a lot of space to store the output from objdump, and will fail in odd ways if that output is truncated due to lack of space in /tmp. Reviewed by: jtl Sponsored by: Netflix Notes: svn path=/head/; revision=333793
* Add missing newline to end of -c usage string .Rodney W. Grimes2018-05-171-1/+1
| | | | | | | | | | | Pointy hat: me Submitted by: novel Approved by: bde(mentor), grehan (maintainer) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15421 Notes: svn path=/head/; revision=333712
* makefs: ANSIfyEd Maste2018-05-162-18/+5
| | | | Notes: svn path=/head/; revision=333664
* Sort mlx5tool correctly in usr.sbin/MakefileEd Maste2018-05-161-1/+1
| | | | Notes: svn path=/head/; revision=333663
* vq_getchain() can return -1 if some descriptor(s) are invalid and printsMarcelo Araujo2018-05-151-0/+1
| | | | | | | | | | | | | | a diagnostic message. So we do a sanity checking on the return value of vq_getchain(). Spotted by: gcc49 Reviewed by: avg MFC after: 4 weeks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15388 Notes: svn path=/head/; revision=333622
* cxgbetool(8): Provide user interface for hashfilters, hardware NAT, andNavdeep Parhar2018-05-152-87/+306
| | | | | | | | | other filtering related features that were recently added to the driver. Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=333621
* If the sole non-option command line argument is "none", remove anyDag-Erling Smørgrav2018-05-121-6/+26
| | | | | | | | | | pre-existing forwarder configuration and set Unbound up to recurse. PR: 222902 MFC after: 1 week Notes: svn path=/head/; revision=333574
* Rename all Unbound binaries and man pages from unbound* to local-unbound*.Dag-Erling Smørgrav2018-05-129-9/+19
| | | | | | | PR: 222902 Notes: svn path=/head/; revision=333573
* cpucontrol: improve Intel microcode revision checkEd Maste2018-05-121-1/+8
| | | | | | | | | | | | | | According to the Intel SDM (Volme 3, 9.11.7) the BIOS signature MSR should be zeroed before executing cpuid (although in practice it does not seem to matter). PR: 192487 Submitted by: Dan Lukes Reported by: Henrique de Moraes Holschuh MFC after: 3 days Notes: svn path=/head/; revision=333569
* Upgrade Unbound to 1.6.2. More to follow.Dag-Erling Smørgrav2018-05-121-3/+3
| | | | Notes: svn path=/head/; revision=333559
* Upgrade Unbound to 1.6.1. More to follow.Dag-Erling Smørgrav2018-05-121-1/+2
| | | | Notes: svn path=/head/; revision=333557
* Fix mld6query(8) and add a new -g optionStephen Hurd2018-05-112-15/+35
| | | | | | | | | | | | | | | | The mld6query command relies on KAME behaviour which allows the ipv6mr_multiaddr member of the request object in a IPV6_JOIN_GROUP setsockopt() call to be INADDR6_ANY. The FreeBSD stack doesn't allow this, so mld6query has been non-functional. Also, add a -g option which sends a General Query (query INADDR6_ANY) Reviewed by: sbruno, mmacy Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15384 Notes: svn path=/head/; revision=333501
* Reduce <sys/queue.h> pollution.Dag-Erling Smørgrav2018-05-112-0/+2
| | | | | | | | | | | | While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only actually used in code which is conditional on _KERNEL. Make the #include itself conditional as well, and fix userland code that uses <sys/queue.h> for other purposes but relied on <sys/sysctl.h> to bring it in. MFC after: 1 week Notes: svn path=/head/; revision=333475
* Remove "All rights reserved" from my files.Xin LI2018-05-102-3/+1
| | | | | | | | | See r333391 for the rationale. MFC after: 1 week Notes: svn path=/head/; revision=333449
* Rework CTL frontend & backend options to use nv(3), allow creating multipleMarcelo Araujo2018-05-109-305/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ioctl frontend ports. This revision introduces two changes to CTL: - Changes the way options are passed to CTL_LUN_REQ and CTL_PORT_REQ ioctls. Removes ctl_be_arg structure and associated logic and replaces it with nv(3)-based logic for passing in and out arguments. - Allows creating multiple ioctl frontend ports using either ctladm(8) or ctld(8). New frontend ports are represented by /dev/cam/ctl<pp>.<vp> nodes, eg /dev/cam/ctl5.3. Those device nodes respond only to CTL_IO ioctl. New command-line options for ctladm: # creates new ioctl frontend port with using free pp and vp=0 ctladm port -c # creates new ioctl frontend port with pp=10 and vp=0 ctladm port -c -O pp=10 # creates new ioctl frontend port with pp=11 and vp=12 ctladm port -c -O pp=11 -O vp=12 # removes port with number 4 (it's a "targ_port" number, not pp number) ctladm port -r -p 4 New syntax for ctl.conf: target ... { port ioctl/<pp> ... } target ... { port ioctl/<pp>/<vp> ... Note: Most of this work was made by jceel@, thank you. Submitted by: jceel Reworked by: myself Reviewed by: mav (earlier versions and recently during the rework) Obtained from: FreeNAS and TrueOS Relnotes: Yes Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D9299 Notes: svn path=/head/; revision=333446
* Remove "all rights reserved" on files where I have copyright.Niclas Zeising2018-05-091-1/+0
| | | | | | | | | | According to r333391 it is not needed any more. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D15370 Notes: svn path=/head/; revision=333420
* nxge(4):Sean Bruno2018-05-081-1/+0
| | | | | | | | | | | | | Remove nxge(4) and associated man page and tools in FreeBSD 12.0. Submitted by: kbowling Reviewed by: brooks Relnotes: yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D1529 Notes: svn path=/head/; revision=333388