5 from ctypes import c_ushort, c_int
9 print("USAGE: %s [--process|histogram]" % argv[0])
15 if argv[1] == "--histogram":
17 elif argv[1] != "--process":
21 b=BPF(src_file="dbus-connection-message-size.c", debug=0)
22 b.attach_uprobe(name="dbus-1", sym="_dbus_connection_message_sent_unlocked", fn_name="dbus_message_size")
23 b.attach_uprobe(name="gio-2.0", sym="g_dbus_message_to_blob", fn_name="g_get_size_pointer")
24 b.attach_uretprobe(name="gio-2.0", sym="g_dbus_message_to_blob", fn_name="g_get_message_size")
35 print ("\n%d:\n" % count)
38 for v, p in sorted(stats.items(), key=lambda stats: stats[1].bytes, reverse=True):
39 print("%10d %20s %20ld" %(v.pid, v.comm.encode('string-escape'), int(p.bytes)))
41 b["msg_size_hist"].print_log2_hist("bytes")