Hi Maarten,<div><br><div class="gmail_extra"><div class="gmail_quote">On 14 December 2012 17:27, Maarten Lankhorst <span dir="ltr"><<a href="mailto:m.b.lankhorst@gmail.com" target="_blank">m.b.lankhorst@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Op 14-12-12 10:36, <a href="mailto:sumit.semwal@ti.com">sumit.semwal@ti.com</a> schreef:<br>


<div class="im">> From: Sumit Semwal <<a href="mailto:sumit.semwal@linaro.org">sumit.semwal@linaro.org</a>><br>
><br>
> Add debugfs support to make it easier to print debug information<br>
> about the dma-buf buffers.<br>
><br>
</div>I like the idea, I don't know if it could be done in a free manner, but for bonus points<br>
could we also have the dma-buf fd be obtainable that way from a debugfs entry?<br>
<br>
Doing so would allow me to 'steal' a dma-buf from an existing mapping easily, and test against that. </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


Also I think the name of the device and process that exported the dma-buf would be useful<br>
to have as well, even if in case of the device that would mean changing the api slightly to record it.<br>
<br>
I was thinking of having a directory structure like this:<br>
<br>
/sys/kernel/debug/dma_buf/stats<br>
<br>
and then for each dma-buf:<br>
<br>
/sys/kernel/debug/dma-buf/exporting_file.c/<number>-fd<br>
/sys/kernel/debug/dma-buf/exporting_file.c/<number>-attachments<br>
/sys/kernel/debug/dma-buf/exporting_file.c/<number>-info<br>
<br>
Opening the fd file would give you back the original fd, or fail with -EIO if refcount was dropped to 0.<br>
<br>
Would something like this be doable? I don't know debugfs that well, but I don't see why it wouldn't be,<br></blockquote><div>Let me think more about it, but I am inclined to add simple support first, and then add more features to dma_buf debugfs as it grows.</div>

<div><br></div><div>I still would want to take Daniel's suggestion on dma_buf_export_named() before I push this patch, so I guess I'll try to work a little more and prepare it for 3.9?</div><div><br></div><div>I quite like your idea of .../dma-buf/<exporting_file.c>/...  , which would need the above as well :)</div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
~Maarten<br>
<br>
</blockquote></div>Best regards,</div><div class="gmail_extra">~Sumit.<br><br>
</div></div>