summaryrefslogtreecommitdiff
path: root/libdm/ioctl
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-08-18 16:37:03 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-08-20 12:11:23 +0100
commit386e91addbaffcaae20f4f20084cb06b7374e402 (patch)
tree9fa28aea5929f3b9a22f7ae9ab59faa80b6cb900 /libdm/ioctl
parent62a87c84edc12788a088b3cc7dc5a35a18951f38 (diff)
downloadlvm2-386e91addbaffcaae20f4f20084cb06b7374e402.tar.gz
libdm: add dm_message_supports_precise_timestamps()
Add a function to test whether the kernel precise_timestamps feature is available in the current device-mapper driver version. Presence of precise_timestamps also implies the availability of latency histograms.
Diffstat (limited to 'libdm/ioctl')
-rw-r--r--libdm/ioctl/libdm-iface.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 73af12b7a..fe0bffacd 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -604,6 +604,20 @@ static int dm_inactive_supported(void)
return inactive_supported;
}
+int dm_message_supports_precise_timestamps(void)
+{
+ /*
+ * 4.32.0 supports "precise_timestamps" and "histogram:" options
+ * to @stats_create messages but lacks the ability to report
+ * these properties via a subsequent @stats_list: require at
+ * least 4.33.0 in order to use these features.
+ */
+ if (dm_check_version() && _dm_version >= 4)
+ if (_dm_version_minor >= 33)
+ return 1;
+ return 0;
+}
+
void *dm_get_next_target(struct dm_task *dmt, void *next,
uint64_t *start, uint64_t *length,
char **target_type, char **params)