From owner-svn-src-head@freebsd.org Thu Jan 21 19:19:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F00A8BF67; Thu, 21 Jan 2016 19:19:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 972961D54; Thu, 21 Jan 2016 19:19:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA00139; Thu, 21 Jan 2016 21:19:00 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1aMKl2-00082S-Ds; Thu, 21 Jan 2016 21:19:00 +0200 Subject: Re: svn commit: r294471 - head/sys/dev/usb/wlan To: cem@FreeBSD.org References: <201601202327.u0KNR2Hh066219@repo.freebsd.org> <4FBE9133-AB30-4D30-A298-1742952700C5@panasas.com> <20160121012825.GA9303@wkstn-mjohnston.west.isilon.com> <56A0AA58.3070704@FreeBSD.org> Cc: Mark Johnston , Ravi Pokala , Adrian Chadd , Andriy Voskoboinyk , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon X-Enigmail-Draft-Status: N1110 Message-ID: <56A12EEB.3040906@FreeBSD.org> Date: Thu, 21 Jan 2016 21:18:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 19:19:10 -0000 On 21/01/2016 19:25, Conrad Meyer wrote: > On Thu, Jan 21, 2016 at 1:52 AM, Andriy Gapon wrote: >> On 21/01/2016 03:28, Mark Johnston wrote: >>> Isilon has done ad-hoc implementations of this for bufs and mbufs, and >>> they're quite handy for debugging. With BUF_TRACKING enabled in our >>> kernel config, each buf contains a const char *b_records[32], and one >>> adds >>> >>> buf_track(bp, __func__); >>> >>> or so to various functions to record an entry in the buf when the >>> function is invoked. >> >> Does your extension also save a stack trace? >> I would love to have something like that for the memory allocation and >> deallocation audit. > > No, just a pointer to a constant string (function name or similar). I > think stacks would take up a huge amount of space relative to the size > of a buf (~1kB), rather than just a little bit more space :-). Well, 15 or so addresses on amd64 would take 120 bytes and if they go to a circular buffer, then it should not matter that much. > I worked on a project involving buffers and found the tracking very > handy. Something less ad-hoc would be useful to have. Indeed! -- Andriy Gapon