Tracking drm_intel_bo allocation

Eric Anholt eric at
Mon Mar 28 13:26:12 PDT 2011

On Fri, 25 Mar 2011 23:36:33 -0700, "Segovia, Benjamin" <benjamin.segovia at> wrote:
> Hello all,
> I am using drm_intel to access the HW. I would like to know if there
> is any way to know if my application frees all the bos I used. I would
> like to be sure I cleanly freed my resources and no bo is still
> referenced.  Is there any tool in the memory allocation part of
> drm_intel to do that?

I've used the drm_intel_bufmgr_set_debug() plus post-processing to catch
major leaks before.

#!/usr/bin/awk -f

/bo_create:/ { botype[$4]++; }
/bo_unreference final:/ { botype[$4]--; }

        for (name in botype) {
                printf("%s: %d\n", name, botype[name])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the dri-devel mailing list