]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/trace/bridgetime.lua
xnu-4570.71.2.tar.gz
[apple/xnu.git] / tools / trace / bridgetime.lua
index cba2d522dd6ba28ecc8cc2291f35905e70fc3a1b..5bc38ccd72e33b1ef6d89a98f0cbfe03a3c24b79 100755 (executable)
@@ -46,6 +46,8 @@ trace_codename("MACH_CLOCK_BRIDGE_RESET_TS", function(buf)
                reason = "ResetTrue"
        elseif buf[3] == 3 then
                reason = "RateZero"
+       elseif buf[3] == 4 then
+               reason = "TSMismatch"
        end
        printf("%s %-15s ( %-10s %-10s ) ----------------------------------------\n",
                prefix, reason, format_timestamp_arm(buf[1]), format_timestamp_intel(buf[2]))
@@ -89,9 +91,52 @@ trace_codename("MACH_CLOCK_BRIDGE_RCV_TS", function(buf)
                printf("%s ( %-10s Reset )\n",
                        prefix, format_timestamp_arm(buf[1]), format_timestamp_intel(buf[2]))
        else
-               printf("%s ( %-10s %-10s )\n",
-                       prefix, format_timestamp_arm(buf[1]), format_timestamp_intel(buf[2]))
+               local skip = ""
+               if buf[3] == 1 then
+                       skip = "Int handler"
+               end
+               printf("%s ( %-10s %-10s ) %s\n",
+                       prefix, format_timestamp_arm(buf[1]), format_timestamp_intel(buf[2]), skip)
        end
 
 end)
 
+trace_codename("MACH_CLOCK_BRIDGE_SKIP_TS", function(buf)
+       local prefix = get_prefix(buf, "*")
+
+       if buf[4] > 0 then
+               printf("%s SKIP_RESET:%3d (Cur: %-10s Prev:%-10s) %-10s\n",
+                       prefix, buf[4], format_timestamp_arm(buf[1]), format_timestamp_arm(buf[3]),
+                       format_timestamp_intel(buf[2]))
+       else
+               printf("%s SKIP_DISTANCE: (Cur: %-10s Prev: %-10s) %-10s\n",
+                       prefix, format_timestamp_arm(buf[1]), format_timestamp_arm(buf[3]),
+                       format_timestamp_intel(buf[2]))
+       end
+
+end)
+
+trace_codename("MACH_CLOCK_BRIDGE_TS_MISMATCH", function(buf)
+       local prefix = get_prefix(buf, "?")
+
+       local diff = (math.abs(buf[2] - buf[3]))/1000000
+
+       printf("%s ( Cur: %-10s Pred: %-10s Diff: %5.6f ms ) @ %-20s\n",
+               prefix, format_timestamp_intel(buf[2]), format_timestamp_intel(buf[3]),
+               diff, format_timestamp_arm(buf[1]))
+
+end)
+
+trace_codename("MACH_CLOCK_BRIDGE_OBSV_RATE", function(buf)
+       local prefix = get_prefix(buf, "=")
+
+       local rate
+       if darwin.uint64_to_double then
+               rate = darwin.uint64_to_double(buf[1])
+       else
+               rate = math.nan
+       end
+
+       printf("%s obsv_rate = %f exceeded limits(0.8, 1.2)\n", prefix, rate)
+
+end)