[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e0cebc4-0ee3-c316-01b3-5131298d70ce@quicinc.com>
Date: Mon, 21 Nov 2022 21:23:38 +0530
From: Sai Prakash Ranjan <quic_saipraka@...cinc.com>
To: Steven Rostedt <rostedt@...dmis.org>, Arnd Bergmann <arnd@...db.de>
CC: Masami Hiramatsu <mhiramat@...nel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<linux-arch@...r.kernel.org>, <quic_satyap@...cinc.com>
Subject: Re: [PATCH] asm-generic/io: Add _RET_IP_ to MMIO trace for more
accurate debug info
Hi Arnd,
On 10/26/2022 7:17 PM, Sai Prakash Ranjan wrote:
> Hi Steve,
>
> On 10/24/2022 9:39 PM, Steven Rostedt wrote:
>> On Mon, 17 Oct 2022 20:04:50 +0530
>> Sai Prakash Ranjan <quic_saipraka@...cinc.com> wrote:
>>
>>> Due to compiler optimizations like inlining, there are cases where
>>> MMIO traces using _THIS_IP_ for caller information might not be
>>> sufficient to provide accurate debug traces.
>>>
>>> 1) With optimizations (Seen with GCC):
>>>
>>> In this case, _THIS_IP_ works fine and prints the caller information
>>> since it will be inlined into the caller and we get the debug traces
>>> on who made the MMIO access, for ex:
>>>
>>> rwmmio_read: qcom_smmu_tlb_sync+0xe0/0x1b0 width=32
>>> addr=0xffff8000087447f4
>>> rwmmio_post_read: qcom_smmu_tlb_sync+0xe0/0x1b0 width=32 val=0x0
>>> addr=0xffff8000087447f4
>>>
>>> 2) Without optimizations (Seen with Clang):
>>>
>>> _THIS_IP_ will not be sufficient in this case as it will print only
>>> the MMIO accessors itself which is of not much use since it is not
>>> inlined as below for example:
>>>
>>> rwmmio_read: readl+0x4/0x80 width=32 addr=0xffff8000087447f4
>>> rwmmio_post_read: readl+0x48/0x80 width=32 val=0x4
>>> addr=0xffff8000087447f4
>>>
>>> So in order to handle this second case as well irrespective of the
>>> compiler
>>> optimizations, add _RET_IP_ to MMIO trace to make it provide more
>>> accurate
>>> debug information in all these scenarios.
>>>
>>> Before:
>>>
>>> rwmmio_read: readl+0x4/0x80 width=32 addr=0xffff8000087447f4
>>> rwmmio_post_read: readl+0x48/0x80 width=32 val=0x4
>>> addr=0xffff8000087447f4
>>>
>>> After:
>>>
>>> rwmmio_read: qcom_smmu_tlb_sync+0xe0/0x1b0 -> readl+0x4/0x80 width=32
>>> addr=0xffff8000087447f4
>>> rwmmio_post_read: qcom_smmu_tlb_sync+0xe0/0x1b0 -> readl+0x4/0x80
>>> width=32 val=0x0 addr=0xffff8000087447f4
>>>
>>> Fixes: 210031971cdd ("asm-generic/io: Add logging support for MMIO
>>> accessors")
>>> Signed-off-by: Sai Prakash Ranjan <quic_saipraka@...cinc.com>
>>
>>
>> Acked-by: Steven Rostedt (Google) <rostedt@...dmis.org>
>>
>> What tree should this go through?
>>
>> -- Steve
>
>
> Thanks for the ack, with this I believe Arnd can take it through his
> tree like last time.
>
Can we take this patch atleast for 6.2-rc1?
Thanks,
Sai
Powered by blists - more mailing lists