CA-136792: Read raw stats from blktap3

With blktap3, the blkback stats structure is maintained on a shared page
This patch fetches the required counters via C stubs to create the
datasources.

Backport of #xen-api/pull/1917 [b254def49d64679bc09e4f761282eaa758146732]

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Imported-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CA-145335: Switch to a record based model to create tapdisk3 statistics.

This patch introduces a record based model to create statistics.
Prior to this patch, we used to return large tupes and process each
element individually to create the datasources. We now use a record to
hold sysfs_stats and another to hold blktap3 stats.

Backport of #xen-api/pull/1955 [18ecac327bca9b799d4b87710304fdd4f1dd52e6]

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Imported-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CA-145335: Add new datasources exposed by tapdisk3

This patch exposes additional statistics exposed by tapdisk3.
Prior to XS6.5, a VM's metrics were supplied by xcp-rrdd,
xcp-rrd-iostat, etc... Originally, these metrics were created by reading
counters from `sysfs`. With tapdisk3, we read the statistics exposed
under '/dev/shm' to create these datasources.
The newly exposed counters are:
* vbd_<X>_iowait
* vbd_<X>_inflight
* vbd_<X>_iops_read
* vbd_<X>_iops_write
* vbd_<X>_iops_total
* vbd_<X>_io_throughput_total

Metrics like vbd_<X>_io_throughput_read and vbd_<X>_io_throughput_write
are redundant.

Backport of #xen-api/pull/1955 [496f14e6a55507d0e2bad2162ed01748d2d52779]

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Imported-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CA-147261: Add average queue size metric for tapdisk3

Prior to this patch, the average queue size metric was missing.
This patch computes this metric using the stats exposed by tapdisk3.
Average queue size is defined as the sum of the average read and write
queues.

Backport of #xen-api/pull/1965 [8bd98706719a031fdb814bd31a1d04e8324599f8]

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Imported-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
CP-9987: Add blktap3_stats_stubs to _oasis

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Merge pull request #28 from siddharthv/CP-9987

CP-9987: Trunk port of tapdisk3 stats
Log the exception raised when failing to process a plugin

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #29 from johnelse/improve-plugin-log

Log the exception raised when failing to process a plugin