Commit graph

1545 commits

Author SHA1 Message Date
Minsoo Choo
94d1731e73 Makefile*: remove powerpcspe
As reported on the freebsd-announce mailing list[1] FreeBSD is
continuing to retire 32-bit support.  Remove powerpcspe from build
infrastructure.

[1] https://lists.freebsd.org/archives/freebsd-announce/2024-February/000117.html

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by:	jhibbits, emaste
Pull request:	https://github.com/freebsd/freebsd-src/pull/1914
2026-01-09 11:28:43 -05:00
Warner Losh
efb77950fd dtrace: Add definitiosn for the cam dtrace provider
Sponsored by:		Netflix
Reviewed by:		adrian
Differential Revision:	https://reviews.freebsd.org/D54471
2026-01-07 23:20:28 -07:00
Martin Matuska
2f6c77cd6f zfs: unbreak build after 89f729dcc merge
Link zfsd against spl and pthread
2025-12-08 13:21:26 +01:00
Martin Matuska
8b78d412ae zfs: world changes after 89f729dcc merge
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Remove, unbind and obsolete libuutil and libtpool
Update zfs_configh and zfs_gitrev.h
2025-12-07 23:09:12 +01:00
Mark Peek
732b4aa05d ctfmerge: fix segfault when building on macOS
The barrier code was using semaphores which have been deprecated in
macOS and not working at all, causing a race condition. Since macOS
does not have pthread_barrier_*(), this change uses a condition
variable instead.

PR:		290958
Reported by:	wosch
MFC after:	2 weeks
Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D54018
2025-12-01 12:50:24 -08:00
Mark Johnston
17fd7780fb dtrace tests: Update names after the syscall::exit probe was renamed
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
MFC after:	1 week
Fixes:	e7e964cb2e ("syscalls: normalize _exit(2) declerations")
2025-12-01 14:20:06 +00:00
Minsoo Choo
507cfc4279 dtrace.1: remove sparc
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo
d11ff7f933 opensolaris: remove references to sparc
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo
dfd35cd244 libdtrace: remove sparc code
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:19 +00:00
Minsoo Choo
d667cc77ba dtrace: remove sparc tests
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>

Reviewed by:	markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1907
2025-12-01 14:19:18 +00:00
John Baldwin
e928afc531 Use ZFSTOP more broadly
Reviewed by:	brooks
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D53791
2025-11-24 10:47:10 -05:00
John Baldwin
7980cf5d6f Centralize definition of ZFSTOP
Define this helper variable in one place and make it available while
building the entire base system.

Reviewed by:	sjg
Obtained from:	CheriBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D53790
2025-11-24 10:46:56 -05:00
Martin Matuska
bb8580e7a6 zfs: fix cross-build after openzfs/zfs@e63d026b9d
Workaround multiple cross-build issues in OpenZFS code

TBD: discuss long-term fix with OpenZFS
2025-11-17 17:12:03 +01:00
Martin Matuska
4303bde429 zfs: fix build after openzfs/zfs@e63d026b9
Fix Makefiles
Update zfs_config.h and zfs_gitrev.h
2025-11-17 17:11:56 +01:00
Mateusz Piotrowski
7bcd3a04c8 dtrace_priv.4: Document the DTrace priv provider
Fixes:	6efcc2f26a Add static tracing for privilege checking
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D53630
2025-11-12 15:51:37 +01:00
Mateusz Piotrowski
f811c0a555 dtrace.1: Document DTRACE_DEBUG
Some checks are pending
Cross-build Kernel / amd64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-22.04 (clang-15) (push) Waiting to run
Cross-build Kernel / amd64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 ubuntu-24.04 (clang-18) (push) Waiting to run
Cross-build Kernel / amd64 macos-latest (clang-18) (push) Waiting to run
Cross-build Kernel / aarch64 macos-latest (clang-18) (push) Waiting to run
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53627
2025-11-08 11:28:47 +01:00
Mateusz Piotrowski
753cef701d dtrace.1: Fix mdoc macros around -x
There should be no space between -x's "arg" and "=value".

MFC after:	3 days
2025-11-07 00:04:01 +01:00
Mateusz Piotrowski
9fe88e5503 dtrace_pid.4: Document the DTrace PID provider
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51287
2025-11-06 23:40:41 +01:00
Mark Johnston
1ca7542a1b libdtrace: Update io.d to chase changes to struct bio layout
Fixes:	6c406b5b93 ("exterror(9): add infra for bufs and bios")
2025-11-05 21:54:26 +00:00
Mateusz Piotrowski
3ccb2d9513 dtrace_callout_execute.4: Document the DTrace callout_execute provider
MFC after:	2 weeks
Fixes:		91dd9aae1a Add explicit static DTrace tracing to the callout mechanism
Differential Revision:	https://reviews.freebsd.org/D51397
2025-11-04 12:10:55 +01:00
Mateusz Piotrowski
2020e76450 dtrace_vfs.4: Document the DTrace vfs provider
Reviewed by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51317
2025-11-03 16:54:11 +01:00
Martin Matuska
4dc4a512e0 zfs: install missing openzfs-2.4 files in /usr/share/zfs/compatibility.d
MFC after: 3 days
2025-10-05 23:24:39 +02:00
Lexi Winter
24e4dcf4ba packages: Move ctf-tools to ctf
Remove the ctf-tools package.  Add a new package which contains the
previous contents of ctf-tools along with libctf.  This removes
CDDL-licensed code from the utilities package.

Set LIB_PACKAGE for libctf so that DTrace runtime doesn't need to
install the tools.

MFC after:	1 day
Reviewed by:	bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D52776
2025-09-30 10:56:09 +01:00
Olivier Certner
e4cc7f9930
dtrace: Fix effective GID shown by 'curpsinfo'
Reviewed by:    emaste
Fixes:          be1f7435ef ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52274
2025-09-17 14:16:00 +02:00
Lexi Winter
29185c9a26 packages: Use LIB_PACKAGE for zfs and ufs packages
Commit f9513c334f moved the shared libraries for ZFS and UFS into
separate packages (libzfs and libufs), which resulted in a rather
large number of packages being created, e.g. for ZFS:

FreeBSD-libzfs
FreeBSD-libzfs-dbg
FreeBSD-libzfs-dbg-lib32
FreeBSD-libzfs-dev
FreeBSD-libzfs-dev-lib32
FreeBSD-libzfs-lib32
FreeBSD-zfs
FreeBSD-zfs-dbg
FreeBSD-zfs-dbg-lib32
FreeBSD-zfs-dev
FreeBSD-zfs-dev-lib32
FreeBSD-zfs-lib32
FreeBSD-zfs-man

Use LIB_PACKAGE instead, which significantly reduces the number of
packages:

FreeBSD-zfs
FreeBSD-zfs-dbg
FreeBSD-zfs-dbg-lib32
FreeBSD-zfs-dev
FreeBSD-zfs-dev-lib32
FreeBSD-zfs-lib
FreeBSD-zfs-lib32
FreeBSD-zfs-man

MFC after:	3 days
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D52416
2025-09-12 21:56:51 +01:00
Mark Johnston
3877025f52 dtrace: Use a size_t to represent a buffer size in the printm action
printm is specific to the FreeBSD dtrace port.  I believe it's
effectively the same as tracemem(), though printm apparently predates
it.  It stores the size of the buffer of traced data inline.  Currently
it represents that size using a uintptr_t, which isn't really right and
poses challenges when porting to CHERI because
`DTRACE_STORE(uintptr_t, ...`  requires the destination to be suitably
aligned, but this isn't necessary since we're just storing a size.

Convert to using a size_t.  This should be a no-op since
sizeof(uintptr_t) == sizeof(size_t) on non-CHERI platforms (and besides
that I don't see a reason to use printm() when tracemem() is available
and is simpler to use.)

Reviewed by:	Domagoj Stolfa, avg
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D52055
2025-09-10 16:00:13 +00:00
Martin Matuska
94ca18c18b zfs: fix build issues from 53a2e2635
Add aesni-gcm-avx2-vaes.S to libicp, libicp_rescue and module build
This was somehow not catched by my make universe
2025-08-20 15:42:33 +02:00
Gleb Smirnoff
325e0b4c1a zfs: install zhack(1) manual page 2025-08-14 16:08:45 -07:00
Jessica Clarke
c9332a905c libspl: Don't build tunables.c when bootstrapping
The upstream source (which we've currently hacked downstream to make it
compile, even though it won't work) assumes ELF for its hand-rolled
linker set implementation, and macOS's Mach-O is sufficiently different
for it to not even compile there. However, we don't actually need this
file at all, since we only use the bootstrap libspl for DTrace tools, so
just add it to the set of files we don't build when bootstrapping.

Fixes:	df58e8b150 ("zfs: merge openzfs/zfs@8302b6e32")
2025-08-12 18:38:56 +01:00
Martin Matuska
df58e8b150 zfs: merge openzfs/zfs@8302b6e32
Notable upstream pull request merges:
 #16853 894edd084 Add TXG timestamp database
 #17004 -multiple Implement dynamic gang header sizes
 #17405 dea0fc969 ZVOL: Return early, if volmode is ZFS_VOLMODE_NONE
                  on FreeBSD side
 #17455 cf146460c Default to zfs_bclone_wait_dirty=1
 #17481 523d9d600 Validate mountpoint on path-based unmount using statx
 #17482 92da9e0e9 ZVOL: Implement zvol_alloc() function on FreeBSD side
 #17489 dee62e074 spa: ZIO_TASKQ_ISSUE: Use symbolic priority
 #17496 bf846dcb7 Release topology restrictions on special/dedup
 #17497 4e92aee23 Relax special_small_blocks restrictions
 #17503 ea38787f2 Revert "Fix incorrect expected error in ztest"
 #17505 be1e991a1 Allow and prefer special vdevs as ZIL
 #17506 ee0cb4cb8 ztest: Fix false positive of ENOSPC handling
 #17507 92d3b4ee2 zio: rename `io_reexecute` as `io_post`;
                  use it for the direct IO checksum error flag
 #17508 6af8db61b metaslab: don't pass whole zio to throttle reserve APIs
 #17518 4c2a7f85d FreeBSD: Add support for _PC_HAS_HIDDENSYSTEM
 #17521 d7ab07dfb ZIL: Force writing of open LWB on suspend
 #17524 b6e8db509 zpool/zfs: Add '-a|--all' option to scrub, trim,
                  initialize
 #17531 c1e51c55f Correct weight recalculation of space-based metaslabs
 #17533 d323fbf49 FreeBSD: zfs_putpages: don't undirty pages until
                  after write completes
 #17536 b21e04e8d Fix zdb pool/ with -k
 #17537 -multiple Userspace tunables
 #17540 2957eabbe Add support for FreeBSD's Solaris style extended
                  attribute interface
 #17547 4bd7a2eaa zdb: fix checksum calculation for decompressed blocks
 #17551 -multiple cleanup: remove var init/update
 #17561 0f8a1105e Skip dbuf_evict_one() from dbuf_evict_notify()
                  for reclaim thread
 #17563 10a78e264 Faster checksum benchmark on system boot
 #17564 00ce064d8 spa: update blkptr diagram to include vdev padding
                  on encrypted blocks
 #17565 -multiple Physical rewrite
 #17566 fc885f308 Don't use wrong weight when passivating group
 #17572 f70c85086 BRT: Fix ZAP entry endianness
 #17575 0b6fd024a ZVOL: Unify zvol minors operations and improve error
                  handling
 #17581 cb5e7e097 range_tree: Provide more debug details upon unexpected
                  add/remove
 #17587 -multiple Fix two issues with dynamic gang headers

Obtained from:	OpenZFS
OpenZFS commit:	8302b6e32b
2025-08-07 09:06:31 +02:00
Alan Somers
a13ddd6210 zfsd: don't try to fix an OFFLINE condition
If the system administrator does "zpool offline", he's doing it for a
reason.  zfsd shouldn't consider an offline disk to be an event that
requires automatic healing.  Don't online it in response to a GEOM
event, and don't try to activate a hotspare to take over from it.

MFC after:	2 weeks
Sponsored by:	ConnectWise
2025-08-04 10:00:52 -06:00
Mateusz Piotrowski
1acfb873cf dtrace.1: Document security.bsd.allow_destructive_dtrace
PR:		288284
Reviewed by:	bcr, markj
MFC after:	3 days
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51633
2025-08-01 17:23:20 +02:00
Mark Johnston
dabde7d976 libdtrace: Permit taking the address of an identifier without type info
Symbols defined using assembler directives lack type info, but in this
case one ought to be able to cast a pointer to the symbol and
dereference the pointer to get a value.  Without this change, D
disallows this trick since it requires all identifiers to have a type.

Relax the rules slightly and allow an identifier to have type "void" if
we know we're just taking its address.

As a result, the following dtrace invocation works:

  dtrace -n 'tick-1s {printf("%d", *(int *)&`ticks);}'

In particular, since commit b2b974f7ef ("clock: Simplify subr_ticks
and rename"), "ticks" does not have any type info associated with it, so
its value couldn't be printed.  This trick provides a workaround and is
probably generally useful.

Add a regression test which exercises this functionality.

PR:		287752
Reviewed by:	avg
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D51417
2025-07-21 14:57:58 +00:00
Mark Johnston
654dea5967 libdtrace: Use a designated array initializer for dt_cook_funcs[]
Also make the array const.  No functional change intended.

MFC after:	1 week
2025-07-21 14:57:58 +00:00
Mateusz Piotrowski
9388c28878 dtrace_fbt.4: Document the DTrace fbt provider
Reported by:	markj
Reviewed by:	christos, markj (earlier version), ziaee
Obtained from:	Mark Johnston, DTrace, FreeBSD Journal, May 2014
Obtained from:	https://wiki.freebsd.org/DTrace/One-Liners
MFC after:	2 weeks
Relnotes:	yes
2025-07-16 12:27:52 +02:00
Mateusz Piotrowski
1fe7af0635 dtrace.1: Document evaltime
Reviewed by:	christos, ziaee
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51301
2025-07-14 18:38:19 +02:00
Mateusz Piotrowski
46efd2ceca dtrace_profile.4: Document the DTrace profile provider
Event:		Berlin Hackathon 202507
Reviewed by:	bcr, christos
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51278
2025-07-14 18:35:01 +02:00
Mateusz Piotrowski
193f2289fc d.7: Document the DTrace scripting language
Reviewed by:	bcr, christos, ziaee
Event:		Berlin Hackathon 202507
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51268
2025-07-14 15:01:51 +02:00
Mateusz Piotrowski
a487606afd dtrace_dtrace.4: Document the DTrace dtrace provider
Reviewed by:	bcr, christos
Event:		Berlin Hackathon 202507
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D51267
2025-07-14 14:17:04 +02:00
Mateusz Piotrowski
98a1084001 dtrace.1: Reference dwatch(1) and tracing(7)
Reviewed by:	bcr
Event:		Berlin 2025 Hackathon
2025-07-12 11:35:29 +02:00
Jiacong Fang
12bef37a82 dtrace: fix symbol address resolution
Dtrace assumes only ELF sections of type SHT_PROGBITS or SHT_NOBITS
occupy memory space. However, sections with SHF_ALLOC flag also consume
memory space. Moreover, the symbol address initialization skips symbols
at the very beginning of a section in ET_REL KLDs.

Fix: Check section flag for calculating section offset, and disable the
skipping at the beginning of a section.

PR:		288000
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D51188
2025-07-07 20:16:31 +00:00
Ricardo Branco
4140012f83 tests: Adapt oclo tests to FreeBSD
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1698
2025-07-06 23:09:10 +00:00
Ricardo Branco
20ee243707 tests: Add Illumos oclo tests for O_CLOEXEC & O_CLOFORK
Taken from last commit bb9475a199514dcace79d04d02c1eff05d65b94f from
https://github.com/illumos/illumos-gate/tree/master/usr/src/test/os-tests/tests/oclo

MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1698
2025-07-06 23:09:05 +00:00
Alan Somers
b5962a1837 Fix location of libtpool.so.2 after 5c1ba994a8
Commit 5c1ba994a8 inadvertently moved the installed location of a
shared library.  Move it back.

Reported by:	olivier
Tested by:	olivier
Fixes:		5c1ba994a8
Sponsored by:	ConnectWise
2025-06-26 08:12:04 -06:00
Mark Johnston
7b26124ae1 libtpool/tests: Fix a flaky test
I occasionally see failures due to pthread_barrier_wait() not returning
0.  There is another possible non-error return value, so allow that too.
While here, check the result in tp_delay() as well.

Fixes:		5c1ba994a8 ("Add a regression test for a libtpool bug")
Differential Revision:	https://reviews.freebsd.org/D50967
2025-06-25 17:17:08 +00:00
Ed Maste
6b70ffeb2a ZFS: Fix tests build with FORTIFY_SOURCE
Reviewed by:	kevans
Event:		Kitchener-Waterloo Hackathon 202506
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50876
2025-06-16 10:47:22 -04:00
Alan Somers
5c1ba994a8 Add a regression test for a libtpool bug
Test that tpool_dispatch returns an error if it cannot start even one
worker.  Previously, it would hang.  The test must reside here rather
than in the OpenZFS repo because the latter has no infrastructure for
writing libtpool tests.

https://github.com/openzfs/zfs/issues/16172

MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D45587
2025-06-15 10:01:37 -06:00
Mateusz Piotrowski
177471148a dtrace.1: Mention providers in SEE ALSO
Reviewed by:	bnovkov, christos, markj
Approved by:	bnovkov (mentor), christos (mentor), markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D50852
2025-06-14 19:49:56 +02:00
Alexander Ziaee
3fd42db26c
ctfconvert.1: Minor cleanup
Alphabetize option table to improve first glance access.
Markup semantics to differentiate them and add them to apropos.

MFC after:		3 days
Reviewed by:		Pau Amma <pauamma@gundo.com>
Approved by:		mhorne (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D49883
2025-06-13 15:24:12 -04:00
Brooks Davis
8e35800732 build: remove the last vestiges of lint support
Commit 1cbb58886a (shipped in 12.0.0) removed all lint infrastructure.
A bunch of NO_LINT definitions remained (perhaps as a bootstrapping
measture).  Remove them.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D50704
2025-06-06 00:55:34 +01:00