svn commit: r296289 - head/sys/dev/hyperv/vmbus
Sepherosa Ziehau
sephe at FreeBSD.org
Wed Mar 2 01:26:07 UTC 2016
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),
More information about the svn-src-head
mailing list