Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1163120

Re: [PATCH 1/2] perf: return ENOENT instead of ENOTSUPP

Path csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Peter Zijlstra <a.p.zijlstra@chello.nl>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] perf: return ENOENT instead of ENOTSUPP
Date Thu, 11 Jun 2015 12:30:01 +0200
Message-ID <pA7Ud-2Pi-5@gated-at.bofh.it> (permalink)
References <pA7rc-1YG-7@gated-at.bofh.it>
X-Original-To Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7BIT
X-Mailer Evolution 3.10.4-0ubuntu2
MIME-Version 1.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Vince Weaver <vincent.weaver@maine.edu>, Paul Mackerras <paulus@samba.org>, Martin Schwidefsky <schwidefsky@de.ibm.com>, Heiko Carstens <heiko.carstens@de.ibm.com>, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
X-Original-Date Thu, 11 Jun 2015 12:25:01 +0200
X-Original-Message-ID <1434018301.1495.73.camel@twins>
X-Original-References <1434016745-17608-1-git-send-email-brueckner@linux.vnet.ibm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1163120

Show key headers only | View raw


On Thu, 2015-06-11 at 11:59 +0200, Hendrik Brueckner wrote:
> The ENOTSUPP (which actually should be EOPNOTSUPP for user space) does not
> trigger a fallback event selection, for example, by perf record.
> If hardware support for the cycles perf event is available, but the hardware
> does not provide interrupts, returning ENOTSUPP causes perf to end.  Returning
> ENOENT causes the perf tool to fallback to a software-based cycle PMU that
> supports interrupts.
> 
> The commit 53b25335dd ("perf: Disable sampled events if no PMU interrupt")
> introduced that incompatible change.

That's 3.16

>  		if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) {
> -			err = -ENOTSUPP;
> +			err = -ENOENT;
>  			goto err_alloc;
>  		}
>  	}

And now you would be changing an API that's been around for at least 4
releases.

Also, I really think -ENOENT is the wrong return here, you're asking for
things that's not supported, not for something that's not there.
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] perf: return ENOENT instead of ENOTSUPP Hendrik Brueckner <brueckner@linux.vnet.ibm.com> - 2015-06-11 12:00 +0200
  [PATCH 2/2] perf: correct event accounting imbalance on error path Hendrik Brueckner <brueckner@linux.vnet.ibm.com> - 2015-06-11 12:00 +0200
  Re: [PATCH 1/2] perf: return ENOENT instead of ENOTSUPP Peter Zijlstra <a.p.zijlstra@chello.nl> - 2015-06-11 12:30 +0200

csiph-web