From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759489AbcJaFto (ORCPT ); Mon, 31 Oct 2016 01:49:44 -0400 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:41700 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759030AbcJaFs7 (ORCPT ); Mon, 31 Oct 2016 01:48:59 -0400 x-originating-ip: 72.167.245.219 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, sthemmin@microsoft.com Cc: Alex Ng , Alex Ng , "K. Y. Srinivasan" Subject: [PATCH 06/15] Drivers: hv: vss: Improve log messages. Date: Mon, 31 Oct 2016 00:41:41 -0700 Message-Id: <1477899710-28675-6-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1477899710-28675-1-git-send-email-kys@exchange.microsoft.com> References: <1477899668-28635-1-git-send-email-kys@exchange.microsoft.com> <1477899710-28675-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfOoBE6Kf+u6UIOV3WwBQbJ1C3EsneSBC8gk3KzGgX+/PqWun4GoApn18mOd5vzem9bdUoMGbvp1DpHsiwosUTGjj6DFBy8UMZKLF9pjR3e5RtVut7qpY tvKJGldl1yVmMqvIiKUM5AiBrb3esf3PxmhQ0ltx2pqpmvApoECSSrKDUgsa0hA2Go6zFfvPfCbSfW2AKBYep8olPfXoIjXPyMF18mwrrtnZK8ePx3ivc6Su k46VYWakrdCDgqkJbRaHpBuyeXFff9FdmcPTA7bt5+aqrHW8AJsrwu0qkITEEEqzt6/Ccg9NyRub2KUC6Fo7rGXH/7KXpyOAddV3AhsKaaBoXI574gQW4QVe 82aJS5KlgyLfqJmqRmx2i/CJOwaPZmoUOBxY94upadaMBX/4rCcjvHGtUg96OnXPW5l6OtQ0ej8lbJwV7QHPbqu9SDIdEvQmJ1syHxjy64Af5P9RnwQgiMWy dgVUcSfkqGka3hgmSytczml1YJGdQmsJ22fRmecoyux/QkCFioD4zV/4FxfL0DS2saWyGFhM3X6lR+bMQsyz8l3LM15cWbMcAPHSFQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Ng Adding log messages to help troubleshoot error cases and transaction handling. Signed-off-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c index a670713..5c95ba1 100644 --- a/drivers/hv/hv_snapshot.c +++ b/drivers/hv/hv_snapshot.c @@ -120,7 +120,7 @@ static int vss_handle_handshake(struct hv_vss_msg *vss_msg) default: return -EINVAL; } - pr_debug("VSS: userspace daemon ver. %d connected\n", dm_reg_value); + pr_info("VSS: userspace daemon ver. %d connected\n", dm_reg_value); return 0; } @@ -128,8 +128,10 @@ static int vss_on_msg(void *msg, int len) { struct hv_vss_msg *vss_msg = (struct hv_vss_msg *)msg; - if (len != sizeof(*vss_msg)) + if (len != sizeof(*vss_msg)) { + pr_debug("VSS: Message size does not match length\n"); return -EINVAL; + } if (vss_msg->vss_hdr.operation == VSS_OP_REGISTER || vss_msg->vss_hdr.operation == VSS_OP_REGISTER1) { @@ -137,8 +139,11 @@ static int vss_on_msg(void *msg, int len) * Don't process registration messages if we're in the middle * of a transaction processing. */ - if (vss_transaction.state > HVUTIL_READY) + if (vss_transaction.state > HVUTIL_READY) { + pr_debug("VSS: Got unexpected registration request\n"); return -EINVAL; + } + return vss_handle_handshake(vss_msg); } else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) { vss_transaction.state = HVUTIL_USERSPACE_RECV; @@ -155,7 +160,7 @@ static int vss_on_msg(void *msg, int len) } } else { /* This is a spurious call! */ - pr_warn("VSS: Transaction not active\n"); + pr_debug("VSS: Transaction not active\n"); return -EINVAL; } return 0; @@ -168,8 +173,10 @@ static void vss_send_op(void) struct hv_vss_msg *vss_msg; /* The transaction state is wrong. */ - if (vss_transaction.state != HVUTIL_HOSTMSG_RECEIVED) + if (vss_transaction.state != HVUTIL_HOSTMSG_RECEIVED) { + pr_debug("VSS: Unexpected attempt to send to daemon\n"); return; + } vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL); if (!vss_msg) @@ -210,9 +217,13 @@ static void vss_handle_request(struct work_struct *dummy) case VSS_OP_HOT_BACKUP: if (vss_transaction.state < HVUTIL_READY) { /* Userspace is not registered yet */ + pr_debug("VSS: Not ready for request.\n"); vss_respond_to_host(HV_E_FAIL); return; } + + pr_debug("VSS: Received request for op code: %d\n", + vss_transaction.msg->vss_hdr.operation); vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED; vss_send_op(); return; @@ -353,8 +364,10 @@ hv_vss_init(struct hv_util_service *srv) hvt = hvutil_transport_init(vss_devname, CN_VSS_IDX, CN_VSS_VAL, vss_on_msg, vss_on_reset); - if (!hvt) + if (!hvt) { + pr_warn("VSS: Failed to initialize transport\n"); return -EFAULT; + } return 0; } -- 1.7.4.1