From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 15 13:05:51 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 2577D1065674 for ; Tue, 15 Apr 2008 13:05:51 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id CABE28FC24 for ; Tue, 15 Apr 2008 13:05:50 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so2745452pyb.10 for ; Tue, 15 Apr 2008 06:05:49 -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=rNG8HiRJ8xqps7GvWlVyClv39KynApF205YwtYBLYt0=; b=vXw7RVRBMyXOMQ7bzHfI9scDZex3NsDSoT+t/5eNQ6DFiwHbFzEE2LsdgSGiOwDx3ZzpFJcGr/lpmO1IPnCW3uXQpDmJuYHTMjOfEbeKEKl/CcpkbQTf3zRiWyBmIL8x04xm0P7BvK22jV673q6mTGJwSYkg04n8qJI9341xkMc= 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=iV9oWOdC3hYRDjD21EAygSAjISNWBdhV9nWkAK+2jkDMmaIQ7xz7USCR7kWuZADiEADvi3iA0y4fxOl5Ox/FJrVHvM0u49WcwdklJOzV+3jUkTa93SVFl0pTR6OsSNWzVrnaps0LDLyCCFBjueLIp3gYqYD+EBewaxzPGKLpaQQ= Received: by 10.35.60.15 with SMTP id n15mr12791284pyk.60.1208263037498; Tue, 15 Apr 2008 05:37:17 -0700 (PDT) Received: by 10.35.38.6 with HTTP; Tue, 15 Apr 2008 05:37:17 -0700 (PDT) Message-ID: Date: Tue, 15 Apr 2008 14:37:17 +0200 From: "Antoine Brodin" Sender: antoine.brodin.freebsd@gmail.com To: Volker In-Reply-To: <4803AE07.9010106@vwsoft.com> 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: b2e1ae203a43fc68 Cc: 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 13:05:51 -0000 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. I hope this helps. Cheers, Antoine > >From within these functions, I need to get the name (or an ID) of the > module trying to allocate memory (and display that or - better - filter > some allocations out).