From: Andre Przywara Subject: [PATCH kvmtool 5/6] arm: pmu: Improve PMU error reporting Date: Fri, 25 Jan 2019 18:08:00 +0000 Message-ID: <20190125180801.209910-6-andre.przywara@arm.com> References: <20190125180801.209910-1-andre.przywara@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org To: Will Deacon Return-path: In-Reply-To: <20190125180801.209910-1-andre.przywara@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org The KVM ioctls mostly just return -1 in the error case, leaving the actual error code in errno. Change the output of the PMU error message to actually print this error code instead of the generic -1. Signed-off-by: Andre Przywara --- arm/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm/pmu.c b/arm/pmu.c index 69c37fae..ffd152e2 100644 --- a/arm/pmu.c +++ b/arm/pmu.c @@ -18,7 +18,7 @@ static int set_pmu_attr(struct kvm *kvm, int vcpu_idx, if (!ret) { ret = ioctl(fd, KVM_SET_DEVICE_ATTR, attr); if (ret) - pr_err("PMU KVM_SET_DEVICE_ATTR failed (%d)\n", ret); + perror("PMU KVM_SET_DEVICE_ATTR failed"); } else { pr_err("Unsupported PMU on vcpu%d\n", vcpu_idx); } -- 2.17.1