about summary refs log tree commit homepage
path: root/tapset/ioq_wait.awk
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/ioq_wait.awk')
-rwxr-xr-xtapset/ioq_wait.awk53
1 files changed, 53 insertions, 0 deletions
diff --git a/tapset/ioq_wait.awk b/tapset/ioq_wait.awk
new file mode 100755
index 0000000..ba3913e
--- /dev/null
+++ b/tapset/ioq_wait.awk
@@ -0,0 +1,53 @@
+#!/usr/bin/awk -f
+/ ioq_blocked / {
+        pid = $1
+        fd = $2
+        time = $4
+        ioq_blocked[pid, fd] = time
+}
+
+/ ioq_reschedule / {
+        pid = $1
+        fd = $2
+        time = $4
+        ioq_reschedule[pid, fd] = time
+}
+
+/ http_req_start / {
+        pid = $1
+        fd = $2
+        method = $4
+        path = $5
+
+        now = ioq_unblocked[pid, fd]
+        if (now) {
+                blocked = (now - ioq_blocked[pid, fd]) / 1000000
+                resched = (now - ioq_reschedule[pid, fd]) / 1000000
+
+                printf("% 6d % 6d %0.4f %0.4f %s %s\n",
+                        pid, fd, blocked, resched, method, path)
+        }
+}
+
+/ mgmt_dig_start / {
+        pid = $1
+        fd = $2
+        alg = $4
+        path = $5
+
+        now = ioq_unblocked[pid, fd]
+        if (now) {
+                blocked = (now - ioq_blocked[pid, fd]) / 1000000
+                resched = (now - ioq_reschedule[pid, fd]) / 1000000
+
+                printf("% 6d % 6d %0.4f %0.4f %s %s\n",
+                        pid, fd, blocked, resched, alg, path)
+        }
+}
+
+/ ioq_unblocked / {
+        pid = $1
+        fd = $2
+        now = $4
+        ioq_unblocked[pid, fd] = now
+}