From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 0A680C433DB for ; Thu, 14 Jan 2021 07:50:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6D982239EB for ; Thu, 14 Jan 2021 07:50:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D982239EB 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 4D71E8D00C2; Thu, 14 Jan 2021 02:50:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 486A88D008E; Thu, 14 Jan 2021 02:50:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39CED8D00C2; Thu, 14 Jan 2021 02:50:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id 24FE08D008E for ; Thu, 14 Jan 2021 02:50:11 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E3079181AEF32 for ; Thu, 14 Jan 2021 07:50:10 +0000 (UTC) X-FDA: 77703607380.13.waves62_0e1139627525 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id C3E8F18140B67 for ; Thu, 14 Jan 2021 07:50:10 +0000 (UTC) X-HE-Tag: waves62_0e1139627525 X-Filterd-Recvd-Size: 4449 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 Jan 2021 07:50:10 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id p14so6242822qke.6 for ; Wed, 13 Jan 2021 23:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=37Fv/F4r2vxPobSCHkPJCrrTkh1JQZ6SNQNtiN3ae9E=; b=cPvhtX+rvG2F+gwNH7qLyN19RmrVL56YWFyZGdcO/1X1aEOpCupPPWvgLaqfPV24Jt LU8aIWl+/ebetyfJtLdKOZRbDjCw/H/FpG0jlsfrJocG9XxQCro5h30bI/s2+MuxJalM Yhi0R3K8FAAjXsHcXE3Drhgv4FlGY7CTzcYEWCSie9t5lbCb58/0KPpo1pZLTmjI15Ol yN6fjIsyphPwr5jyhKcacrX0VEREyO7K1XDC3tKRFrRmI/PDinUX7BE0nD3GhSMdk+Lm kstDdNjGd8UBnMNRIk0DdzHIjGfO/lQqtYw5NAQLKTO4AERRmuRR8HYhyg8sf4kpIyYu Na8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=37Fv/F4r2vxPobSCHkPJCrrTkh1JQZ6SNQNtiN3ae9E=; b=dYmO2oyjxVlPL7E5sdF0ysBlY38PBqWUMIvcd1TMc1Di96f1qE+Rd7mlYE5MujpIti 52VMVGqOKw77Y9j0SfSs720w150ZhF7VR6T5vQrur/lYjO018gg5SKqkYwkLgdiSaRbc lzeTgdVrn3SqR2XZlcOmi4XqiI64ZxINWQicHzk8aNlsiJuV52/L9XviwyvGwyVzEW+n KeI8Q2x9bQMGEyDDBjf3nEhVTgHCCkpscZeIzLwW3toNkaMNlEDDwTSvfGIYNVPkpB9a GMEJQ4U4cYClXCQx75vjet0q0cILViOViGY3a4x8cka06rO3G1K9ah3t1DoJb2tOMDo4 TmJw== X-Gm-Message-State: AOAM533S4yUgXdqDj4dI9bKE4PA/K/TrP3jOGHjz769VAMJZ2sO/DIrU 62TzvqtpH1DhsYamVYDwkcFDzMK3eTUpOfx9w7f2SA== X-Google-Smtp-Source: ABdhPJyKGqkbBrW77m4ChzF2oBS1Qu234IeKUVlYT7Vbhz0/brzPUCnuoEIXN/Lg/cO6zsK9eYdV0jEA/KJwK2yroyM= X-Received: by 2002:a05:620a:1372:: with SMTP id d18mr5932329qkl.6.1610610609518; Wed, 13 Jan 2021 23:50:09 -0800 (PST) MIME-Version: 1.0 References: <20210113091657.1456216-1-glider@google.com> <20210113091657.1456216-2-glider@google.com> <20210113161044.43bc1c1a@gandalf.local.home> In-Reply-To: <20210113161044.43bc1c1a@gandalf.local.home> From: Alexander Potapenko Date: Thu, 14 Jan 2021 08:49:57 +0100 Message-ID: Subject: Re: [PATCH 1/4] tracing: add error_report trace points To: Steven Rostedt Cc: Andrew Morton , LKML , Marco Elver , Andrey Konovalov , Dmitry Vyukov , Ingo Molnar , Petr Mladek , Sergey Senozhatsky , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" 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: On Wed, Jan 13, 2021 at 10:10 PM Steven Rostedt wrote: > > On Wed, 13 Jan 2021 10:16:54 +0100 > Alexander Potapenko wrote: > > > +DECLARE_EVENT_CLASS(error_report_template, > > + TP_PROTO(const char *error_detector, unsigned long id), > > Instead of having a random string, as this should be used by a small finite > set of subsystems, why not make the above into an enum? You're probably right. I just thought it might be a good idea to minimize the effort needed from tools' authors to add these tracepoints to the tools (see the following two patches), and leave room for some extensibility (e.g. passing bug type together with the tool name etc.) > > + TP_ARGS(error_detector, id), > > + TP_STRUCT__entry(__field(const char *, error_detector) > > + __field(unsigned long, id)), > > + TP_fast_assign(__entry->error_detector = error_detector; > > + __entry->id = id;), > > + TP_printk("[%s] %lx", __entry->error_detector, > > Then the [%s] portion of this could also be just a __print_symbolic(). We'll need to explicitly list the enum values once again in __print_symbolic(), right? E.g.: enum debugging_tool { TOOL_KFENCE, TOOL_KASAN, ... } TP_printk(__print_symbolic(__entry->error_detector, TOOL_KFENCE, TOOL_KASAN, ...),