diff options
| author | Warner Losh <imp@FreeBSD.org> | 2024-10-14 21:57:16 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2024-10-14 22:03:58 +0000 |
| commit | cc7854e10903cd4726a4da6610ebf4dcf69de352 (patch) | |
| tree | 4676c781445485d5b324df148063d5b128bf0461 /sys/dev/uart | |
| parent | fa93443af9fb05989dc069ea37932be1b760e7f3 (diff) | |
uart: export rclk via sysctl
To help debugging, export the rclk a uart is using as
dev.uart.X.rclk. It can be opaque when it is wrong since any error
messages printed to the system console using the wrong rclk aren't
informative.
Sponsored by: Netflix
Reviewed by: andrew, markj
Differential Revision: https://reviews.freebsd.org/D47070
Diffstat (limited to 'sys/dev/uart')
| -rw-r--r-- | sys/dev/uart/uart_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c index 71f39e4c71e7..d0c4a54c8038 100644 --- a/sys/dev/uart/uart_core.c +++ b/sys/dev/uart/uart_core.c @@ -752,6 +752,11 @@ uart_bus_attach(device_t dev) "rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, "Receive overruns"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rclk", CTLFLAG_RD, &sc->sc_bas.rclk, 0, + "Baud clock for device"); + return (0); fail: |
