* Tracking drm_intel_bo allocation
@ 2011-03-26 6:36 Segovia, Benjamin
2011-03-26 7:21 ` Chris Wilson
2011-03-28 20:26 ` Eric Anholt
0 siblings, 2 replies; 4+ messages in thread
From: Segovia, Benjamin @ 2011-03-26 6:36 UTC (permalink / raw)
To: DRI
[-- Attachment #1.1: Type: text/plain, Size: 325 bytes --]
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?
Thanks!
Ben
[-- Attachment #1.2: Type: text/html, Size: 2445 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tracking drm_intel_bo allocation
2011-03-26 6:36 Tracking drm_intel_bo allocation Segovia, Benjamin
@ 2011-03-26 7:21 ` Chris Wilson
2011-03-26 7:28 ` Segovia, Benjamin
2011-03-28 20:26 ` Eric Anholt
1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2011-03-26 7:21 UTC (permalink / raw)
To: Segovia, Benjamin, DRI
On Fri, 25 Mar 2011 23:36:33 -0700, "Segovia, Benjamin" <benjamin.segovia@intel.com> 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?
valgrind.
The kernel releases all client references upon termination.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Tracking drm_intel_bo allocation
2011-03-26 7:21 ` Chris Wilson
@ 2011-03-26 7:28 ` Segovia, Benjamin
0 siblings, 0 replies; 4+ messages in thread
From: Segovia, Benjamin @ 2011-03-26 7:28 UTC (permalink / raw)
To: Chris Wilson, DRI
OK. Two last questions to be sure that I am doing correct things.
1/ I have to use an external tool to check leaks. Nothing to track per-process allocation from the kernel or from drm_intel?
2/ From libva and Mesa, I guessed that the correct way to use drm_intel for everything which is temporary (like a batch-buffer) is just to do:
- drm_intel_alloc
- drm_intel_exec (for example)
- drm_intel_unreference
Basically, I do _not_ have to be concerned about allocation overhead and how to reuse buffers: this is the role of libdrm_intel. Is it correct?
Thanks for your help.
Cheers,
Ben
-----Original Message-----
From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
Sent: Saturday, March 26, 2011 12:21 AM
To: Segovia, Benjamin; DRI
Subject: Re: Tracking drm_intel_bo allocation
On Fri, 25 Mar 2011 23:36:33 -0700, "Segovia, Benjamin" <benjamin.segovia@intel.com> 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?
valgrind.
The kernel releases all client references upon termination.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Tracking drm_intel_bo allocation
2011-03-26 6:36 Tracking drm_intel_bo allocation Segovia, Benjamin
2011-03-26 7:21 ` Chris Wilson
@ 2011-03-28 20:26 ` Eric Anholt
1 sibling, 0 replies; 4+ messages in thread
From: Eric Anholt @ 2011-03-28 20:26 UTC (permalink / raw)
To: Segovia, Benjamin, DRI
[-- Attachment #1.1: Type: text/plain, Size: 722 bytes --]
On Fri, 25 Mar 2011 23:36:33 -0700, "Segovia, Benjamin" <benjamin.segovia@intel.com> 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]--; }
END {
for (name in botype) {
printf("%s: %d\n", name, botype[name])
}
}
[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-28 20:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-26 6:36 Tracking drm_intel_bo allocation Segovia, Benjamin
2011-03-26 7:21 ` Chris Wilson
2011-03-26 7:28 ` Segovia, Benjamin
2011-03-28 20:26 ` Eric Anholt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.