Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Oct 2007 13:49:56 +1300
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        John Birrell <jb@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/sys kldstat.2 src/sbin/kldstat kldstat.c src/sys/kern kern_linker.c src/sys/sys linker.h
Message-ID:  <20071031004956.GA27943@heff.fud.org.nz>
In-Reply-To: <200710220413.l9M4D8g3016327@repoman.freebsd.org>
References:  <200710220413.l9M4D8g3016327@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 22, 2007 at 04:12:58AM +0000, John Birrell wrote:
> jb          2007-10-22 04:12:57 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     lib/libc/sys         kldstat.2 
>     sbin/kldstat         kldstat.c 
>     sys/kern             kern_linker.c 
>     sys/sys              linker.h 
>   Log:
>   Add the full module path name to the kld_file_stat structure
>   for kldstat(2).
>   
>   This allows libdtrace to determine the exact file from which
>   a kernel module was loaded without having to guess.
>   
>   The kldstat(2) API is versioned with the size of the
>   kld_file_stat structure, so this change creates version 2.
>   
>   Add the pathname to the verbose output of kldstat(8) too.

This change didnt actually add to the verbose output of kldstat but is
always printed,

# kldstat 
Id Refs Address    Size     Name
 1   13 0xc0400000 940ed4   kernel (/boot/kernel/kernel)
 2    1 0xc0d41000 d4f0     if_ipw.ko (/boot/kernel/if_ipw.ko)
 3    1 0xc0d4f000 1088c    if_iwi.ko (/boot/kernel/if_iwi.ko)
 4    1 0xc0d60000 6b2ac    acpi.ko (/boot/kernel/acpi.ko)
 5    1 0xc56b1000 30000    iwi_bss.ko (/boot/kernel/iwi_bss.ko)

I would prefer that it did in fact go under verbose.


>   
>   MFC: 3 days
>  
>  #include <sys/cdefs.h>
> -__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sbin/kldstat/kldstat.c,v 1.19 2005/09/24 08:20:45 pjd Exp $");
> +__FBSDID("$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sbin/kldstat/kldstat.c,v 1.20 2007/10/22 04:12:57 jb Exp $");
>  
>  #include <err.h>
>  #include <stdint.h>
> @@ -60,9 +60,9 @@ static void printfile(int fileid, int ve
>      if (kldstat(fileid, &stat) < 0)
>  	warn("can't stat file id %d", fileid);
>      else
> -	printf("%2d %4d %p %-8jx %s\n",
> +	printf("%2d %4d %p %-8jx %s (%s)\n",
>  	       stat.id, stat.refs, stat.address, (uintmax_t)stat.size, 
> -	       stat.name);
> +	       stat.name, stat.pathname);
>  
>      if (verbose) {
>  	printf("\tContains modules:\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071031004956.GA27943>