From: "Christian König" <christian.koenig@amd.com>
To: Charan Teja Kalla <quic_charante@quicinc.com>,
gregkh@linuxfoundation.org, sumit.semwal@linaro.org,
hridya@google.com, daniel.vetter@ffwll.ch, tjmercier@google.com
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH V2] dmabuf: ensure unique directory name for dmabuf stats
Date: Tue, 10 May 2022 19:22:14 +0200 [thread overview]
Message-ID: <2a0312d3-d576-b5be-c823-938b38096523@amd.com> (raw)
In-Reply-To: <6dc59fa7-5885-9ed1-54c3-f2d112786312@quicinc.com>
Am 10.05.22 um 19:14 schrieb Charan Teja Kalla:
> On 5/10/2022 8:42 PM, Christian König wrote:
>>> * The information in the interface can also be used to derive
>>> per-exporter
>>> * statistics. The data from the interface can be gathered on error
>>> conditions
>>> @@ -172,6 +172,7 @@ int dma_buf_stats_setup(struct dma_buf *dmabuf)
>>> {
>>> struct dma_buf_sysfs_entry *sysfs_entry;
>>> int ret;
>>> + static atomic64_t unique_id = ATOMIC_INIT(0);
>> Please move that to the beginning of the declarations.
>>
> Done. Any scripts I can run at my end to catch these type of trivial
> changes? checkpatch.pl didn't report this coding style.
Not that I know of. It's also not a hard requirement, I let it mostly
slip in the drivers I maintain. But upstream people sometimes insist on
that, so I want to be clean at least in driver independent frameworks.
>>> if (!dmabuf || !dmabuf->file)
>>> return -EINVAL;
>>> @@ -192,7 +193,8 @@ int dma_buf_stats_setup(struct dma_buf *dmabuf)
>>> /* create the directory for buffer stats */
>>> ret = kobject_init_and_add(&sysfs_entry->kobj, &dma_buf_ktype,
>>> NULL,
>>> - "%lu", file_inode(dmabuf->file)->i_ino);
>>> + "%lu-%lu", file_inode(dmabuf->file)->i_ino,
>> Why not just use the unique value here? Or is the inode number necessary
>> for something?
> This will ease the debugging a lot. Given the dump, I can easily map
> which dmabuf buffer to the process. On the crashutilty I just have to
> search for this inode in the files output, just one example.
T.J. Mercier just confirmed my suspicion that this would break the UAPI.
So that won't work.
This needs to be a single number, preferable documented as such.
Regards,
Christian.
next prev parent reply other threads:[~2022-05-10 17:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 14:06 [PATCH V2] dmabuf: ensure unique directory name for dmabuf stats Charan Teja Kalla
2022-05-10 15:12 ` Christian König
2022-05-10 17:14 ` Charan Teja Kalla
2022-05-10 17:22 ` Christian König [this message]
2022-05-11 6:49 ` Charan Teja Kalla
2022-05-11 7:03 ` Christian König
2022-05-12 14:50 ` Charan Teja Kalla
2022-05-10 17:11 ` T.J. Mercier
2022-05-10 21:55 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a0312d3-d576-b5be-c823-938b38096523@amd.com \
--to=christian.koenig@amd.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=hridya@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=quic_charante@quicinc.com \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox