summaryrefslogtreecommitdiffstats
path: root/plugins/solidigm/solidigm-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/solidigm/solidigm-util.c')
-rw-r--r--plugins/solidigm/solidigm-util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/solidigm/solidigm-util.c b/plugins/solidigm/solidigm-util.c
index 05d1537..8206ef8 100644
--- a/plugins/solidigm/solidigm-util.c
+++ b/plugins/solidigm/solidigm-util.c
@@ -37,3 +37,19 @@ int sldgm_get_uuid_index(struct nvme_dev *dev, __u8 *index)
return sldgm_find_uuid_index(&uuid_list, index);
}
+
+int sldgm_dynamic_telemetry(int dev_fd, bool create, bool ctrl, bool log_page, __u8 mtds,
+ enum nvme_telemetry_da da, struct nvme_telemetry_log **log_buffer,
+ size_t *log_buffer_size)
+{
+ int err;
+ size_t max_data_tx = (1 << mtds) * NVME_LOG_PAGE_PDU_SIZE;
+
+ do {
+ err = nvme_get_telemetry_log(dev_fd, create, ctrl, log_page, max_data_tx, da,
+ log_buffer, log_buffer_size);
+ max_data_tx /= 2;
+ create = false;
+ } while (err == -EPERM && max_data_tx >= NVME_LOG_PAGE_PDU_SIZE);
+ return err;
+}