From owner-svn-src-all@freebsd.org Wed Mar 2 01:26:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E7E9AC0169; Wed, 2 Mar 2016 01:26:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30181629; Wed, 2 Mar 2016 01:26:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u221Q6C7099917; Wed, 2 Mar 2016 01:26:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u221Q6rO099916; Wed, 2 Mar 2016 01:26:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201603020126.u221Q6rO099916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 2 Mar 2016 01:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296289 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2016 01:26:07 -0000 Author: sephe Date: Wed Mar 2 01:26:05 2016 New Revision: 296289 URL: https://svnweb.freebsd.org/changeset/base/296289 Log: hyperv/chan: Add sysctl node to check whether monitor is allocated or not MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5502 Modified: head/sys/dev/hyperv/vmbus/hv_channel.c Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed Mar 2 01:24:41 2016 (r296288) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed Mar 2 01:26:05 2016 (r296289) @@ -81,6 +81,17 @@ vmbus_channel_set_event(hv_vmbus_channel } +static int +vmbus_channel_sysctl_monalloc(SYSCTL_HANDLER_ARGS) +{ + struct hv_vmbus_channel *chan = arg1; + int alloc = 0; + + if (chan->offer_msg.monitor_allocated) + alloc = 1; + return sysctl_handle_int(oidp, &alloc, 0, req); +} + static void hv_vmbus_channel_stat(hv_vmbus_channel* channel) { @@ -129,6 +140,10 @@ hv_vmbus_channel_stat(hv_vmbus_channel* } SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, "cpu", CTLFLAG_RD, &channel->target_cpu, 0, "owner CPU id"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, + "monitor_allocated", CTLTYPE_INT | CTLFLAG_RD, channel, 0, + vmbus_channel_sysctl_monalloc, "I", + "is monitor allocated to this channel"); devch_id_in_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_id_sysctl),