From 6088629014b1c133950ec8a02c5a47a482121e53 Mon Sep 17 00:00:00 2001 From: Greg Colombo Date: Tue, 3 Dec 2024 11:34:40 -0800 Subject: [PATCH] update nvme-trace.d to match current probe definitions (#821) Tested by running this script ad hoc and making sure the output values looked reasonable. --- scripts/nvme-trace.d | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/nvme-trace.d b/scripts/nvme-trace.d index 470d78651..2cef8379f 100755 --- a/scripts/nvme-trace.d +++ b/scripts/nvme-trace.d @@ -16,8 +16,8 @@ dtrace:::BEGIN struct io_info { string op; uint64_t ts; - uint64_t slba; - uint16_t nlb; + uint64_t offset_bytes; + uint64_t size_bytes; }; struct io_info io[uint64_t]; @@ -25,24 +25,28 @@ struct io_info io[uint64_t]; propolis$target:::nvme_read_enqueue, propolis$target:::nvme_write_enqueue { - this->cid = args[0]; + this->cid = args[2]; this->op = (probename == "nvme_read_enqueue") ? "read" : "write"; io[this->cid].op = this->op; io[this->cid].ts = timestamp; - io[this->cid].slba = args[1]; - io[this->cid].nlb = args[2]; + io[this->cid].offset_bytes = args[3]; + io[this->cid].size_bytes = args[4]; } propolis$target:::nvme_read_complete, propolis$target:::nvme_write_complete /io[args[0]].ts != 0/ { - this->cid = args[0]; + this->cid = args[1]; this->elapsed = timestamp - io[this->cid].ts; this->elapsed_us = this->elapsed / 1000; @time[strjoin(io[this->cid].op, " (us)")] = quantize(this->elapsed_us); - printf("%s(cid=%u) %d blocks from LBA 0x%x in %uus\n", - io[this->cid].op, this->cid, io[this->cid].nlb, io[this->cid].slba, this->elapsed_us); + printf("%s(cid=%u) %d bytes from offset 0x%x in %uus\n", + io[this->cid].op, + this->cid, + io[this->cid].size_bytes, + io[this->cid].offset_bytes, + this->elapsed_us); } dtrace:::END