[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bc165886-3939-a5e5-b905-23f9a2f3e0f8@linux.microsoft.com>
Date: Wed, 27 Oct 2021 11:15:22 -0500
From: "Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>
To: Mark Rutland <mark.rutland@....com>
Cc: broonie@...nel.org, jpoimboe@...hat.com, ardb@...nel.org,
nobuta.keiya@...itsu.com, sjitindarsingh@...il.com,
catalin.marinas@....com, will@...nel.org, jmorris@...ei.org,
linux-arm-kernel@...ts.infradead.org,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 06/11] arm64: Make profile_pc() use arch_stack_walk()
On 10/27/21 8:32 AM, Mark Rutland wrote:
> On Thu, Oct 14, 2021 at 09:58:42PM -0500, madvenka@...ux.microsoft.com wrote:
>> From: "Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>
>>
>> Currently, profile_pc() in ARM64 code walks the stack using
>> start_backtrace() and unwind_frame(). Make it use arch_stack_walk()
>> instead. This makes maintenance easier.
>>
>> Signed-off-by: Madhavan T. Venkataraman <madvenka@...ux.microsoft.com>
>> ---
>> arch/arm64/kernel/time.c | 22 +++++++++++++---------
>> 1 file changed, 13 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c
>> index eebbc8d7123e..671b3038a772 100644
>> --- a/arch/arm64/kernel/time.c
>> +++ b/arch/arm64/kernel/time.c
>> @@ -32,22 +32,26 @@
>> #include <asm/stacktrace.h>
>> #include <asm/paravirt.h>
>>
>> +static bool profile_pc_cb(void *arg, unsigned long pc)
>> +{
>> + unsigned long *prof_pc = arg;
>> +
>> + if (in_lock_functions(pc))
>> + return true;
>> + *prof_pc = pc;
>> + return false;
>> +}
>> +
>> unsigned long profile_pc(struct pt_regs *regs)
>> {
>> - struct stackframe frame;
>> + unsigned long prof_pc = 0;
>>
>> if (!in_lock_functions(regs->pc))
>> return regs->pc;
>
> This can go -- the first call to profile_pc_cb() will use regs->pc.
>
Agreed.
> With that gone, and the include updates to use <linux/stacktrace.h>:
>
> Reviewed-by: Mark Rutland <mark.rutland@....com>
>
I will make the two changes.
Madhavan
Powered by blists - more mailing lists