ARM: hw_breakpoint: Do not directly check the event's overflow_handler hook
Subsystems (2)
PATCH 1/1 ARM: hw_breakpoint: Do not directly check the event's overflow_handler hook
The commit 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()") set a default event->overflow_handler in perf_event_alloc(), and replace the check event->overflow_handler with is_default_overflow_handler(), but one is missing.
Currently, the bp->overflow_handler can not be NULL. As a result, enable_single_step() is always not invoked.
--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/hw_breakpoint.c +1 -1
@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }
Signature · 8 lines
1.8.3 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · Zhen Lei
The commit
1879445dfa7b("perf/core: Set event's default ::overflow_handler()") set a defaultevent->overflow_handlerinperf_event_alloc(), and replace the checkevent->overflow_handlerwithis_default_overflow_handler(), but one is missing.Currently, the
bp->overflow_handlercan not be NULL. As a result,enable_single_step()is always not invoked.
Our test case use "perf record -e mem:$TEST_LOC_ADDR:x -p $TEST_PID sleep 10" to track the invocation of a test function, the entry address of the function is $TEST_LOC_ADDR. This function was called only once. Therefore, the sampling result of perf should be one, as follow:
[ perf record: Captured and wrote 0.001 MB perf.data (1 samples) ]
But it's actually infinite.
[ perf record: Captured and wrote 135.426 MB perf.data (2068004 samples) ]
If sleep 10 is not specified, OOM will be reported.
Quoted 14 lines
Fixes 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()")Signed-off-by Zhen Lei <[email protected]>Cc Wang Nan <[email protected]>--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/kernel/hw_breakpoint.c +0
-0
arch/arm/kernel/hw_breakpoint.c static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) · line 892
Quoted 8 lines
arch/arm/kernel/hw_breakpoint.c +1
-1@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 20 lines · Zhen Lei
The commit
1879445dfa7b("perf/core: Set event's default ::overflow_handler()") set a defaultevent->overflow_handlerinperf_event_alloc(), and replace the checkevent->overflow_handlerwithis_default_overflow_handler(), but one is missing.Currently, the
bp->overflow_handlercan not be NULL. As a result,enable_single_step()is always not invoked.Fixes 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()")Signed-off-by Zhen Lei <[email protected]>Cc Wang Nan <[email protected]>--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/kernel/hw_breakpoint.c +0
-0
arch/arm/kernel/hw_breakpoint.c static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) · line 892
Quoted 8 lines
arch/arm/kernel/hw_breakpoint.c +1
-1@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }
Please can you put this into the patch tracker?
https://www.arm.linux.org.uk/developer/patches/
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 32 lines · Will Deacon
Quoted 20 lines · Zhen Lei
The commit
1879445dfa7b("perf/core: Set event's default ::overflow_handler()") set a defaultevent->overflow_handlerinperf_event_alloc(), and replace the checkevent->overflow_handlerwithis_default_overflow_handler(), but one is missing.Currently, the
bp->overflow_handlercan not be NULL. As a result,enable_single_step()is always not invoked.Fixes 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()")Signed-off-by Zhen Lei <[email protected]>Cc Wang Nan <[email protected]>--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/kernel/hw_breakpoint.c +0
-0arch/arm/kernel/hw_breakpoint.c static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) · line 892
Quoted 8 lines
arch/arm/kernel/hw_breakpoint.c +1
-1@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }Acked-by Will Deacon <[email protected]>
Quoted 3 lines
Please can you put this into the patch tracker?
I've added it.
https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9064/1
Quoted 5 lines
Will
.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Will Deacon
maintainerQuoted 35 lines · Leizhen (ThunderTown)
Quoted 32 lines · Will Deacon
Quoted 20 lines · Zhen Lei
The commit
1879445dfa7b("perf/core: Set event's default ::overflow_handler()") set a defaultevent->overflow_handlerinperf_event_alloc(), and replace the checkevent->overflow_handlerwithis_default_overflow_handler(), but one is missing.Currently, the
bp->overflow_handlercan not be NULL. As a result,enable_single_step()is always not invoked.Fixes 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()")Signed-off-by Zhen Lei <[email protected]>Cc Wang Nan <[email protected]>--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/kernel/hw_breakpoint.c +0
-0arch/arm/kernel/hw_breakpoint.c static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) · line 892
Quoted 8 lines
arch/arm/kernel/hw_breakpoint.c +1
-1@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }Acked-by Will Deacon <[email protected]>
Quoted 7 lines
Quoted 3 lines
Please can you put this into the patch tracker?
I've added it.
https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9064/1
Thanks, although you forgot to add my Ack!
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 38 lines · Will Deacon
Quoted 37 lines · Leizhen (ThunderTown)
Quoted 34 lines · Will Deacon
Quoted 20 lines · Zhen Lei
The commit
1879445dfa7b("perf/core: Set event's default ::overflow_handler()") set a defaultevent->overflow_handlerinperf_event_alloc(), and replace the checkevent->overflow_handlerwithis_default_overflow_handler(), but one is missing.Currently, the
bp->overflow_handlercan not be NULL. As a result,enable_single_step()is always not invoked.Fixes 1879445dfa7b ("perf/core: Set event's default ::overflow_handler()")Signed-off-by Zhen Lei <[email protected]>Cc Wang Nan <[email protected]>--- arch/arm/kernel/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/kernel/hw_breakpoint.c +0
-0arch/arm/kernel/hw_breakpoint.c static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) · line 892
Quoted 8 lines
arch/arm/kernel/hw_breakpoint.c +1
-1@@ -886,7 +886,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) info->trigger = addr;pr_debug ("breakpoint fired: address = 0x%x\n" , addr);perf_bp_event (bp, regs); -if (!bp->overflow_handler) +if (is_default_overflow_handler (bp))enable_single_step (bp, addr); goto unlock; }Acked-by Will Deacon <[email protected]>Please can you put this into the patch tracker?
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
I've added it.
https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9064/1
Thanks, although you forgot to add my Ack!
Sorry, the first time I operated this web, the patch in the attachment can no longer be updated. I just mentioned it in the new "Node".
Quoted 5 lines
Will
.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel