- local secs = (buf.timestamp - initial_timestamp) / 1000 / 1000000
- local usecs = (buf.timestamp - initial_timestamp) / 1000 % 1000000
- return string.format("%s %6d.%06d %-16s[%06x] %-24s",
- prefix, secs, usecs, buf.command, buf.threadid, buf.debugname)
+
+ local proc
+ if buf.command ~= "kernel_task" then
+ proc = buf.command
+ workqueue_ptr_map[buf[1]] = buf.command
+ elseif workqueue_ptr_map[buf[1]] ~= nil then
+ proc = workqueue_ptr_map[buf[1]]
+ else
+ proc = "UNKNOWN"
+ end
+
+ return string.format("%s %6.9f %-17s [%05d.%06x] %-24s",
+ prefix, secs, proc, buf.pid, buf.threadid, buf.debugname)