virtio: console: add port stats for bytes received, sent and discarded
authorAmit Shah <amit.shah@redhat.com>
Wed, 14 Sep 2011 07:36:46 +0000 (13:06 +0530)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Nov 2011 01:11:01 +0000 (11:41 +1030)
commit17e5b4f20adbe286fdf14b4d08f296564e97e545
treec6634147e4a939213033cf8f5b622a686edd3968
parent2d24cdaa6e389f85dad51eda39f1c2684a4f15b0
virtio: console: add port stats for bytes received, sent and discarded

This commit adds port-specific stats for the number of bytes received,
sent and discarded.  They're exposed via the debugfs interface.  This
data can be used to check for data loss bugs (or disprove such claims).
It can also be used for accounting, if there's such a need.

The stats remain valid throughout the lifetime of the port.  Unplugging
a port will reset the stats.  The numbers are not reset across port
opens/closes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c