Add a kgdb python script to extract bbl from kernel dumps
A kgdb script allows us to be relatively resilient to kernel structure
changes, with a lower burden for updates when they happen than a C tool.
tuexen@ requested we ship this script in a source distribution. Making
it easier for users to extract useful debugging information from a core.
It requires kgdb and python3 and would ideally be a lldb lua script, but
there is more work needed on lldb lua before we can do that.
Add the script as is. A single script we could run against a core would
be nice, but I don't want to let that block making this tool more
available.
Reviewed by: teuxen, rrs
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48705
zoneinfo: also install tzdata.zi and version
Build and install the shrunk version of the time zone database required
by libc++ 19 std::chrono::current_zone (etc). While here, also install
the tzdata 'version' file to align more closely with other vendors.
PR: 282377
Reviewed by: dim, emaste, imp
Differential Revision: https://reviews.freebsd.org/D49577
vm_grab: use iterator for grab lookup
When a page lookup fails in a vm_page_grab operation, use the results
of the failed search, stored in an iterator, to begin the search for a
predecessor to use in a call to vm_page_alloc_after(), to avoid doing
that search from the root in vm_page_alloc(), as happens now.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D49371
Fix GoogleTest 1.14.0 import
- Prune headers and tests no longer installed after the upgrade.
- Remove GoogleTest-related files when MK_GOOGLETEST == no.
- Disable `-Werror` with gcc to unbreak the gcc12 CI run with
`lib/googletest`. Any issues found by g++ will be filed
upstream and hopefully resolved in a future version.
- Remove clang -Werror issues which are resolved in version 1.14.0 to
avoid masking valid issues.
Conflicts:
ObsoleteFiles.inc
tools/build/mk/OptionalObsoleteFiles.inc
MFC after: 1 week
MFC with: 28f6c2f292806bf31230a959bc4b19d7081669a7
(cherry picked from commit 0c785f06020f3b02e34c97eb27fecd3af8eb2a7b)
netbsd-tests: Update a test case to chase grep symlink handling changes
This test case verifies that grep detects symlink loops when traversing
a directory hierarchy.
Fixes: fc12c191c087 ("grep: Default to -p instead of -S.")
Reviewed by: ngie, jhb
Reported by: Jenkins
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46544
(cherry picked from commit a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70)
netbsd-tests: Update a test case to chase grep symlink handling changes
This test case verifies that grep detects symlink loops when traversing
a directory hierarchy.
Fixes: fc12c191c087 ("grep: Default to -p instead of -S.")
Reviewed by: ngie, jhb
Reported by: Jenkins
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D46544
(cherry picked from commit a700bef1e4ee3e6f4e1a86a374bf9b4044f69a70)
mlx5en: sync channel close with the rq completion processing
Without the wait, mlx5e_destroy_rq() might free mbuf that is passed up
to the network stack on receive in mlx5e_poll_rx_cq().
Sponsored by: NVidia networking
MFC after: 1 week
uma: Avoid excessive per-CPU draining
After commit 389a3fa693ef, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.
Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.
Fixes: 389a3fa693ef ("uma: Add UMA_ZONE_UNMANAGED")
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: gallatin, kib
Differential Revision: https://reviews.freebsd.org/D49349
(cherry picked from commit f506d5af50fccc37f5aa9fe090e9a0d5f05506c8)
top: Make locale issues non-fatal.
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
uma: Avoid excessive per-CPU draining
After commit 389a3fa693ef, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.
Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.
Fixes: 389a3fa693ef ("uma: Add UMA_ZONE_UNMANAGED")
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: gallatin, kib
Differential Revision: https://reviews.freebsd.org/D49349
(cherry picked from commit f506d5af50fccc37f5aa9fe090e9a0d5f05506c8)
top: Make locale issues non-fatal.
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
linux: Handle IP_RECVTOS cmsg type
This unbreaks apps using GameNetworkingSockets from Valve.
(cherry picked from commit 186dc094cf1ce14b26c6dfa329a445357121238a)
linux: Fix a typo in linux_recvmsg_common
We are supposed to check the result of bsd_to_linux_sockopt_level here
rather than its input.
(cherry picked from commit 9f55630b8d72602f6ec86b15b607f5fc5fde911e)
linprocfs: Correct sysfs /proc/<pid>/mountinfo entry
Technically mount source could be an arbitrary string (since it's
effectively ignored), but it's common to repeat fs type there.
(cherry picked from commit b9752d5d1cea30a39e89c83ea3aeb539581418cb)
tcp: don't ever return ECONNRESET on close(2)
The SUS doesn't mention this error code as a possible one [1]. The FreeBSD
manual page specifies a possible ECONNRESET for close(2):
[ECONNRESET] The underlying object was a stream socket that was
shut down by the peer before all pending data was
delivered.
In the past it had been EINVAL (see 21367f630d72), and this EINVAL was
added as a safety measure in 623dce13c64ef. After conversion to
ECONNRESET it had been documented in the manual page in 78e3a7fdd51e6, but
I bet wasn't ever tested to actually be ever returned, cause the
tcp-testsuite[2] didn't exist back then. So documentation is incorrect
since 2006, if my bet wins. Anyway, in the modern FreeBSD the condition
described above doesn't end up with ECONNRESET error code from close(2).
The error condition is reported via SO_ERROR socket option, though. This
can be checked using the tcp-testsuite, temporarily disabling the
getsockopt(SO_ERROR) lines using sed command [3]. Most of these
[35 lines not shown]
netlink/route: fix nlattr_get_multipath() to check length
of supplied nexthop sub-attributes. While here, use unsigned types for
length calculations and improve style(9).
PR: 283860
(cherry picked from commit 49a6e213416b5c0c9eccdff0af1c6b01f34c3693)
acpi_ibm: pass brightness events to evdev(4)
unless the dev.acpi_ibm.0.handlerevents sysctl is set to process
them internally. The default for the latter is to ignore them,
so passing to evdev(4) is enabled by default.
Reviewed by: wulf, imp
Tested on: Lenovo Thinpad X11 Carbon 7Th Gen
Differential Revision: https://reviews.freebsd.org/D48174
(cherry picked from commit c21f5751ef0932796676e55953461e0679020e28)
top: Sync usage and synopsis
Switching between io and cpu sorting uses a great example in the usage.
[-m io | cpu]. Use that everywhere.
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49515
(cherry picked from commit 187d954eab94fdcb33609d91966dbd727acfd720)
top: Polish key bindings in usage and manual
Organize key bindings by ascii(7) for consistency and maintainability,
mark them as Interactive Commands, wordsmith them, and sync their
organization between the manual and help screen.
MFC after: 3 days
PR: 282734
Fixes: c8aa5e526 (move command mapping to commands.c)
Reviewed by: imp, mhorne, Jim Brown <jpb at jimby.name>
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49462
(cherry picked from commit 0a85254d5a33800600477ce57fbaab64591aa6ea)
hier.7: Storage partitions are not filesystems
I recommended the incorrect text to the submitter.
MFC after: 3 days
Fixes: f47cbb29e1c2 (Add /dev/gpt)
Reported by: Mark Millard <marklmi at yahoo.com>
Reviewed by: imp, mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49523
(cherry picked from commit 50296dccddf1a7734be2aef606cd8e0408ee8780)