提交 6981fbf3 编写于 作者: S Stephen Hemminger 提交者: Greg Kroah-Hartman

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: NStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6fbf248a
...@@ -61,39 +61,53 @@ Date: September. 2017 ...@@ -61,39 +61,53 @@ Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Inbound channel signaling state Description: Inbound channel signaling state
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/latency What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/latency
Date: September. 2017 Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Channel signaling latency Description: Channel signaling latency
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/out_mask What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/out_mask
Date: September. 2017 Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Outbound channel signaling state Description: Outbound channel signaling state
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/pending What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/pending
Date: September. 2017 Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Channel interrupt pending state Description: Channel interrupt pending state
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/read_avail What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/read_avail
Date: September. 2017 Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Bytes availabble to read Description: Bytes availabble to read
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/write_avail What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/write_avail
Date: September. 2017 Date: September. 2017
KernelVersion: 4.14 KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com> Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Bytes availabble to write Description: Bytes availabble to write
Users: Debuggig tools Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/events
Date: September. 2017
KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Number of times we have signaled the host
Users: Debugging tools
What: /sys/bus/vmbus/devices/vmbus_*/channels/relid/interrupts
Date: September. 2017
KernelVersion: 4.14
Contact: Stephen Hemminger <sthemmin@microsoft.com>
Description: Number of times we have taken an interrupt (incoming)
Users: Debugging tools
...@@ -409,6 +409,8 @@ void vmbus_set_event(struct vmbus_channel *channel) ...@@ -409,6 +409,8 @@ void vmbus_set_event(struct vmbus_channel *channel)
if (!channel->is_dedicated_interrupt) if (!channel->is_dedicated_interrupt)
vmbus_send_interrupt(child_relid); vmbus_send_interrupt(child_relid);
++channel->sig_events;
hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event); hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT, channel->sig_event);
} }
EXPORT_SYMBOL_GPL(vmbus_set_event); EXPORT_SYMBOL_GPL(vmbus_set_event);
...@@ -944,6 +944,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu) ...@@ -944,6 +944,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu)
if (channel->rescind) if (channel->rescind)
continue; continue;
++channel->interrupts;
switch (channel->callback_mode) { switch (channel->callback_mode) {
case HV_CALL_ISR: case HV_CALL_ISR:
vmbus_channel_isr(channel); vmbus_channel_isr(channel);
...@@ -1237,6 +1239,18 @@ static ssize_t channel_latency_show(const struct vmbus_channel *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); 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[] = { static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_out_mask.attr, &chan_attr_out_mask.attr,
&chan_attr_in_mask.attr, &chan_attr_in_mask.attr,
...@@ -1245,6 +1259,8 @@ static struct attribute *vmbus_chan_attrs[] = { ...@@ -1245,6 +1259,8 @@ static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_cpu.attr, &chan_attr_cpu.attr,
&chan_attr_pending.attr, &chan_attr_pending.attr,
&chan_attr_latency.attr, &chan_attr_latency.attr,
&chan_attr_interrupts.attr,
&chan_attr_events.attr,
NULL NULL
}; };
......
...@@ -719,6 +719,10 @@ struct vmbus_channel { ...@@ -719,6 +719,10 @@ struct vmbus_channel {
struct vmbus_close_msg close_msg; struct vmbus_close_msg close_msg;
/* Statistics */
u64 interrupts; /* Host to Guest interrupts */
u64 sig_events; /* Guest to Host events */
/* Channel callback's invoked in softirq context */ /* Channel callback's invoked in softirq context */
struct tasklet_struct callback_event; struct tasklet_struct callback_event;
void (*onchannel_callback)(void *context); void (*onchannel_callback)(void *context);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册