1a79fe607SDoug Rabson.\" 2*8d5d9737SAlexander Ziaee.\" SPDX-License-Identifier: BSD-2-Clause 3*8d5d9737SAlexander Ziaee.\" 4a79fe607SDoug Rabson.\" Copyright (c) 1997 Doug Rabson 5a79fe607SDoug Rabson.\" All rights reserved. 6a79fe607SDoug Rabson.\" 7a79fe607SDoug Rabson.\" Redistribution and use in source and binary forms, with or without 8a79fe607SDoug Rabson.\" modification, are permitted provided that the following conditions 9a79fe607SDoug Rabson.\" are met: 10a79fe607SDoug Rabson.\" 1. Redistributions of source code must retain the above copyright 11a79fe607SDoug Rabson.\" notice, this list of conditions and the following disclaimer. 12a79fe607SDoug Rabson.\" 2. Redistributions in binary form must reproduce the above copyright 13a79fe607SDoug Rabson.\" notice, this list of conditions and the following disclaimer in the 14a79fe607SDoug Rabson.\" documentation and/or other materials provided with the distribution. 15a79fe607SDoug Rabson.\" 16a79fe607SDoug Rabson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17a79fe607SDoug Rabson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18a79fe607SDoug Rabson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19a79fe607SDoug Rabson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20a79fe607SDoug Rabson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21a79fe607SDoug Rabson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22a79fe607SDoug Rabson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23a79fe607SDoug Rabson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24a79fe607SDoug Rabson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25a79fe607SDoug Rabson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26a79fe607SDoug Rabson.\" SUCH DAMAGE. 27a79fe607SDoug Rabson.\" 28*8d5d9737SAlexander Ziaee.Dd January 4, 2025 29a79fe607SDoug Rabson.Dt KLDSTAT 8 30a79fe607SDoug Rabson.Os 31a79fe607SDoug Rabson.Sh NAME 32a79fe607SDoug Rabson.Nm kldstat 33a79fe607SDoug Rabson.Nd display status of dynamic kernel linker 34a79fe607SDoug Rabson.Sh SYNOPSIS 357c7fb079SRuslan Ermilov.Nm 361b18fc10SEdward Tomasz Napierala.Op Fl h 373e8cf495SBaptiste Daroussin.Op Fl q 38a79fe607SDoug Rabson.Op Fl v 39637733b1SJulian Elischer.Op Fl d 40a79fe607SDoug Rabson.Op Fl i Ar id 415d6d6d38SMax Khon.Op Fl n Ar filename 425d6d6d38SMax Khon.Nm 4390217cddSPawel Jakub Dawidek.Op Fl q 44637733b1SJulian Elischer.Op Fl d 455d6d6d38SMax Khon.Op Fl m Ar modname 46a79fe607SDoug Rabson.Sh DESCRIPTION 47a79fe607SDoug RabsonThe 48a79fe607SDoug Rabson.Nm 4961c3dd35SPaul Saabutility displays the status of any files dynamically linked into the 5061c3dd35SPaul Saabkernel. 51a79fe607SDoug Rabson.Pp 5257e78ffbSPhilippe CharnierThe following options are available: 53*8d5d9737SAlexander Ziaee.Bl -tag -width "-n filename" 54*8d5d9737SAlexander Ziaee.It Fl d 55*8d5d9737SAlexander ZiaeeShow the module specific data (as int, unsigned int and unsigned long) 561b18fc10SEdward Tomasz Napierala.It Fl h 571b18fc10SEdward Tomasz NapieralaDisplay the size field in a human-readable form, using unit suffixes 581b18fc10SEdward Tomasz Napieralainstead of hex values. 59a79fe607SDoug Rabson.It Fl i Ar id 60a79fe607SDoug RabsonDisplay the status of only the file with this ID. 61*8d5d9737SAlexander Ziaee.It Fl m Ar modname 62*8d5d9737SAlexander ZiaeeDisplay the status of only the module with this modname. 635d6d6d38SMax Khon.It Fl n Ar filename 645d6d6d38SMax KhonDisplay the status of only the file with this filename. 6590217cddSPawel Jakub Dawidek.It Fl q 66*8d5d9737SAlexander ZiaeeQuietly check if file is loaded or compiled into the kernel. 67*8d5d9737SAlexander Ziaee.It Fl v 68*8d5d9737SAlexander ZiaeeBe more verbose. 69a79fe607SDoug Rabson.El 70a866e170SRuslan Ermilov.Sh EXIT STATUS 71a866e170SRuslan Ermilov.Ex -std 722825bf5bSFernando Apesteguía.Sh EXAMPLES 732825bf5bSFernando ApesteguíaShow files dynamically linked into the kernel. 742825bf5bSFernando ApesteguíaNote the kernel itself is shown in the list. 752825bf5bSFernando Apesteguía.Em Refs 762825bf5bSFernando Apesteguíashows the number of modules referenced by each file: 772825bf5bSFernando Apesteguía.Bd -literal -offset indent 782825bf5bSFernando Apesteguía$ kldstat 792825bf5bSFernando ApesteguíaId Refs Address Size Name 802825bf5bSFernando Apesteguía 1 38 0xffffffff80200000 2448f20 kernel 812825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 b7bd8 linux.ko 822825bf5bSFernando Apesteguía 3 5 0xffffffff82701000 9698 linux_common.ko 832825bf5bSFernando Apesteguía 4 1 0xffffffff82b11000 1eae linsysfs.ko 842825bf5bSFernando Apesteguía 5 1 0xffffffff82b13000 f2af8 nvidia-modeset.ko 852825bf5bSFernando Apesteguía 6 1 0xffffffff82c06000 122b020 nvidia.ko 862825bf5bSFernando Apesteguía 7 1 0xffffffff83e32000 2668 intpm.ko 872825bf5bSFernando Apesteguía 8 1 0xffffffff83e35000 b50 smbus.ko 882825bf5bSFernando Apesteguía 9 1 0xffffffff83e36000 18a0 uhid.ko 892825bf5bSFernando Apesteguía10 1 0xffffffff83e38000 2928 ums.ko 902825bf5bSFernando Apesteguía11 1 0xffffffff83e3b000 1aa0 wmt.ko 912825bf5bSFernando Apesteguía12 1 0xffffffff83e3d000 cd70 snd_uaudio.ko 922825bf5bSFernando Apesteguía.Ed 932825bf5bSFernando Apesteguía.Pp 942825bf5bSFernando ApesteguíaShow the verbose status of the 952825bf5bSFernando Apesteguía.Em linux 962825bf5bSFernando Apesteguíafile and show the size in a human readable fashion: 972825bf5bSFernando Apesteguía.Bd -literal -offset indent 982825bf5bSFernando Apesteguía$ kldstat -h -v -n linux 992825bf5bSFernando ApesteguíaId Refs Address Size Name 1002825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 735K linux.ko (/boot/kernel/linux.ko) 1012825bf5bSFernando Apesteguía Contains modules: 1022825bf5bSFernando Apesteguía Id Name 1032825bf5bSFernando Apesteguía 2 linuxelf 1042825bf5bSFernando Apesteguía.Ed 1052825bf5bSFernando Apesteguía.Pp 1062825bf5bSFernando ApesteguíaSame as above using the 1072825bf5bSFernando Apesteguía.Em id 1082825bf5bSFernando Apesteguíaof the file: 1092825bf5bSFernando Apesteguía.Bd -literal -offset indent 1102825bf5bSFernando Apesteguía$ kldstat -h -i 2 -v 1112825bf5bSFernando ApesteguíaId Refs Address Size Name 1122825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 735K linux.ko (/boot/kernel/linux.ko) 1132825bf5bSFernando Apesteguía Contains modules: 1142825bf5bSFernando Apesteguía Id Name 1152825bf5bSFernando Apesteguía 2 linuxelf 1162825bf5bSFernando Apesteguía.Ed 1172825bf5bSFernando Apesteguía.Pp 1182825bf5bSFernando ApesteguíaShow the status of the 1192825bf5bSFernando Apesteguía.Em linuxelf 1202825bf5bSFernando Apesteguíamodule obtained from the example above: 1212825bf5bSFernando Apesteguía.Bd -literal -offset indent 1222825bf5bSFernando Apesteguía$ kldstat -v -m linuxelf 1232825bf5bSFernando ApesteguíaId Refs Name 1242825bf5bSFernando Apesteguía 2 1 linuxelf 1252825bf5bSFernando Apesteguía.Ed 1262825bf5bSFernando Apesteguía.Pp 1272825bf5bSFernando ApesteguíaShow the module specific data for the 1282825bf5bSFernando Apesteguía.Em g_raid 1292825bf5bSFernando Apesteguíamodule: 1302825bf5bSFernando Apesteguía.Bd -literal -offset indent 1312825bf5bSFernando Apesteguía$ kldstat -d -m g_raid 1322825bf5bSFernando ApesteguíaId Refs Name data..(int, uint, ulong) 1332825bf5bSFernando Apesteguía366 1 g_raid (0, 0, 0x0) 1342825bf5bSFernando Apesteguía.Ed 1352825bf5bSFernando Apesteguía.Pp 1362825bf5bSFernando ApesteguíaCheck if the module 1372825bf5bSFernando Apesteguía.Em fakefile 1382825bf5bSFernando Apesteguíais linked. 1392825bf5bSFernando ApesteguíaReturns 0 if it is, 1 otherwise: 1402825bf5bSFernando Apesteguía.Bd -literal -offset indent 1412825bf5bSFernando Apesteguía$ kldstat -q -n fakefile || echo file not linked 1422825bf5bSFernando Apesteguíafile not linked 1432825bf5bSFernando Apesteguía.Ed 144a79fe607SDoug Rabson.Sh SEE ALSO 145fa8b1c61SChris Costello.Xr kldstat 2 , 146a79fe607SDoug Rabson.Xr kldload 8 , 147a79fe607SDoug Rabson.Xr kldunload 8 1482830148aSJohn-Mark Gurney.Sh HISTORY 1492830148aSJohn-Mark GurneyThe 1502830148aSJohn-Mark Gurney.Nm 151e1205e80SPhilippe Charnierutility first appeared in 152a87c2a93SDavid E. O'Brien.Fx 3.0 , 153a87c2a93SDavid E. O'Brienreplacing the 1545ab2dec3SChristian Brueffer.Nm lkm 155a87c2a93SDavid E. O'Brieninterface. 15668085a0eSPhilippe Charnier.Sh AUTHORS 157bd0891ceSBaptiste Daroussin.An Doug Rabson Aq Mt dfr@FreeBSD.org 158