From eede18876cb0daeb5f81062947a445860dfcb738 Mon Sep 17 00:00:00 2001 From: Bryan Cantrill Date: Thu, 17 Aug 2023 05:41:31 +0000 Subject: [PATCH] add USDT probes for NVMe flush operations --- lib/propolis/src/hw/nvme/requests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/propolis/src/hw/nvme/requests.rs b/lib/propolis/src/hw/nvme/requests.rs index 7811fb3f8..9c3d547bc 100644 --- a/lib/propolis/src/hw/nvme/requests.rs +++ b/lib/propolis/src/hw/nvme/requests.rs @@ -17,6 +17,9 @@ mod probes { fn nvme_write_enqueue(cid: u16, off: u64, sz: u64) {} fn nvme_write_complete(cid: u16) {} + + fn nvme_flush_enqueue(cid: u16) {} + fn nvme_flush_complete(cid: u16) {} } impl block::Device for PciNvme { @@ -97,6 +100,8 @@ impl PciNvme { return Some(req); } Ok(NvmCmd::Flush) => { + probes::nvme_flush_enqueue!(|| (cid)); + let req = Request::new_flush( 0, 0, // TODO: is 0 enough or do we pass total size? @@ -137,7 +142,9 @@ impl PciNvme { Operation::Write(..) => { probes::nvme_write_complete!(|| (cid)); } - _ => {} + Operation::Flush(..) => { + probes::nvme_flush_complete!(|| (cid)); + } } let mem = self.mem_access();