From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751355AbdH3XbC (ORCPT ); Wed, 30 Aug 2017 19:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:45818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbdH3XbA (ORCPT ); Wed, 30 Aug 2017 19:31:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1EDF21A94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Wed, 30 Aug 2017 19:30:58 -0400 From: Steven Rostedt To: mark gross Cc: Borislav Petkov , Tony Luck , linux-edac , Yazen Ghannam , X86 ML , LKML , Mauro Carvalho Chehab Subject: Re: [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint Message-ID: <20170830193058.00740c87@gandalf.local.home> In-Reply-To: <20170830214719.GC103314@mtgdev> References: <20170825102411.8682-1-bp@alien8.de> <20170828134549.wh6toneoca47ff2w@pd.tnic> <20170830114843.deetnlz2wjbgbaj4@pd.tnic> <20170830214719.GC103314@mtgdev> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Aug 2017 14:47:19 -0700 mark gross wrote: > > struct dentry *ras_debugfs_dir; > > > > static atomic_t trace_count = ATOMIC_INIT(0); > > @@ -12,7 +14,9 @@ EXPORT_SYMBOL_GPL(ras_userspace_consumers); > > > > static int trace_show(struct seq_file *m, void *v) > > { > > - return atomic_read(&trace_count); > > + seq_printf(m, "readers:%d\n", atomic_read(&trace_count)); > > + seq_printf(m, "has decoder:%d\n", mca_cfg.has_decoder); > > do you want to worry about this debugfs interfaces as ABI? It's the old, if a tree falls in the forest issue. If you break the ABI but nobody is around to notice, did it really break? > debugfs changes have bitten me on one specific OS in irritating ways. > > I'm not sure what the word is for debugfs interfaces as ABI these days so this > feedback may be not so useful. I discussed this with Boris before he sent it out. The current code is actually broken. The trace_show() looks to be just a stub for a hack to have userspace tell the kernel it's reading something (the trace_count). The trace_show() function here returns the trace_count, which is just wrong. The seq_file show function is suppose to return less than zero on error, zero on success, or greater than zero if the show is suppose to skip the current field but not error out. This trace_show() function doesn't actually show anything. If you cat the file, it will be blank. Returning zero or greater than zero has the same effect. Which is nothing. -- Steve