[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <299bf5b6-a293-aa59-b27a-04b00ef7ea2c@linux.ibm.com>
Date: Wed, 1 Apr 2020 14:49:48 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
To: Christophe Leroy <christophe.leroy@....fr>
Cc: mpe@...erman.id.au, mikey@...ling.org, apopple@...ux.ibm.com,
paulus@...ba.org, npiggin@...il.com,
naveen.n.rao@...ux.vnet.ibm.com, peterz@...radead.org,
jolsa@...nel.org, oleg@...hat.com, fweisbec@...il.com,
mingo@...nel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org,
Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Subject: Re: [PATCH v2 07/16] powerpc/watchpoint: Get watchpoint count
dynamically while disabling them
On 4/1/20 12:02 PM, Christophe Leroy wrote:
>
>
> Le 01/04/2020 à 08:13, Ravi Bangoria a écrit :
>> Instead of disabling only one watchpoint, get num of available
>> watchpoints dynamically and disable all of them.
>>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
>> ---
>> arch/powerpc/include/asm/hw_breakpoint.h | 15 +++++++--------
>> 1 file changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
>> index 4e4976c3248b..fae33c729ba9 100644
>> --- a/arch/powerpc/include/asm/hw_breakpoint.h
>> +++ b/arch/powerpc/include/asm/hw_breakpoint.h
>> @@ -78,14 +78,13 @@ extern void ptrace_triggered(struct perf_event *bp,
>> struct perf_sample_data *data, struct pt_regs *regs);
>> static inline void hw_breakpoint_disable(void)
>> {
>> - struct arch_hw_breakpoint brk;
>> -
>> - brk.address = 0;
>> - brk.type = 0;
>> - brk.len = 0;
>> - brk.hw_len = 0;
>> - if (ppc_breakpoint_available())
>> - __set_breakpoint(&brk, 0);
>> + int i;
>> + struct arch_hw_breakpoint null_brk = {0};
>
> Those declaration should be in the block unsigned them below.
>
>> +
>> + if (ppc_breakpoint_available()) {
>> + for (i = 0; i < nr_wp_slots(); i++)
>> + __set_breakpoint(&null_brk, i);
>> + }
>
> I would have had a preference to the following, but that's detail I guess:
>
> int i;
> struct arch_hw_breakpoint null_brk = {0};
>
> if (!ppc_breakpoint_available())
> return;
>
> for (i = 0; i < nr_wp_slots(); i++)
> __set_breakpoint(&null_brk, i);
This looks more better. Will change it.
Ravi
Powered by blists - more mailing lists