summaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2017-10-29 11:33:40 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-31 13:40:29 +0100
commit6981fbf3780366093858c5d2dcdaadcd1fbb04be (patch)
treed67f014f536afb83a2b87957a44e5265965dad82 /drivers/hv
parent6fbf248a20d362a92de60beee9474faca0b54eee (diff)
Drivers: hv: vmbus: Expose per-channel interrupts and events counters
When investigating performance, it is useful to be able to look at the number of host and guest events per-channel. This is equivalent to per-device interrupt statistics. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/connection.c2
-rw-r--r--drivers/hv/vmbus_drv.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index f41901f80b64..b06a6b796819 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -409,6 +409,8 @@ void vmbus_set_event(struct vmbus_channel *channel)
if (!channel->is_dedicated_interrupt)
vmbus_send_interrupt(child_relid);
+ ++channel->sig_events;
+
hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event);
}
EXPORT_SYMBOL_GPL(vmbus_set_event);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 1da8e818f4de..bca8188f3c8c 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -944,6 +944,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu)
if (channel->rescind)
continue;
+ ++channel->interrupts;
+
switch (channel->callback_mode) {
case HV_CALL_ISR:
vmbus_channel_isr(channel);
@@ -1237,6 +1239,18 @@ static ssize_t channel_latency_show(const struct vmbus_channel *channel,
}
VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL);
+static ssize_t channel_interrupts_show(const struct vmbus_channel *channel, char *buf)
+{
+ return sprintf(buf, "%llu\n", channel->interrupts);
+}
+VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL);
+
+static ssize_t channel_events_show(const struct vmbus_channel *channel, char *buf)
+{
+ return sprintf(buf, "%llu\n", channel->sig_events);
+}
+VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
+
static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_out_mask.attr,
&chan_attr_in_mask.attr,
@@ -1245,6 +1259,8 @@ static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_cpu.attr,
&chan_attr_pending.attr,
&chan_attr_latency.attr,
+ &chan_attr_interrupts.attr,
+ &chan_attr_events.attr,
NULL
};