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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 549A0C433DB for ; Fri, 15 Jan 2021 13:45:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E81492339E for ; Fri, 15 Jan 2021 13:45:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E81492339E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4610A8D0179; Fri, 15 Jan 2021 08:45:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 411318D0162; Fri, 15 Jan 2021 08:45:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D9B08D0179; Fri, 15 Jan 2021 08:45:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 170388D0162 for ; Fri, 15 Jan 2021 08:45:57 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CF696181AF5C2 for ; Fri, 15 Jan 2021 13:45:56 +0000 (UTC) X-FDA: 77708132712.01.fowl36_511796b2752f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id B10CF1005286F for ; Fri, 15 Jan 2021 13:45:56 +0000 (UTC) X-HE-Tag: fowl36_511796b2752f X-Filterd-Recvd-Size: 4482 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 13:45:56 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8CBF423370; Fri, 15 Jan 2021 13:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610718355; bh=ZdRtthMW7ijR/zuyWuxPrJJBCybYnyfzAS3LSCbVKdQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kZWz4240R3FrkR2Dv1555wL1sF+vbcrKAEIQcxaqTRMNrNnCrKEGg8jsg74cxl3BC XOGh0S9dRHp0Bc+gMLMgzVVKT9TvNCTeozO6m7Oi/+EEFmgFCFSdXxrDNhicJz+CN2 uL8Cl1ea7keO34K3DagW7/Gf/pye0BoFHvZ0L3VQ= Date: Fri, 15 Jan 2021 14:45:52 +0100 From: Greg KH To: Alexander Potapenko Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, andreyknvl@google.com, dvyukov@google.com, mingo@redhat.com, elver@google.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux-mm@kvack.org Subject: Re: [PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation Message-ID: References: <20210115130336.2520663-1-glider@google.com> <20210115130336.2520663-4-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210115130336.2520663-4-glider@google.com> 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 Fri, Jan 15, 2021 at 02:03:34PM +0100, Alexander Potapenko wrote: > Add ABI documentation for files in /sys/kernel/error_report/ > > Requested-by: Andrew Morton > 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 > --- > .../ABI/testing/sysfs-kernel-error_report | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100644 Documentation/ABI/testing/sysfs-kernel-error_report > > diff --git a/Documentation/ABI/testing/sysfs-kernel-error_report b/Documentation/ABI/testing/sysfs-kernel-error_report > new file mode 100644 > index 000000000000..666d039f93a9 > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-kernel-error_report > @@ -0,0 +1,41 @@ > +What: /sys/kernel/error_report/ > +Date: January 2021 > +Contact: Alexander Potapenko , > + Marco Elver > +Description: > + /sys/kernel/error_report/ contains two files: "report_count" > + and "last_report". These files are used to notify userspace > + about error reports from the enrolled kernel subsystems (those > + that use error_report_start/error_report_end tracepoints). > + > + "report_count" contains the current number of reported errors. > + This number is incremented every time the error_report_end > + trace event occurs in the kernel. > + > + "last_report" contains the most recent error report; concurrent > + report generation results in collection of any one report > + ("last_report" may not be the last shown on the console). > + A "report" is everything the task had printed to the console > + between issuing the error_report_start and error_report_end > + trace events. > + > + Due to sysfs limitations, the report size is truncated at > + PAGE_SIZE. To save space, the leading info in square brackets > + printed by CONFIG_PRINTK_TIME and CONFIG_PRINTK_CALLER is > + trimmed from the output lines. > + > + Both files use sysfs_notify() to notify userspace about > + changes. Userspace programs can use poll() to block until an > + error is reported: > + > + pfd.fd = fd; > + pfd.events = POLLPRI; > + while (1) { > + lseek(pfd.fd, 0, SEEK_SET); > + poll(&pfd, 1, -1); > + read(pfd.fd, buffer, PAGE_SIZE); > + /* Process the report in @buffer. */ > + } > + > + Files in /sys/kernel/error_report/ are available when > + CONFIG_ERROR_REPORT_NOTIFY is enabled. sysfs is "one value per file", please put something like this in tracefs, as there is no such rules there. Or debugfs, but please, not sysfs. Also, any reason you didn't cc: the sysfs maintainers? thanks, greg k-h