svn commit: r294471 - head/sys/dev/usb/wlan

Conrad Meyer cem at FreeBSD.org
Thu Jan 21 18:32:24 UTC 2016


On Thu, Jan 21, 2016 at 1:52 AM, Andriy Gapon <avg at freebsd.org> 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 :-).

I worked on a project involving buffers and found the tracking very
handy.  Something less ad-hoc would be useful to have.

Best,
Conrad


More information about the svn-src-head mailing list