Make it possible to trace KFENCE error reporting (in particular, for
compatibility with CONFIG_ERROR_REPORT_NOTIFY).

Suggested-by: Marco Elver <el...@google.com>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Andrey Konovalov <andreyk...@gmail.com>
Cc: Dmitry Vyukov <dvyu...@google.com>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Marco Elver <el...@google.com>
Cc: Petr Mladek <pmla...@suse.com>
Cc: Steven Rostedt <rost...@goodmis.org>
Cc: Sergey Senozhatsky <sergey.senozhat...@gmail.com>
Cc: linux...@kvack.org
Signed-off-by: Alexander Potapenko <gli...@google.com>
---
 mm/kfence/report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/kfence/report.c b/mm/kfence/report.c
index 4dedc2ff8f28..5c063b5b2227 100644
--- a/mm/kfence/report.c
+++ b/mm/kfence/report.c
@@ -9,6 +9,7 @@
 #include <linux/seq_file.h>
 #include <linux/stacktrace.h>
 #include <linux/string.h>
+#include <trace/events/error_report.h>
 
 #include <asm/kfence.h>
 
@@ -184,6 +185,7 @@ void kfence_report_error(unsigned long address, struct 
pt_regs *regs,
        lockdep_off();
 
        
pr_err("==================================================================\n");
+       trace_error_report_start("kfence", address);
        /* Print report header. */
        switch (type) {
        case KFENCE_ERROR_OOB: {
@@ -232,6 +234,7 @@ void kfence_report_error(unsigned long address, struct 
pt_regs *regs,
                show_regs(regs);
        else
                dump_stack_print_info(KERN_ERR);
+       trace_error_report_end("kfence", address);
        
pr_err("==================================================================\n");
 
        lockdep_on();
-- 
2.30.0.284.gd98b1dd5eaa7-goog

Reply via email to