format chore and pre commit hook addition

This commit is contained in:
2025-10-01 00:41:00 +05:30
parent 8658143b16
commit 8d5067996f
37 changed files with 83187 additions and 82671 deletions

View File

@ -10,6 +10,7 @@ from ctypes import c_void_p, c_int64, c_uint64
# 3. Run the program with sudo: sudo tools/check.sh run examples/sys_sync.o
# 4. Start a Python repl and `import os` and then keep entering `os.sync()` to see reponses.
@bpf
@map
def last() -> HashMap:
@ -23,9 +24,9 @@ def do_trace(ctx: c_void_p) -> c_int64:
tsp = last().lookup(key)
if tsp:
kt = ktime()
delta = (kt - tsp)
delta = kt - tsp
if delta < 1000000000:
time_ms = (delta // 1000000)
time_ms = delta // 1000000
print(f"sync called within last second, last {time_ms} ms ago")
last().delete(key)
else: