5 from ctypes import c_ushort, c_int, c_ulonglong
9 print("[interval] [count]")
12 print("Hit Ctrl-C to end.")
17 b = BPF(src_file="dbus-tok.c")
19 b.attach_uprobe(name="dbus-1", sym="_dbus_poll", fn_name="do_entry")
21 b.attach_uretprobe(name="dbus-1", sym="_dbus_poll", fn_name="do_return")
30 print ("%d : \n" % loop)
32 timestamp = b["timestamp_e"]
34 for v in timestamp.values():
36 timestamp = b["timestamp_b"]
37 for v in timestamp.values():
39 for v in stats_t.values():
40 v.usage = (v.run * 100 / timeframe)
41 for v in sorted(stats_t.values(), key=lambda stats_t: stats_t.run, reverse=True):
42 print("%10d %20s %10.6f" % (v.pid, v.buf.encode('string-escape'), float(v.run) / float(timeframe)))