<div dir="ltr">Hi Rohan,<br><br>Thanks for your reply! We'd like the standardization to happen in the drm layer so it can be carried along, however, debugfs has already been deprecated in Android kernel and tracking per pid is most likely a doable solution only in the device driver layer. So...since we'd still like the low-cost run-time query system, we eventually end up doing the tracepoint[1] + eBPF solution. We standardized a gpu memory total tracepoint in upstream linux. Then the GPU vendors integrate into their kernel driver to track those global and per-process total counters. Then we wrote a bpf c program to track this tracepoint and maintain a map for the userspace to poke at.<div><br></div><div>Best regards,</div><div>Yiwei<br><br>[1] <a href="https://lore.kernel.org/lkml/20200302235044.59163-1-zzyiwei@google.com">https://lore.kernel.org/lkml/20200302235044.59163-1-zzyiwei@google.com</a><br><div><br></div></div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 20, 2020 at 5:07 AM Rohan Garg <<a href="mailto:rohan.garg@collabora.com">rohan.garg@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Yiwei<br>
After some deliberation on how to move forward with my BO Labeling patches[1],<br>
we've come up with the following structure for debugfs entries:<br>
<br>
/debugfs/dri/128/bo/<handle>/label<br>
/debugfs/dri/128/bo/<handle>/size<br>
<br>
My initial idea was to count the total memory allocated for a particular label <br>
in kernel space, but that turned out to be far too complicated to implement. <br>
Which is why we decided to move towards something simpler and handle collating <br>
this information on the userspace side of things.<br>
<br>
Would this satisfy most of the Android teams requirements? I understand that <br>
it would leave out the memory tracking requirements tied to a specific PID, <br>
but correct me if I'm wrong, would this not possible with gralloc on Android?<br>
<br>
Cheers<br>
Rohan Garg<br>
<br>
[1] <a href="https://patchwork.freedesktop.org/patch/335508/?series=66752&rev=4" rel="noreferrer" target="_blank">https://patchwork.freedesktop.org/patch/335508/?series=66752&rev=4</a><br>
<br>
On lunes, 6 de enero de 2020 21:47:21 (CET) Yiwei Zhang wrote:<br>
> Thanks, I'll check it out.<br>
> <br>
> Best,<br>
> Yiwei<br>
> <br>
> On Mon, Jan 6, 2020 at 2:46 AM Rohan Garg <<a href="mailto:rohan.garg@collabora.com" target="_blank">rohan.garg@collabora.com</a>> wrote:<br>
> > Hi Yiwei<br>
> > <br>
> > On jueves, 19 de diciembre de 2019 19:52:26 (CET) Yiwei Zhang wrote:<br>
> > > Hi Rohan,<br>
> > > <br>
> > > Thanks for pointing out the pids issue! Then the index would be<br>
> > <br>
> > {namespace<br>
> > <br>
> > > + pid(in that namespace)}. I'll grab a setup and play with the driver to<br>
> > > see what I can do. I know how to find an Intel or Freedreno setup, but<br>
> > <br>
> > I'd<br>
> > <br>
> > > still like to know is there a development friendly Mali setup?<br>
> > <br>
> > You should be able to setup a Mali T860 compatible device with this guide<br>
> > [1].<br>
> > <br>
> > Cheers<br>
> > Rohan Garg<br>
> > <br>
> > [1] <a href="https://panfrost.freedesktop.org/building-panfrost-mesa.html" rel="noreferrer" target="_blank">https://panfrost.freedesktop.org/building-panfrost-mesa.html</a><br>
<br>
</blockquote></div>