Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754333AbbFKJ7b (ORCPT ); Thu, 11 Jun 2015 05:59:31 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:53647 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191AbbFKJ7W (ORCPT ); Thu, 11 Jun 2015 05:59:22 -0400 From: Hendrik Brueckner To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Cc: Vince Weaver , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Hendrik Brueckner Subject: [PATCH 1/2] perf: return ENOENT instead of ENOTSUPP Date: Thu, 11 Jun 2015 11:59:04 +0200 Message-Id: <1434016745-17608-1-git-send-email-brueckner@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061109-0013-0000-0000-00000452CBB8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 37 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. Reported-by: Michael Holzheu Signed-off-by: Hendrik Brueckner --- kernel/events/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index eddf1ed..4c66465 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7964,7 +7964,7 @@ SYSCALL_DEFINE5(perf_event_open, if (is_sampling_event(event)) { if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) { - err = -ENOTSUPP; + err = -ENOENT; goto err_alloc; } } -- 1.7.1 -- 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/