Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbdFTM0H (ORCPT ); Tue, 20 Jun 2017 08:26:07 -0400 Received: from mga14.intel.com ([192.55.52.115]:27181 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751025AbdFTM0G (ORCPT ); Tue, 20 Jun 2017 08:26:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="1184766753" From: Alexander Shishkin To: Hendrik Brueckner , peterz@infradead.org, mingo@redhat.com, acme@kernel.org Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Pu Hou , Thomas-Mich Richter Subject: Re: [PATCH] kernel/perf: correct return code of rb_alloc_aux() if !has_aux(ev) In-Reply-To: <1497954399-6355-1-git-send-email-brueckner@linux.vnet.ibm.com> References: <1497954399-6355-1-git-send-email-brueckner@linux.vnet.ibm.com> User-Agent: Notmuch/0.23.7 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 20 Jun 2017 15:26:03 +0300 Message-ID: <877f06zvz8.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 925 Lines: 29 Hendrik Brueckner writes: > If the event for which an AUX area is about to be allocated, does > not support setting up an AUX area, rb_alloc_aux() return -ENOTSUPP. > > This error condition is being returned unfiltered to the user space, > and, for example, the perf tools fails with: > > failed to mmap with 524 (INTERNAL ERROR: strerror_r(524, 0x3fff497a1c8, 512)=22) > > This error can be easily seen with "perf record -m 128,256 -e cpu-clock". > > The 524 error code maps to -ENOTSUPP (in rb_alloc_aux()). The -ENOTSUPP > error code shall be only used within the kernel. So the correct error > code would then be -EOPNOTSUPP. > > With this commit, the perf tool then reports: > > failed to mmap with 95 (Operation not supported) > > which is more clear. Acked-by: Alexander Shishkin Curious as to why does the tool allow this. Regards, -- Alex