From patchwork Wed Jan 13 09:10:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12016197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DACFAC433DB for ; Wed, 13 Jan 2021 09:10:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 46DAF2339D for ; Wed, 13 Jan 2021 09:10:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46DAF2339D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 699A28D0027; Wed, 13 Jan 2021 04:10:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F9998D0026; Wed, 13 Jan 2021 04:10:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BC9C8D0027; Wed, 13 Jan 2021 04:10:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 2D94A8D0026 for ; Wed, 13 Jan 2021 04:10:31 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id EC668909F for ; Wed, 13 Jan 2021 09:10:30 +0000 (UTC) X-FDA: 77700181020.01.town67_5a03d732751c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id D02BE10052964 for ; Wed, 13 Jan 2021 09:10:30 +0000 (UTC) X-HE-Tag: town67_5a03d732751c X-Filterd-Recvd-Size: 4672 Received: from mail-qk1-f202.google.com (mail-qk1-f202.google.com [209.85.222.202]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 09:10:30 +0000 (UTC) Received: by mail-qk1-f202.google.com with SMTP id a17so814674qko.11 for ; Wed, 13 Jan 2021 01:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=XzfaCNHUB3u0Xi2wro/cbX3HxJgdcymLpFgEMQn1EeM=; b=dwxuuV8tsMJPP/ayurDHyMpV3smUFp5mqWSVEd7w+W8+sA+jQgrXXMwfZ7xfEFh2eo A6tZj/xtGGXIJRXZ+iBvBPbpKuTo2LjZKeGexr/e2n9whVJw68/i+Nu+Zes4A42KpRKn 3MQdAcsPDzxDCZqIuoLNsl7JBkkfCWSzXVS2cDusN9tHaBvM17P1UGwAfj+0gb5Ek/zD vT63f/K9IMtN4DAd90z2K7e5TcOFCz7ROkqmi6QDEM8Dg31x1qP+pgt13dFU1zdY0qJs EwHLMjwVetG7e3rGiTod1PDUlzkmvzY82cv0knoFcvbm30XBqxJMxggBTae0TU4hqwQq HdsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=XzfaCNHUB3u0Xi2wro/cbX3HxJgdcymLpFgEMQn1EeM=; b=EnIiWD45zfRvgF8zBtszN3ujMaukNkR1RK7ckhZpDK7wRL4WfK7jgZ4jnPI8IK7DCQ zx3vAbZYUjJhyyfCMVJpNkZojLLEVurJ5k+A/KIZOZMSo5M303nYC9l66peDI4LcsJI5 WSjgIaT0ADovuvny8cURCCItU7KSz+1mxgCu9V6Ejp1iKE+RJ0k9fRnHuVO0PgRobVcs hEtDxPBcZoBndEwa2b+cdzNhHfZ1fA03hxu/HLaqQUrrt7YhaZx2ruxZmsTCWGMCtmLX 8nIuyC97CJjdFQPN/0Ffbw3ru9XDVaLlXuYo0auiiNLcfiC2wsqLOqkBD7gdHl/60bEd E9ng== X-Gm-Message-State: AOAM532AsTo2UGTToWxVXJo8HUBdHNS2RU7TnpnXamSh4qTkULgmizny dlcDosDwMMuwoYZLg/6Pcaot0Ls/QUY= X-Google-Smtp-Source: ABdhPJwBxOMS+hTjKbZ/FB90VkEquM6cwcF/6oZm8lgnWlBZO8Z7CdRww53Z7HTX51b+VJuSqvjNn/w6Oxo= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:f693:9fff:fef4:9ff]) (user=glider job=sendgmr) by 2002:a0c:e383:: with SMTP id a3mr1390126qvl.45.1610529029679; Wed, 13 Jan 2021 01:10:29 -0800 (PST) Date: Wed, 13 Jan 2021 10:10:16 +0100 In-Reply-To: <20210113091017.1444780-1-glider@google.com> Message-Id: <20210113091017.1444780-4-glider@google.com> Mime-Version: 1.0 References: <20210113091017.1444780-1-glider@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH 3/4] kfence: use error_report_start and error_report_end tracepoints From: Alexander Potapenko To: akpm@linux-foundation.org Cc: Alexander Potapenko , Marco Elver , Andrey Konovalov , Dmitry Vyukov , Ingo Molnar , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , linux-mm@kvack.org X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Make it possible to trace KFENCE error reporting (in particular, for compatibility with CONFIG_ERROR_REPORT_NOTIFY). Suggested-by: Marco Elver Cc: Andrew Morton Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Ingo Molnar Cc: Marco Elver Cc: Petr Mladek Cc: Steven Rostedt Cc: Sergey Senozhatsky Cc: linux-mm@kvack.org Signed-off-by: Alexander Potapenko --- 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 #include #include +#include #include @@ -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();