Message ID | 20200309085806.155823-12-ravi.bangoria@linux.ibm.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | powerpc/watchpoint: Preparation for more than one watchpoint | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch powerpc/merge (ab326587bb5fb91cc97df9b9f48e9e1469f04621) |
snowpatch_ozlabs/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 19 lines checked |
snowpatch_ozlabs/needsstable | success | Patch has no Fixes tags |
Le 09/03/2020 à 09:58, Ravi Bangoria a écrit : > Introduce is_ptrace_bp() function and move the check inside the > function. We will utilize it more in later set of patches. > > Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> > --- > arch/powerpc/kernel/hw_breakpoint.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c > index b27aca623267..0e35ff372d8e 100644 > --- a/arch/powerpc/kernel/hw_breakpoint.c > +++ b/arch/powerpc/kernel/hw_breakpoint.c > @@ -90,6 +90,11 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) > hw_breakpoint_disable(); > } > > +static bool is_ptrace_bp(struct perf_event *bp) > +{ > + return (bp->overflow_handler == ptrace_triggered); You don't need parenthesis here. > +} > + > /* > * Perform cleanup of arch-specific counters during unregistration > * of the perf-event > @@ -324,7 +329,7 @@ int hw_breakpoint_handler(struct die_args *args) > * one-shot mode. The ptrace-ed process will receive the SIGTRAP signal > * generated in do_dabr(). > */ > - if (bp->overflow_handler == ptrace_triggered) { > + if (is_ptrace_bp(bp)) { > perf_bp_event(bp, regs); > rc = NOTIFY_DONE; > goto out; > Christophe
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c index b27aca623267..0e35ff372d8e 100644 --- a/arch/powerpc/kernel/hw_breakpoint.c +++ b/arch/powerpc/kernel/hw_breakpoint.c @@ -90,6 +90,11 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) hw_breakpoint_disable(); } +static bool is_ptrace_bp(struct perf_event *bp) +{ + return (bp->overflow_handler == ptrace_triggered); +} + /* * Perform cleanup of arch-specific counters during unregistration * of the perf-event @@ -324,7 +329,7 @@ int hw_breakpoint_handler(struct die_args *args) * one-shot mode. The ptrace-ed process will receive the SIGTRAP signal * generated in do_dabr(). */ - if (bp->overflow_handler == ptrace_triggered) { + if (is_ptrace_bp(bp)) { perf_bp_event(bp, regs); rc = NOTIFY_DONE; goto out;
Introduce is_ptrace_bp() function and move the check inside the function. We will utilize it more in later set of patches. Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> --- arch/powerpc/kernel/hw_breakpoint.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)