From: Alexander Potapenko <glider@google.com>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: andreyknvl@google.com, dvyukov@google.com, mingo@redhat.com,
elver@google.com, pmladek@suse.com, rostedt@goodmis.org,
sergey.senozhatsky@gmail.com, glider@google.com,
linux-mm@kvack.org
Subject: [PATCH v2 4/5] kfence: use error_report_start and error_report_end tracepoints
Date: Fri, 15 Jan 2021 14:03:35 +0100 [thread overview]
Message-ID: <20210115130336.2520663-5-glider@google.com> (raw)
In-Reply-To: <20210115130336.2520663-1-glider@google.com>
Make it possible to trace KFENCE error reporting (in particular, for
compatibility with CONFIG_ERROR_REPORT_NOTIFY).
Suggested-by: Marco Elver <elver@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Marco Elver <elver@google.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: linux-mm@kvack.org
Signed-off-by: Alexander Potapenko <glider@google.com>
---
v2:
- change error_report_start and error_report_end prototypes
to accept enum error_detector instead of char*
(as suggested by Steven Rostedt)
---
mm/kfence/report.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/kfence/report.c b/mm/kfence/report.c
index 4dedc2ff8f28..bbe7dad5f249 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(ERROR_DETECTOR_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(ERROR_DETECTOR_KFENCE, address);
pr_err("==================================================================\n");
lockdep_on();
--
2.30.0.284.gd98b1dd5eaa7-goog
next prev parent reply other threads:[~2021-01-15 13:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 13:03 [PATCH v2 0/5] Add sysfs interface to collect reports from debugging tools Alexander Potapenko
2021-01-15 13:03 ` [PATCH v2 1/5] tracing: add error_report trace points Alexander Potapenko
2021-01-15 13:03 ` [PATCH v2 2/5] lib: add error_report_notify to collect debugging tools' reports Alexander Potapenko
2021-01-15 13:50 ` Greg KH
2021-01-15 17:17 ` Alexander Potapenko
2021-01-18 11:38 ` Petr Mladek
2021-01-18 13:08 ` Alexander Potapenko
2021-01-18 13:14 ` Alexander Potapenko
2021-01-18 16:43 ` Petr Mladek
2021-01-21 13:13 ` Alexander Potapenko
2021-01-15 13:03 ` [PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation Alexander Potapenko
2021-01-15 13:45 ` Greg KH
2021-01-15 15:26 ` Alexander Potapenko
2021-01-15 15:45 ` Greg KH
2021-01-15 16:52 ` Steven Rostedt
2021-01-18 10:22 ` Alexander Potapenko
2021-01-18 14:52 ` Steven Rostedt
2021-01-15 13:03 ` Alexander Potapenko [this message]
2021-01-15 13:03 ` [PATCH v2 5/5] kasan: use error_report_start and error_report_end tracepoints Alexander Potapenko
2021-01-15 13:06 ` [PATCH v2 0/5] Add sysfs interface to collect reports from debugging tools Vlastimil Babka
2021-01-15 13:09 ` Alexander Potapenko
2021-01-21 12:56 ` Alexander Potapenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210115130336.2520663-5-glider@google.com \
--to=glider@google.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).