aboutsummaryrefslogtreecommitdiff
path: root/cddl/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* Remove -I flag for include path that doesn't existAlex Richardson2020-09-104-4/+0
| | | | | | | | | | Found this while trying to get macOS bootstrap to work again after OpenZFS merge. Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26192 Notes: svn path=/head/; revision=365580
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-2515-62/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* Enable creation of static userspace probes in incremental builds.Mark Johnston2020-08-201-4/+0
| | | | | | | | | | | | | | | | | | To define USDT probes, dtrace -G makes use of relocations for undefined symbols: the target address is overwritten with NOPs and the location is recorded in the DOF section of the output object file. To avoid link errors, the original relocation is destroyed. However, this means that the same input object file cannot be processed multiple times, as happens during incremental rebuilds. Instead, only set the relocation type to NONE, so that all information required to reconstruct USDT probes is preserved. Reported by: bdrewery MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=364438
* dtrace tests: Support globbing for excludesBryan Drewery2020-04-292-3/+20
| | | | | | | | | | | Downstream this makes skipping tests like common/ip/tst.*sctp*.ksh simpler. Reviewed by: vangyzen, cem, markj Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24608 Notes: svn path=/head/; revision=360476
* zfsd.8: fix orphan .XrAlan Somers2020-04-181-6/+3
| | | | | | | | | | Though ZFS is a kernel module, it has no man page in section 4. Reported by: phk MFC after: 2 weeks Notes: svn path=/head/; revision=360077
* DTrace: add a top level makefile to the new test suitMariusz Zaborski2019-06-091-0/+9
| | | | | | | Pointed out by: markj Notes: svn path=/head/; revision=348841
* DTrace: create an amd64 test suitMariusz Zaborski2019-06-053-1/+25
| | | | | | | | | | | | | Create two tests checking if we can read urgs registers and if the rax register returns a correct number. Reviewed by: markj Discussed with: lwhsu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20364 Notes: svn path=/head/; revision=348706
* Hook up the existing i386 DTrace tests to the build.Mark Johnston2019-05-226-0/+106
| | | | | | | | | | Now that it's relatively easy to do so, we might as well. MFC after: 1 week Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348081
* Make it possible to generate makefiles for arch-dependent DTrace tests.Mark Johnston2019-05-221-8/+10
| | | | | | | | MFC after: 1 week Event: Waterloo Hackathon 2019 Notes: svn path=/head/; revision=348080
* Drop -g from CFLAGS for zfsd(8). No idea why it was ever there.Edward Tomasz Napierala2019-04-161-1/+1
| | | | | | | | | | Reviewed by: kib, ngie, asomers MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19915 Notes: svn path=/head/; revision=346270
* Make zfsd(8) build obey CFLAGS.Edward Tomasz Napierala2019-04-101-1/+1
| | | | | | | | | | | Reviewed by: imp Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19865 Notes: svn path=/head/; revision=346081
* Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suiteEnji Cooper2019-03-153-30/+12
| | | | | | | | | | | | | | | | | | | This change integrates the unit tests for zfsd into the test suite using the integration method described in r345203. This change removes the `LOCALBASE` includes added for the port version of googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS` defines, which are included in the `GTEST_CXXFLAGS` variable, as part of r345203. Reviewed by: asomers Approved by: emaste (mentor) MFC after: 2 months MFC with: r345203 Differential Revision: https://reviews.freebsd.org/D19552 Notes: svn path=/head/; revision=345205
* Add support for send, receive and state-change DTrace providers forMichael Tuexen2018-08-222-0/+10
| | | | | | | | | | | | SCTP. They are based on what is specified in the Solaris DTrace manual for Solaris 11.4. Reviewed by: 0mp, dteske, markj Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16839 Notes: svn path=/head/; revision=338213
* Make dnode definition uniform on !x86Matt Macy2018-08-211-0/+1
| | | | | | | gcc4 requires -fms-extensions to accept anonymous union members Notes: svn path=/head/; revision=338128
* Fix the build by just installing systop since testing shows it works with:Brad Davis2018-08-111-1/+1
| | | | | | | | | | dwatch -X systop Reviewed by: kp Approved by: allanjude (mentor) Notes: svn path=/head/; revision=337629
* dwatch(1): Add systop profileDevin Teske2018-08-112-0/+85
| | | | | | | | | | | Provides a top-like view of syscall consumers. MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=337611
* dwatch(1): Fix syntax error in vop_readdir profileDevin Teske2018-08-111-0/+1
| | | | | | | | | | Reported by: Arne Ehrlich <ehrlich@consider-it.de> MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=337610
* Do not blindly include illumos kernel headers instead of user-space.Alexander Motin2018-08-023-3/+0
| | | | | | | | It is not needed now, and I doubt it much helped at all, creating more confusions then good. Notes: svn path=/head/; revision=337160
* Add a dtrace provider for UDP-Lite.Michael Tuexen2018-07-314-0/+97
| | | | | | | | | | | | | | The dtrace provider for UDP-Lite is modeled after the UDP provider. This fixes the bug that UDP-Lite packets were triggering the UDP provider. Thanks to dteske@ for providing the dwatch module. Reviewed by: dteske@, markj@, rrs@ Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16377 Notes: svn path=/head/; revision=337018
* Improve TCP related tests for dtrace.Michael Tuexen2018-07-221-3/+0
| | | | | | | | | | | | | | Ensure that the TCP connections are terminated gracefully as expected by the test. Use appropriate numbers for sent/received packets. In addition, enable tst.localtcpstate.ksh, which should pass, but doesn't until https://reviews.freebsd.org/D16369 is committed. Reviewed by: markj@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16288 Notes: svn path=/head/; revision=336597
* Fix the UDP tests for dtrace.Michael Tuexen2018-07-151-1/+0
| | | | | | | | | | | | | | | | | The code imported from opensolaris was depending on ping supporting UDP for sending probes. Since this is not supported by ping on FreeBSD use a perl script instead. The remote test requires the usage of ksh93, so state that in the sheband. Enable the local test, but keep the remote test disabled, since it requires a remote machine on the LAN. Reviewed by: markj@, gnn@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16268 Notes: svn path=/head/; revision=336315
* dwatch(1): Update manual to reference actual releaseDevin Teske2018-06-031-1/+1
| | | | | | | | | MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=334594
* dwatch(1): Fix "-t test" for post-processing profilesDevin Teske2018-05-291-3/+3
| | | | | | | | | | | | | Profiles that perform post-processing of the DTrace output were dropping the "-t test" option on the floor. Fix handling of this option for said profiles. X-MFC-to: stable/11 X-MFC-with: r334261-334262 Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=334359
* dwatch(1): Eliminate ANSI dimming in developer modeDevin Teske2018-05-271-4/+0
| | | | | | | | | | | | | "Developer mode" (passing of "-dev" options), which enables debugging features on compilation error, used to dim lines unrelated to error. That proved distracting and feedback from testers also confirmed that simply highlighting the line the compiler complains about is enough. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=334262
* dwatch(1): Guard against error when given -t "*..."Devin Teske2018-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | dwatch allows you to customnize the predicate (condition) for when information is displayed. The DTrace syntax for this is: probe[, ...] /predicate/ { [actions] } But if predicate is something like "*args[1]!=NULL" to test that the first pointer in an array is non-NULL, the syntax produced is: probe[, ...] /*arg1!=NULL/ { [actions] } The issue being that "/*" is the beginning of a comment and thus the following error is emitted: dtrace: failed to compile script /dev/stdin: line 535: /* encountered inside a comment This patch adds whitespace around the argument given to -t, producing: probe[, ...] / *arg1!=NULL / { [actions] } Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=334261
* dwatch(1): Refactor sendrecv profileDevin Teske2018-05-121-17/+29
| | | | | | | | | | The profile for send(2)/recv(2) observation has been refactored to eliminate alloca() in favor of translations available in HEAD. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333519
* dwatch(1): Expose process for ip/tcp/udpDevin Teske2018-05-123-63/+0
| | | | | | | | | | | Knowing the value of execname during these probes is of some value even if it is commonly the interrupt kernel thread (intr[12]) -- quite often it is not, but that depends on the probe. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333518
* dwatch(1): Allow `-E code' to override profile EVENT_DETAILSDevin Teske2018-05-1217-0/+34
| | | | | | | | | This allows quick changes to the formatted output of a profile. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333517
* dwatch(1): Export ARGV to profiles loaded via load_profile()Devin Teske2018-05-121-0/+43
| | | | | | | | | | | | A module that wishes to post-process the output needs to know which arguments were passed in order to re-execute a child in a pipe-chain. Further, the expansion of ARGV needs to be such that items are escaped properly. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333516
* dwatch(1): Simplify info message testDevin Teske2018-05-121-1/+1
| | | | | | | | | The info() function already tests $QUIET Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333515
* dwatch(1): Separate default values so `-[BK] num' don't affect usageDevin Teske2018-05-121-4/+10
| | | | | | | | | | | | | | | If you were to pass an invalid option after `-B num' or `-K num' you would see that the usage statement would show the value you passed instead of the actual default. Moving the default values to separate variables that are unaffected by the options-parsing allows the usage statement to correctly show the hard-coded default values if no flags are used. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333514
* dwatch(1): Bugfix, usage displayed with `-1Q'Devin Teske2018-05-121-3/+2
| | | | | | | | | | | A return statement should have been an exit in list_profiles(). If the user passed `-Q' to list profiles and asked for one-line per profile (`-1'), list_profiles() would not exit as should. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=333513
* dwatch(1): Remove the line used to demonstrate `-dev' optionDevin Teske2018-04-221-1/+0
| | | | | | | | | | | In recently added sendrecv profile, there was a line purposefully added to introduce a compilation error in which `-dev' is used to debug the entry. Removing the entry. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=332867
* dwatch(1): Add profile for send(2)/recv(2) syscallsDevin Teske2018-04-222-0/+223
| | | | | | | Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=332866
* dwatch(1): Add `-dev' option to aid debugging of profilesDevin Teske2018-04-221-1/+63
| | | | | | | | | | | | | | | | | | | The options `-d' (debug), `-e' (exit after compile), and `-v' (verbose) when combined in any order (though best remembered as `-dev') will run the conflated script through dtrace(1), test for error conditions, and show the line that dtrace(1) failed at (with context). If no errors are found, the output is the same as `-e[v]'. When writing a new profile for dwatch(1), you can quickly test to make sure it compiles by running `dwatch -devX profile_name' where profiles live in /usr/libexec/dwatch or /usr/local/libexec/dwatch (the latter being where profiles installed via ports should go). Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=332865
* Fix display of wrong pid from dtrace_sched(4)Devin Teske2018-03-081-2/+2
| | | | | | | | | Fix a comment while here. Sponsored by: Smule, Inc. Notes: svn path=/head/; revision=330672
* Bump dwatch(1) internal version from 1.0-beta-91 to 1.0Devin Teske2018-03-061-1/+1
| | | | Notes: svn path=/head/; revision=330560
* Introduce dwatch(1) as a tool for making DTrace more usefulDevin Teske2018-03-0623-0/+4241
| | | | | | | | | | Reviewed by: markj, gnn, bdrewery (earlier version) Relnotes: yes Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D10006 Notes: svn path=/head/; revision=330559
* zdb: raise WARNS from 0 to 2Alan Somers2018-02-211-1/+1
| | | | | | | | | | | | This has only been possible since r329694 and r329508 MFC after: 3 weeks X-MFC-With: 329694 X-MFC-With: 329508 Sponsored by: Spectra Logic Notes: svn path=/head/; revision=329722
* MFV r318941: 7446 zpool create should support efi system partitionAlexander Motin2018-02-211-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@7855d95b30fd903e3918bad5a29b777e765db821 https://github.com/illumos/illumos-gate/commit/7855d95b30fd903e3918bad5a29b777e765db821 https://www.illumos.org/issues/7446 Since we support whole-disk configuration for boot pool, we also will need whole disk support with UEFI boot and for this, zpool create should create efi- system partition. I have borrowed the idea from oracle solaris, and introducing zpool create - B switch to provide an way to specify that boot partition should be created. However, there is still an question, how big should the system partition be. For time being, I have set default size 256MB (thats minimum size for FAT32 with 4k blocks). To support custom size, the set on creation "bootsize" property is created and so the custom size can be set as: zpool create B - o bootsize=34MB rpool c0t0d0 After pool is created, the "bootsize" property is read only. When -B switch is not used, the bootsize defaults to 0 and is shown in zpool get output with value ''. Older zfs/zpool implementations are ignoring this property. https://www.illumos.org/rb/r/219/ Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Yuri Pankov <yuri.pankov@gmail.com> Approved by: Dan McDonald <danmcd@kebe.com> Author: Toomas Soome <tsoome@me.com> This commit makes no sense for FreeBSD, that is why I blocked the option, but it should be good to stay closer to upstream. Notes: svn path=/head/; revision=329681
* Optimize zfsd for the happy caseAlan Somers2018-02-153-2/+21
| | | | | | | | | | | | If there are no damaged pools, then ignore all GEOM events. We only use them to fix damaged pools. However, still pay attention to ZFS events. MFC after: 20 days X-MFC-With: 329284 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329344
* zfsd: Allow zfsd to work on any type of GEOM providerAlan Somers2018-02-143-219/+119
| | | | | | | | | | | | | | | | | | | | | | | cddl/usr.sbin/zfsd/zfsd_event.cc Remove the check for da and ada devices. This way zfsd can work on md, geli, glabel, gstripe, etc devices. geli in particular is useful combined with ZFS. gnop is also useful for simulating drive pulls in the ZFSD test suite. Also, eliminate the DevfsEvent class entirely. Move its responsibilities into GeomEvent. We can get everything we need to know just from listening to GEOM events. lib/libdevdctl/event.cc Fix GeomEvent::DevName for CREATE events. Oddly, the relevant field is named "cdev" for CREATE events but "devname" for disk events. MFC after: 3 weeks Relnotes: Yes (probably worth mentioning the geli part) Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=329284
* zfsd: Don't spare a vdev that's being replacedAlan Somers2018-01-301-1/+45
| | | | | | | | | | | | | | | If a zfs pool contains a replacing vdev (either created manually by "zpool replace" or by zfsd(8) via autoreplace by physical path) and then new spares get added to the pool, zfsd shouldn't use one to replace the drive that is already being replaced. That's a waste of resources that just slows down the rebuild. PR: 225547 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=328605
* Remove tst.zonename.d from the list of expected failures.Mark Johnston2018-01-141-1/+0
| | | | | | | X-MFC with: r327888 Notes: svn path=/head/; revision=327973
* Add "jid" and "jailname" variables to DTrace.Mark Johnston2018-01-121-0/+2
| | | | | | | | | | | | | | | | | These return the jail ID and jail name for the traced process, respectively, and are analogous to "zonename" on Solaris/illumos. "zonename" is now aliased to "jailname". Also add some stress tests for the new variables. Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> Reviewed by: dteske (previous version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13877 Notes: svn path=/head/; revision=327888
* Add a regression test for r327794.Mark Johnston2018-01-101-0/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=327795
* Mark uctf/err.user64mode.ksh as EXFAIL for now.Mark Johnston2017-12-151-0/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326878
* Actually add the -x setenv test Makefile, missed in r326499.Mark Johnston2017-12-081-0/+30
| | | | | | | X-MFC with: r326499 Notes: svn path=/head/; revision=326705
* Complete support for dtrace's -x setenv option.Mark Johnston2017-12-033-2/+1
| | | | | | | | | | | | | | This allows one to override the environment for processes created with dtrace -c. By default, the environment is inherited. This support was originally merged from illumos in r249367 but was lost when the commit was later reverted and then brought back piecemeal. Reported by: Samuel Lepetit <slepetit@apple.com> MFC after: 2 weeks Notes: svn path=/head/; revision=326499
* Revert r326181 for now.Mark Johnston2017-11-274-4/+2
| | | | | | | | | We can't link an executable using -m32 until the lib32 phase of a buildworld, though the build works fine when executing make from cddl/usr.sbin/dtrace/tests. Some other solution will need to be found. Notes: svn path=/head/; revision=326285