1a79fe607SDoug Rabson.\" 2a79fe607SDoug Rabson.\" Copyright (c) 1997 Doug Rabson 3a79fe607SDoug Rabson.\" All rights reserved. 4a79fe607SDoug Rabson.\" 5a79fe607SDoug Rabson.\" Redistribution and use in source and binary forms, with or without 6a79fe607SDoug Rabson.\" modification, are permitted provided that the following conditions 7a79fe607SDoug Rabson.\" are met: 8a79fe607SDoug Rabson.\" 1. Redistributions of source code must retain the above copyright 9a79fe607SDoug Rabson.\" notice, this list of conditions and the following disclaimer. 10a79fe607SDoug Rabson.\" 2. Redistributions in binary form must reproduce the above copyright 11a79fe607SDoug Rabson.\" notice, this list of conditions and the following disclaimer in the 12a79fe607SDoug Rabson.\" documentation and/or other materials provided with the distribution. 13a79fe607SDoug Rabson.\" 14a79fe607SDoug Rabson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15a79fe607SDoug Rabson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16a79fe607SDoug Rabson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17a79fe607SDoug Rabson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18a79fe607SDoug Rabson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19a79fe607SDoug Rabson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20a79fe607SDoug Rabson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21a79fe607SDoug Rabson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22a79fe607SDoug Rabson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23a79fe607SDoug Rabson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24a79fe607SDoug Rabson.\" SUCH DAMAGE. 25a79fe607SDoug Rabson.\" 267f3dea24SPeter Wemm.\" $FreeBSD$ 27a79fe607SDoug Rabson.\" 281b18fc10SEdward Tomasz Napierala.Dd January 19, 2016 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: 53a87c2a93SDavid E. O'Brien.Bl -tag -width indentXX 541b18fc10SEdward Tomasz Napierala.It Fl h 551b18fc10SEdward Tomasz NapieralaDisplay the size field in a human-readable form, using unit suffixes 561b18fc10SEdward Tomasz Napieralainstead of hex values. 57a79fe607SDoug Rabson.It Fl v 5861c3dd35SPaul SaabBe more verbose. 59637733b1SJulian Elischer.It Fl d 60637733b1SJulian ElischerShow the module specific data (as int, unsigned int and unsigned long) 61a79fe607SDoug Rabson.It Fl i Ar id 62a79fe607SDoug RabsonDisplay the status of only the file with this ID. 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*2825bf5bSFernando ApesteguíaOnly check if file is loaded or compiled into the kernel. 675d6d6d38SMax Khon.It Fl m Ar modname 685d6d6d38SMax KhonDisplay the status of only the module with this modname. 69a79fe607SDoug Rabson.El 70a866e170SRuslan Ermilov.Sh EXIT STATUS 71a866e170SRuslan Ermilov.Ex -std 72*2825bf5bSFernando Apesteguía.Sh EXAMPLES 73*2825bf5bSFernando ApesteguíaShow files dynamically linked into the kernel. 74*2825bf5bSFernando ApesteguíaNote the kernel itself is shown in the list. 75*2825bf5bSFernando Apesteguía.Em Refs 76*2825bf5bSFernando Apesteguíashows the number of modules referenced by each file: 77*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 78*2825bf5bSFernando Apesteguía$ kldstat 79*2825bf5bSFernando ApesteguíaId Refs Address Size Name 80*2825bf5bSFernando Apesteguía 1 38 0xffffffff80200000 2448f20 kernel 81*2825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 b7bd8 linux.ko 82*2825bf5bSFernando Apesteguía 3 5 0xffffffff82701000 9698 linux_common.ko 83*2825bf5bSFernando Apesteguía 4 1 0xffffffff82b11000 1eae linsysfs.ko 84*2825bf5bSFernando Apesteguía 5 1 0xffffffff82b13000 f2af8 nvidia-modeset.ko 85*2825bf5bSFernando Apesteguía 6 1 0xffffffff82c06000 122b020 nvidia.ko 86*2825bf5bSFernando Apesteguía 7 1 0xffffffff83e32000 2668 intpm.ko 87*2825bf5bSFernando Apesteguía 8 1 0xffffffff83e35000 b50 smbus.ko 88*2825bf5bSFernando Apesteguía 9 1 0xffffffff83e36000 18a0 uhid.ko 89*2825bf5bSFernando Apesteguía10 1 0xffffffff83e38000 2928 ums.ko 90*2825bf5bSFernando Apesteguía11 1 0xffffffff83e3b000 1aa0 wmt.ko 91*2825bf5bSFernando Apesteguía12 1 0xffffffff83e3d000 cd70 snd_uaudio.ko 92*2825bf5bSFernando Apesteguía.Ed 93*2825bf5bSFernando Apesteguía.Pp 94*2825bf5bSFernando ApesteguíaShow the verbose status of the 95*2825bf5bSFernando Apesteguía.Em linux 96*2825bf5bSFernando Apesteguíafile and show the size in a human readable fashion: 97*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 98*2825bf5bSFernando Apesteguía$ kldstat -h -v -n linux 99*2825bf5bSFernando ApesteguíaId Refs Address Size Name 100*2825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 735K linux.ko (/boot/kernel/linux.ko) 101*2825bf5bSFernando Apesteguía Contains modules: 102*2825bf5bSFernando Apesteguía Id Name 103*2825bf5bSFernando Apesteguía 2 linuxelf 104*2825bf5bSFernando Apesteguía.Ed 105*2825bf5bSFernando Apesteguía.Pp 106*2825bf5bSFernando ApesteguíaSame as above using the 107*2825bf5bSFernando Apesteguía.Em id 108*2825bf5bSFernando Apesteguíaof the file: 109*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 110*2825bf5bSFernando Apesteguía$ kldstat -h -i 2 -v 111*2825bf5bSFernando ApesteguíaId Refs Address Size Name 112*2825bf5bSFernando Apesteguía 2 3 0xffffffff82649000 735K linux.ko (/boot/kernel/linux.ko) 113*2825bf5bSFernando Apesteguía Contains modules: 114*2825bf5bSFernando Apesteguía Id Name 115*2825bf5bSFernando Apesteguía 2 linuxelf 116*2825bf5bSFernando Apesteguía.Ed 117*2825bf5bSFernando Apesteguía.Pp 118*2825bf5bSFernando ApesteguíaShow the status of the 119*2825bf5bSFernando Apesteguía.Em linuxelf 120*2825bf5bSFernando Apesteguíamodule obtained from the example above: 121*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 122*2825bf5bSFernando Apesteguía$ kldstat -v -m linuxelf 123*2825bf5bSFernando ApesteguíaId Refs Name 124*2825bf5bSFernando Apesteguía 2 1 linuxelf 125*2825bf5bSFernando Apesteguía.Ed 126*2825bf5bSFernando Apesteguía.Pp 127*2825bf5bSFernando ApesteguíaShow the module specific data for the 128*2825bf5bSFernando Apesteguía.Em g_raid 129*2825bf5bSFernando Apesteguíamodule: 130*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 131*2825bf5bSFernando Apesteguía$ kldstat -d -m g_raid 132*2825bf5bSFernando ApesteguíaId Refs Name data..(int, uint, ulong) 133*2825bf5bSFernando Apesteguía366 1 g_raid (0, 0, 0x0) 134*2825bf5bSFernando Apesteguía.Ed 135*2825bf5bSFernando Apesteguía.Pp 136*2825bf5bSFernando ApesteguíaCheck if the module 137*2825bf5bSFernando Apesteguía.Em fakefile 138*2825bf5bSFernando Apesteguíais linked. 139*2825bf5bSFernando ApesteguíaReturns 0 if it is, 1 otherwise: 140*2825bf5bSFernando Apesteguía.Bd -literal -offset indent 141*2825bf5bSFernando Apesteguía$ kldstat -q -n fakefile || echo file not linked 142*2825bf5bSFernando Apesteguíafile not linked 143*2825bf5bSFernando 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