From owner-cvs-all@FreeBSD.ORG Tue Jan 9 19:46:19 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EEB316A403; Tue, 9 Jan 2007 19:46:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 8AA2313C442; Tue, 9 Jan 2007 19:46:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l09JkDJ9077936; Tue, 9 Jan 2007 14:46:16 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Tue, 9 Jan 2007 13:13:49 -0500 User-Agent: KMail/1.9.1 References: <200701091750.l09Ho520002603@repoman.freebsd.org> In-Reply-To: <200701091750.l09Ho520002603@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701091313.50169.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Tue, 09 Jan 2007 14:46:16 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2430/Tue Jan 9 12:35:51 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/libexec/rtld-elf rtld.c src/usr.bin/kdump kdump.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2007 19:46:19 -0000 On Tuesday 09 January 2007 12:50, John Baldwin wrote: > jhb 2007-01-09 17:50:05 UTC > > FreeBSD src repository > > Modified files: > libexec/rtld-elf rtld.c > usr.bin/kdump kdump.c > Log: > Add various utrace's for use with ktrace to the ELF runtime linker. To > activate the traces, set the LD_UTRACE (or LD_32_UTRACE) environment > variable. This also includes code in kdump(8) to parse the traces. > > Reviewed by: kan, jdp > MFC after: 2 weeks Some sample output: -bash-2.05b$ cat foo.c #include #include int main(int ac, char **av) { void *p; p = dlopen("libpcap.so.4", RTLD_NOW); if (p == 0) errx(1, "dlopen: %s", dlerror()); dlclose(p); } -bash-2.05b$ env LD_UTRACE=yes LD_PRELOAD=libm.so.2 ktrace ./foo -bash-2.05b$ kdump -t u 17266 foo USER RTLD: loaded 0x800529200 @ 0x800633000 - 0x800754fff (/usr/lib/compat/libm.so.2) 17266 foo USER RTLD: LD_PRELOAD finished 17266 foo USER RTLD: loaded 0x800529400 @ 0x800755000 - 0x80096cfff (/lib/libc.so.6) 17266 foo USER RTLD: init 0x8006362c0 for 0x800529200 (/usr/lib/compat/libm.so.2) 17266 foo USER RTLD: init 0x80077e568 for 0x800529400 (/lib/libc.so.6) 17266 foo USER dlopen(libpcap.so.4, RTLD_NOW) 17266 foo USER RTLD: loaded 0x800529600 @ 0x80096d000 - 0x800a96fff (/lib/libpcap.so.4) 17266 foo USER 0x800529600 = dlopen(libpcap.so.4) ref 1 17266 foo USER RTLD: init 0x800971b70 for 0x800529600 (/lib/libpcap.so.4) 17266 foo USER dlclose(0x800529600) (/lib/libpcap.so.4, 1) 17266 foo USER RTLD: fini 0x8009840b4 for 0x800529600 (/lib/libpcap.so.4) 17266 foo USER RTLD: unloaded 0x800529600 @ 0x80096d000 - 0x800a96fff (/lib/libpcap.so.4) 17266 foo USER dlclose(0x800529600) finished 17266 foo USER RTLD: fini 0x80082cdf4 for 0x800529400 (/lib/libc.so.6) 17266 foo USER RTLD: fini 0x80064a1a4 for 0x800529200 (/usr/lib/compat/libm.so.2) -- John Baldwin