Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbbHZVFg (ORCPT ); Wed, 26 Aug 2015 17:05:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:48744 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbbHZVFe (ORCPT ); Wed, 26 Aug 2015 17:05:34 -0400 Date: Wed, 26 Aug 2015 18:04:01 -0300 From: Arnaldo Carvalho de Melo To: Andrew Morton Cc: Ingo Molnar , Johannes Berg , Linus Torvalds , Thomas Gleixner , adrian.hunter@intel.com, Ingo Molnar , Borislav Petkov , Vince Weaver , linux-kernel@vger.kernel.org, Peter Zijlstra , Alexander Shishkin , "H. Peter Anvin" , Stephane Eranian Subject: Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting Message-ID: <20150826210401.GC1139@kernel.org> References: <20150825091740.GA23488@gmail.com> <1440495246.2192.13.camel@sipsolutions.net> <20150825100728.GA1820@gmail.com> <1440497981.2192.39.camel@sipsolutions.net> <20150826044948.GC14584@gmail.com> <1440572775.1932.1.camel@sipsolutions.net> <20150826072020.GA19081@gmail.com> <20150826072656.GA19305@gmail.com> <20150826114111.01675d8eadda78d82933d8a5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150826114111.01675d8eadda78d82933d8a5@linux-foundation.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2306 Lines: 55 Em Wed, Aug 26, 2015 at 11:41:11AM -0700, Andrew Morton escreveu: > On Wed, 26 Aug 2015 09:26:56 +0200 Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > > > ... but back then I didn't feel like complicating an error recovery ABI for the > > > needs of the 1%, robust error handling is all about simplicity: if it's not > > > simple, tools won't use it. > > > > And note that it needs to be 'simple' in two places for usage to grow naturally: > > > > - the usage site in the kernel > > - the tooling side that recovers the information. > > > > That's why I think that such a form: > > > > return err_str(-EINVAL, "x86/perf: CPU does not support precise sampling"); > > > > is obviously simple on the kernel side as it returns -EINVAL, and is very simple > > on the tooling side as well, if we are allowed to extend prctl(). > > Is this whole thing overkill? As far as I can see, the problem which is > being addressed only occurs in a couple of places (perf, wifi netlink > handling) and could be addressed with some local pr_debug statements. ie, > > #define err_str(e, s) ({ > if (debugging) > pr_debug("%s:%d: error %d (%s)", __FILE__, __LINE__, e, s); > e; > }) > > (And I suppose that if this is later deemed inadequate, err_str() could > be made more fancy). > > IOW, do we really need some grand kernel-wide infrastructural thing to > adequately address this problem? For perf tooling we already ask the user to look at dmesg sometimes, but that is very ugly and fragile, for instance multiple users ask for some complex combination of features (look at the ones already marked by Alexander), and there are tons of combos possible. Mapping back from -EINVAL or -ENOTSUPP to some sensible message that helps the user to make sense of _what_ is the problem is difficult for developers, let alone for users. I'd say lets try this with perf and leave the rest of the world alone, if the experience proves fruitful, it will be left as an example for others, hopefully a good one :-) - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/