From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 15 14:27:34 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9760A1065680 for ; Tue, 15 Apr 2008 14:27:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.freebsd.org (Postfix) with ESMTP id 4290D8FC23 for ; Tue, 15 Apr 2008 14:27:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so2782596pyb.10 for ; Tue, 15 Apr 2008 07:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=biEnFfTAO2jfbM2qHhbKO7RsU7eAhhzG3/gwrkQTCYs=; b=xH1V98Q0BIR9GttQCFPS4TZiHee5XraNdhzKo44/0rpCJfl+fsb7sq7hAzcmMfy0ifFyecQgaZe/tU8KvVFBZ7lyOOrKsdKmAbZYSv3trohgRv4NaSLEUnYC7so6joF17s3UZ4HJsau6rGqI32lrR89nXZYDXyXpAhk0raCDLf4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=f84Jk95cwYGjDvqqCpAbuQzfuC4bh+lju58Ezu035KvMv42AyENERML6usb6aU+Jo8vxASm1Itc7wBa/467c4p6BHk0YjUFspUiqwT3Q4fIAkHWaaIyS2Jmw+Wq4r+sO3Wa011G/qSd1LbL91fFd7+pgtrTEps8iVDkrO543Ofw= Received: by 10.35.86.19 with SMTP id o19mr13029218pyl.43.1208269652495; Tue, 15 Apr 2008 07:27:32 -0700 (PDT) Received: by 10.35.38.6 with HTTP; Tue, 15 Apr 2008 07:27:32 -0700 (PDT) Message-ID: Date: Tue, 15 Apr 2008 16:27:32 +0200 From: "Antoine Brodin" Sender: antoine.brodin.freebsd@gmail.com To: "Antoine Brodin" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4803AE07.9010106@vwsoft.com> X-Google-Sender-Auth: 1cfa39019ef15104 Cc: Volker , hackers@freebsd.org Subject: Re: "visualize" kernel memory allocations X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2008 14:27:34 -0000 On Tue, Apr 15, 2008 at 2:37 PM, Antoine Brodin wrote: > On Mon, Apr 14, 2008 at 9:18 PM, Volker wrote: > > Hi hackers! > > > > I need to hunt kernel memory allocations done by a kld. Unfortunately > > the kld in question is a blob, no access to source code, so I need to > > check for kmem_alloc() + kmem_malloc() + kmem_free() and print > > information from there to the console screen. > > Hi Volker, > > You could patch your kld (hexadecimal editor or something like that) > to call wrappers around the interesting functions that print the > arguments. "objcopy --redefine-syms" seems to be easier to use than a hexadecimal editor. Cheers, Antoine