From patchwork Fri Jan 25 18:08:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 10781819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39E3E1399 for ; Fri, 25 Jan 2019 18:08:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28856302CF for ; Fri, 25 Jan 2019 18:08:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D212302F7; Fri, 25 Jan 2019 18:08:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C951A302CF for ; Fri, 25 Jan 2019 18:08:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbfAYSIR (ORCPT ); Fri, 25 Jan 2019 13:08:17 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51986 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729497AbfAYSIN (ORCPT ); Fri, 25 Jan 2019 13:08:13 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 32A691596; Fri, 25 Jan 2019 10:08:13 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 474153F5AF; Fri, 25 Jan 2019 10:08:12 -0800 (PST) From: Andre Przywara To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org 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> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125180801.209910-1-andre.przywara@arm.com> References: <20190125180801.209910-1-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }