aboutsummaryrefslogtreecommitdiff
path: root/cddl
Commit message (Collapse)AuthorAgeFilesLines
* ctfconvert: Actually use the asprintf() helperMark Johnston7 days1-1/+1
| | | | Fixes: 1165fc9a5266 ("ctfconvert: Give bitfield types names distinct from the base type")
* ctfconvert: Give bitfield types names distinct from the base typeMark Johnston7 days3-3/+19
| | | | | | | | | | | | | | | | | | CTF integers have an explicit width and so can be used to represent bitfields. Bitfield types emitted by ctfconvert(1) share the name of the base integer type, so a struct field with type "unsigned int : 15" will have a type named "unsigned int". To avoid ambiguity when looking up types by name, add a suffix to names of bitfield types to distinguish them from the base type. Then, if ctfmerge happens to order bitfield types before the corresponding base type in a CTF file, a name lookup will return the base type, which is always going to be the desired behaviour. PR: 265403 Reported by: cy MFC after: 1 week Sponsored by: The FreeBSD Foundation
* dtrace tests: Rename some test type names to avoid a conflictMark Johnston7 days1-6/+6
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* dtrace tests: Override RLIMIT_CORE for a test which triggers a core dumpMark Johnston7 days1-1/+1
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libnvpair: install libnvpair.hKristof Provost2022-07-211-0/+2
| | | | | | This is included by libbe/be.h. Sponsored by: Rubicon Communications, LLC ("Netgate")
* zfs: merge openzfs/zfs@cb01da680Martin Matuska2022-07-071-0/+1
| | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12438 Avoid panic with recordsize > 128k, raw sending and no large_blocks #13015 Fix dnode byteswapping #13256 Add a "zstream decompress" subcommand #13555 Scrub mirror children without BPs #13576 Several sorted scrub optimizations #13579 Fix and disable blocks statistics during scrub #13582 Several B-tree optimizations #13591 Avoid two 64-bit divisions per scanned block #13606 Avoid memory copies during mirror scrub #13613 Avoid memory copy when verifying raidz/draid parity Obtained from: OpenZFS OpenZFS commit: cb01da68057dcb9e612e8d2e97d058c46c3574af
* cddl/*: add a WITH(OUT)_DTRACE optionBrooks Davis2022-07-066-66/+41
| | | | | | | | | | | | | | | | | | Add an option to enable/disable DTrace without disabling ZFS. New architectures such as CHERI may support ZFS before they support DTrace and the old model of WITHOUT_CDDL disabling both wasn't helpful. For compatiblity, the CDDL option remains and WITHOUT_CDDL implies WITHOUT_DTRACE. WITHOUT_DTRACE also implies WITHOUT_CTF. As part of this change, largely convert cddl/*/Makefile to using the more compact SUBDIR.${MK_<FOO>}+= form rather than using intermediate variables. Reviewed by: markj Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D35718
* lockstat: Fix construction of comparision predicatesKornel Dulęba2022-07-041-2/+2
| | | | | | | | | | | | | | Passing "0x%p" to sprintf results in double "0x" being printed. This causes a dtrace script compilation failure when "-d" flag is specified. Fix that by removing the extraneous "0x". Reviewed by: markj Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Alstom MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35690
* dtrace: Remove local mips supportBrooks Davis2022-07-013-84/+0
| | | | | | | | Remove the stub pid probe and all the build glue. Reviewed by: imp, jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D35541
* libicp_rescue: Fix build for powerpc64leJessica Clarke2022-07-011-1/+1
| | | | | | | This is a repeat of 13cee53cef35 ("libicp: Fix build for powerpc64le") but for the rescue version of the library. Fixes: 1f1e2261e341 ("zfs: merge openzfs/zfs@deb121309")
* libicp: Fix build for powerpc64leJessica Clarke2022-07-011-1/+1
| | | | | | | | The C sources use the assembly routines for little-endian powerpc64, and the assembly files have ppc64le in their names, but the guard here was for big-endian powerpc64. Fixes: 1f1e2261e341 ("zfs: merge openzfs/zfs@deb121309")
* zfs: merge openzfs/zfs@deb121309Martin Matuska2022-06-233-2/+58
| | | | | | | | | | | | Notable upstream pull request merges: #12918 Introduce BLAKE3 checksums as an OpenZFS feature #13553 Reduce ZIO io_lock contention on sorted scrub #13537 Improve sorted scan memory accounting #13540 AVL: Remove obsolete branching optimizations #13563 FreeBSD: Improve crypto_dispatch() handling Obtained from: OpenZFS OpenZFS commit: deb1213098e2dc10e6eee5e5c57bb40584e096a6
* zfs: merge openzfs/zfs@b9d98453fMartin Matuska2022-06-031-1/+1
| | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12321 Fix inflated quiesce time caused by lwb_tx during zil_commit() #13244 zstd early abort #13360 Verify BPs as part of spa_load_verify_cb() #13452 More speculative prefetcher improvements #13466 Expose zpool guids through kstats #13476 Refactor Log Size Limit #13484 FreeBSD: libspl: Add locking around statfs globals #13498 Cancel in-progress rebuilds when we finish removal #13499 zed: Take no action on scrub/resilver checksum errors #13513 Remove wrong assertion in log spacemap Obtained from: OpenZFS OpenZFS commit: b9d98453f9387c413f91d1d9cdb0cba8e04dbd95
* zfs: merge openzfs/zfs@c0cf6ed67Martin Matuska2022-05-182-3/+2
| | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #10662 zvol_wait: Ignore locked zvols #12789 Improve log spacemap load time #12812 Improved zpool status output, list all affected datasets #13277 FreeBSD: Use NDFREE_PNBUF if available #13302 Make zfs_max_recordsize default to 16M #13311 Fix error handling in FreeBSD's get/putpages VOPs #13345 FreeBSD: Fix translation from ABD to physical pages #13373 zfs: holds: dequadratify #13375 Corrected edge case in uncompressed ARC->L2ARC handling #13388 Improve mg_aliquot math #13405 Reduce dbuf_find() lock contention #13406 FreeBSD: use zero_region instead of allocating a dedicated page Obtained from: OpenZFS OpenZFS commit: c0cf6ed6792e545fd614c2a88cb53756db7e03f8
* ctf: Link CTF toolchain man pages to ctf.5Mark Johnston2022-04-213-12/+16
| | | | | | | | Also expand the CTF acronym to provide a bit of context. PR: 259790 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ctfdump: Remove definitions of warn() and vwarn()Mark Johnston2022-04-213-31/+2
| | | | | | | | | | | The presence of the latter causes a link error when building a statically linked ctfdump(1) because libc defines the same symbol. libc's warn() is defined as a weak symbol and so does not cause the same problem, but let's just use libc's version. Reported by: stephane rochoy <stephane.rochoy@stormshield.eu> MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libctf: Fix recursive descent into anonymous SOU fieldsMark Johnston2022-04-121-2/+2
| | | | | | | | PR: 262412 Tested by: dhw, gallatin Fixes: a6fb86917362 ("libctf: Handle CTFv3 containers") MFC after: 3 days Sponsored by: The FreeBSD Foundation
* DTrace test: skip flakey common.misc.t_dtrace_contrib.tst_dynopt_d in CILi-Wen Hsu2022-03-241-0/+3
| | | | | PR: 237641 Sponsored by: The FreeBSD Foundation
* DTrace test: Add a new keyword SKIPCI to gentest.shLi-Wen Hsu2022-03-242-4/+8
| | | | | | | | | This is for marking a test case is flakey and should not be executed in the CI environment. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34635
* dtrace tests: Fix expected outout for tst.system.dLi-Wen Hsu2022-03-091-6/+6
| | | | | | | This is follow up of d500a85e640d1cd270747c12e17c511b53864436 PR: 262415 Sponsored by: The FreeBSD Foundation
* zfs: merge openzfs/zfs@a86e08941 (master) into mainMartin Matuska2022-03-084-14/+70
| | | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #9078: log xattr=sa create/remove/update to ZIL #11919: Cross-platform xattr user namespace compatibility #13014: Report dnodes with faulty bonuslen #13016: FreeBSD: Fix zvol_cdev_open locking #13019: spl: Don't check FreeBSD rwlocks for double initialization #13027: Fix clearing set-uid and set-gid bits on a file when replying a write #13031: Add enumerated vdev names to 'zpool iostat -v' and 'zpool list -v' #13074: Enable encrypted raw sending to pools with greater ashift #13076: Receive checks should allow unencrypted child datasets #13098: Avoid dirtying the final TXGs when exporting a pool #13172: Fix ENOSPC when unlinking multiple files from full pool Obtained from: OpenZFS OpenZFS commit: a86e089415679cf1b98eb424a159bb36aa2c19e3
* ctf: Avoid passing a caddr_t to roundup2()Mark Johnston2022-03-071-1/+1
| | | | | | | For some reason I can't reproduce this locally, but Jenkins complains. Reported by: Jenkins Fixes: bdf290cd3e1a ("ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}")
* ctf: Fix a -Wunused-but-set-variable warningMark Johnston2022-03-071-2/+0
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* ctf: Add v3 support to CTF tools, ctf{convert,dump,merge}Mark Johnston2022-03-073-271/+472
| | | | | | | | | ctfdump handles v2 and v3. ctfconvert now emits only CTFv3, whereas ctfmerge can merge v2 and v3 containers into v3 containers. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34364
* libctf: Handle CTFv3 containersMark Johnston2022-03-078-421/+895
| | | | | | | | | | | | | | | In general, the patch adds indirection to minimize the amount of code that needs to know about differences between v2 and v3. Specifically, some new ctf_get_ctt_* functions are added, and new LCTF_* macros are added to use the underlying container's version to do the right thing. CTF containers can have parent/child relationships, wherein a type ID in one container refers to a type in the parent. It is permitted for the parent and child to have different versions. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34363
* ctf: Add definitions for CTFv3Mark Johnston2022-03-071-94/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | These are based on definitions added to binutils' libctf. Specifically: - Type IDs are now encoded in 32 bits rather than 16, changing the layout of ctf_type_t, ctf_array_t, ctf_member_t and ctf_lmember_t. - Type info is encoded in 32 bits rather than 16. The type "kind" is extended from 5 bits to 6, and the type "vlen" is extended from 10 bits to 25. The main upside is that we remove the current limit, imposed by CTFv2, of 2^{15} distinct types in the main kernel executable. Other limits, such as that on the number of elements in an enum, imposed by the vlen limit, are also raised. This change adds v2 and v3 flavours of macros and type definitions which differ between the two versions. Compatibility is preserved for now by having generic names refer to the v2 definitions, so, e.g., ctf_type_t is still a v2 type. No functional change intended. Reviewed by: Domagoj Stolfa MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34360
* ctf: Import ctf.h from OpenBSDMark Johnston2022-03-072-2/+1
| | | | | | | | | | | | | | | | | Use it instead of the existing ctf.h from OpenSolaris. This makes it easier to use CTF in the core kernel, and to extend the CTF format to support wider type IDs. The imported ctf.h is modified to depend only on _types.h, and also to provide macros which use the "parent" bit of a type ID to refer to types in a parent CTF container. No functional change intended. Reviewed by: Domagoj Stolfa, emaste MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34358
* libctf: Use const ctf_file_t references in string lookup routinesMark Johnston2022-02-232-5/+5
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libdtrace: Add a missing newline to an error messageMark Johnston2022-02-231-1/+1
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libctf: Remove checks for CTFv1Mark Johnston2022-02-232-13/+8
| | | | | | | | Per commit 7db423d69273 ("libctf: Rip out CTFv1 support") this support is obsolete. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* ctfconvert: Rip out STABS supportMark Johnston2022-02-107-1827/+0
| | | | | | | | | It is unused on FreeBSD and complicates some efforts to modify the CTF format to permit wider type IDs, so remove it. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libctf: Rip out CTFv1 supportMark Johnston2022-02-101-35/+1
| | | | | | | | | CTFv1 was obsolete before libctf was imported into FreeBSD, and ctfconvert/ctfmerge can emit only CTFv2. Make ctf.h a bit easier to maintain by ripping v1 support out. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* libctf: Use ctf_type_t instead of struct ctf_typeMark Johnston2022-02-101-1/+1
| | | | | | | | For consistency with other CTF toolchain code. No functional change intended. Fixes: 105fd928b0b5 ("libctf: Improve check for duplicate SOU definitions in ctf_add_type()") MFC after: 1 week
* dtrace: remove unnecessary fflush()Chuck Silvers2022-02-101-1/+0
| | | | | | | | | | | This call was added back in the early days of dtrace porting and no one knows why anymore. The extra flushing causes lots of unnecessary CPU overhead when a script produces lots of output, as well as easily losing output because the command can't keep up. Sponsored by: Netflix Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D34216
* Disable clang 14 warning about bitwise operators in zstdDimitry Andric2022-02-081-0/+1
| | | | | | | | | | | | | | | | Parts of zstd, used in openzfs and other places, trigger a new clang 14 -Werror warning: ``` sys/contrib/zstd/lib/decompress/huf_decompress.c:889:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical] (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` While the warning is benign, it should ideally be fixed upstream and then vendor-imported, but for now silence it selectively. MFC after: 3 days
* zfs: merge openzfs/zfs@17b2ae0b2 (master) into mainMartin Matuska2022-01-224-17/+4
| | | | | | | | | | | | | | | | | | | Notable upstream pull request merges: #12766 Fix error propagation from lzc_send_redacted #12805 Updated the lz4 decompressor #12851 FreeBSD: Provide correct file generation number #12857 Verify dRAID empty sectors #12874 FreeBSD: Update argument types for VOP_READDIR #12896 Reduce number of arc_prune threads #12934 FreeBSD: Fix zvol_*_open() locking #12947 lz4: Cherrypick fix for CVE-2021-3520 #12961 FreeBSD: Fix leaked strings in libspl mnttab #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD #12981 Introduce a flag to skip comparing the local mac when raw sending #12985 Avoid memory allocations in the ARC eviction thread Obtained from: OpenZFS OpenZFS commit: 17b2ae0b24d487fdda2ef1098ec26fa7f79a61f6
* dt_unring_buf: set dtbd_oldest to the start of the first recordAndriy Gapon2022-01-111-1/+1
| | | | | | | | | | | It was set to the start of the buffer and that can be different from the start of teh first record because of a misalignment. This change follows the example of dt_realloc_buf(). Reviewed by: tsoome, markj MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D33649
* ctfconvert: Handle arrays of empty structsMark Johnston2021-12-311-2/+10
| | | | | | | | | | | Members with such a type will legitimately have a size of zero, so don't emit a warning. PR: 260818 Reviewed by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33700
* dtrace: Disable getf() as it is broken on FreeBSDDomagoj Stolfa2021-12-171-1/+1
| | | | | | | | | | | | | | | | | | getf() on FreeBSD calls _sx_slock(), _sx_sunlock() and fget_locked(). Furthermore, it does not set the per-core fault flag, meaning it usually ends up in a double fault panic once getf() does get called, especially from fbt. Reviewing the DTrace Toolkit + a number of other scripts scattered around FreeBSD, I have not been able to find one use of getf(). Given how broken the implementation currently is, we disable it until it can be implemented properly. Also comment out a test in aggs/tst.subr.d for getf(). Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33378
* cddl: fix missing ZFS library dependenciesGreg V2021-11-156-4/+8
| | | | | | | | | | | In 9fae47666 zfsd got a libspl dependency to avoid undefined references. However that workaround did not help external consumers of libzfs_core. Fix all missing dependencies lld 13 and the rtld complain about. Reviewed by: freqlabs, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32521
* zfs: merge openzfs/zfs@ec64fdb93 (master) into mainMartin Matuska2021-10-213-5/+8
| | | | | | | | | | | | | | | Notable upstream pull request merges: #12392 Avoid panic in case of pool errors and missing L2ARC #12448 skip snapshot in zfs_iter_mounted() #12516 Fix NFS and large reads on older kernels #12533 Fail invalid incremental recursive send gracefully #12569 FreeBSD: Really zero the zero page #12575 Reject zfs send -RI with nonexistent fromsnap #12602 Correct refcount_add in dmu_zfetch #12650 zpool should call zfs_nicestrtonum() with non-NULL handle Obtained from: OpenZFS OpenZFS commit: ec64fdb93d144ab1884097cfd36e18b62a2db848
* libctf: Improve check for duplicate SOU definitions in ctf_add_type()Mark Johnston2021-10-041-27/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying a struct or union from one CTF container to another, ctf_add_type() checks whether it matches an existing type in the destination container. It does so by looking for a type with the same name and kind as the new type, and if one exists, it iterates over all members of the source type and checks whether a member with matching name and offset exists in the matched destination type. This can produce false positives, for example because member types are not compared, but this is not expected to arise in practice. If the match fails, ctf_add_type() returns an error. The procedure used for member comparison breaks down in the face of anonymous struct and union members. ctf_member_iter() visits each member in the source definition and looks up the corresponding member in the desination definition by name using ctf_member_info(), but this function will descend into anonymous members and thus fail to match. Fix the problem by introducing a custom comparison routine which does not assume member names are unique. This should also be faster for types with many members; in the previous scheme, membcmp() would perform a linear scan of the desination type's members to perform a lookup by name. The new routine steps through the members of both types in a single loop. PR: 258763 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* dtrace.1: Document a couple of preprocessor-related optionsMark Johnston2021-09-071-0/+11
| | | | | | Suggested by: swills MFC after: 1 week Sponsored by: The FreeBSD Foundation
* dtrace.1: Document -x ldpathMark Johnston2021-09-071-1/+9
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* pkgbase: Create a FreeBSD-dwatch packageEmmanuel Vadot2021-09-073-0/+4
| | | | | | | While dwatch is useful some users might not want it by default. Create a package for it. Differential Revision: https://reviews.freebsd.org/D31796
* Explicitly link zfsd with libspl to avoid undefined referencesDimitry Andric2021-08-281-1/+1
| | | | | | | | | | | | | | Because lld 13.0.0 is more strict about undefined references when linking to shared libraries, it produces the following errors for zfsd: ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libzfs_core.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined] ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libnvpair.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined] ld: error: /home/dim/obj/home/dim/src/llvm-13-update/amd64.amd64/tmp/usr/lib/libavl.so: undefined reference to libspl_assertf [--no-allow-shlib-undefined] *** [zfsd.full] Error code 1 Fix this by adding libspl (where libspl_assertf lives) to zfsd's LIBADD. MFC after: 3 days
* zfs: attach zpool_influxdb to buildMartin Matuska2021-07-074-1/+73
| | | | | | | | | | | | | | | From the zpool_influxdb.8 manual page: zpool_influxdb produces InfluxDB-line-protocol-compatible metrics from zpools. Like the zpool command, zpool_influxdb reads the current pool status and statistics. Unlike the zpool command which is intended for humans, zpool_influxdb formats the output in the InfluxDB line protocol. The expected use is as a plugin to a metrics collector or aggregator, such as Telegraf. zpool_influxdb is installed into /usr/libexec/zfs/ Differential revision: https://reviews.freebsd.org/D31094 MFC after: 3 days
* zfsd: Check for error from zpool_vdev_onlineRyan Moeller2021-07-061-3/+11
| | | | | | | | | Onlining a vdev can fail. Log the error if it does. Reviewed by: mav, asomers MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D30882
* pkgbase: Put dtrace in its own packageEmmanuel Vadot2021-06-195-0/+5
| | | | | | | While dtrace is usefull some people might not want it. Differential Revision: https://reviews.freebsd.org/D30752 Sponsored by: Diablotin Systems
* dtrace: fix an out of bound read and a NULL pointer incrementDomagoj Stolfa2021-06-172-2/+8
| | | | | | | | | | | | | | In dt_cc.c when the provider is an empty string, accessing strlen(pdp->dtpd_provider) - 1 will result in a pdp->dtpd_provider[-1] access. Similarly, in dt_ident.c, if p2 is a NULL pointer, doing a p2++ on it is undefined behaviour. Reviewed by: markj MFC after: 1 week Sponsored by: Google Differential Revision: https://reviews.freebsd.org/D30778