From patchwork Wed Jan 13 09:16:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12016213 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 E4B7AC433E0 for ; Wed, 13 Jan 2021 09:17:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65B35233EB for ; Wed, 13 Jan 2021 09:17:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65B35233EB 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 9668E8D002B; Wed, 13 Jan 2021 04:17:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 93DDF8D002A; Wed, 13 Jan 2021 04:17:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DDDA8D002B; Wed, 13 Jan 2021 04:17:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 5D0A68D002A for ; Wed, 13 Jan 2021 04:17:09 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 25CB9181AEF31 for ; Wed, 13 Jan 2021 09:17:09 +0000 (UTC) X-FDA: 77700197778.23.clam29_160be2f2751c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 028EE37604 for ; Wed, 13 Jan 2021 09:17:08 +0000 (UTC) X-HE-Tag: clam29_160be2f2751c X-Filterd-Recvd-Size: 4703 Received: from mail-qv1-f73.google.com (mail-qv1-f73.google.com [209.85.219.73]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 09:17:08 +0000 (UTC) Received: by mail-qv1-f73.google.com with SMTP id cc1so988894qvb.3 for ; Wed, 13 Jan 2021 01:17:08 -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=D/ltpYSY2gXKcSOhoEH+7aMmW9DFoOQBGhBEMDJ4QS9njGGEQ+UgvD50OFm7WCJiX5 yGRfXzWPCiK/OxgUzjueN77kQfLhClaYsYkiLF4d4L8qq/oN4MTL7Bj4whF0lwwdFXGq vOeiKV0hfSHjks3r0uQ9MblnKoAcmMen4f7t4QSzOwJEJyc8damdK2f/AhX4tS06ga4N zJ3WzEbGl/Sgny/4jWxtwrIMobAkEb9bzIn99LBFf1J7S5EyhQJcLBsnf8NA6hJYHUY/ fgeOqaVP7Ahwr3dgE/izElEMBlXWOOSfC8lhgm4M7rpAT3oqaTqSgAcxngL/L3UrLx/3 h3ZA== 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=GFWxavDmIieBSaso8KagiSZlc0ukLsR2tvIkPn12OqZ6IoYRtaIm33VBD683gADyQ4 EZNz3FylAsJEEnQUCB9fS2qqqZsrpnQzNhuTudkVHJGyZymjylKu38tE1kopKo7RJGrc 3Dg4glACZGUcXnCT5vDnm0mOsaV2TE8XAHH203e9f2fJL5cnX4VpHSEryqGw/eVRnGJ+ Q0uRCNVH1QxqS98AXTYd+RYlRrrRpQOzqc5yRlabFkGbgTihqaTUwfjFvXrGEwde2G/I dD2+oTjds4lMOTH7g6RRYcf8qDEDAhuhoBeMl5AxKq8azNV7rWaoMUskTLJoZVBFmRzV tvhA== X-Gm-Message-State: AOAM531m3Hof+Yv4nXo3D3id/HW/UZ1hcaX/tZSU/rkNqevBMFmRWdnD QyC/Vn75ZwlvPRmHEqwaVr0VZmTl9zE= X-Google-Smtp-Source: ABdhPJxGEXOWLz12zW+XK9vcOJrU+ahfdiUUJDRxxYmBlkX4/voTJwUyqsSxNEb1r/QpLIRbF9BTV/M43LM= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:f693:9fff:fef4:9ff]) (user=glider job=sendgmr) by 2002:a05:6214:a14:: with SMTP id dw20mr1243999qvb.43.1610529427925; Wed, 13 Jan 2021 01:17:07 -0800 (PST) Date: Wed, 13 Jan 2021 10:16:56 +0100 In-Reply-To: <20210113091657.1456216-1-glider@google.com> Message-Id: <20210113091657.1456216-4-glider@google.com> Mime-Version: 1.0 References: <20210113091657.1456216-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, linux-kernel@vger.kernel.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();