cleaner get_table calls
authorBrendan Gregg <brendan.d.gregg@gmail.com>
Tue, 18 Aug 2015 22:34:56 +0000 (15:34 -0700)
committerBrendan Gregg <brendan.d.gregg@gmail.com>
Tue, 18 Aug 2015 22:34:56 +0000 (15:34 -0700)
examples/bitehist.py
examples/vfsreadlat.py
tools/pidpersec
tools/vfsstat

index ae2112b..5662d4e 100755 (executable)
@@ -40,7 +40,7 @@ if len(argv) > 1:
 # load BPF program
 b = BPF(src_file = "bitehist.c")
 BPF.attach_kprobe(b.load_func("do_request", BPF.KPROBE), "blk_start_request")
-dist = b.get_table("dist", c_int, c_ulonglong)
+dist = b.get_table("dist")
 dist_max = 64
 
 # header
index 798ccf1..4707b03 100755 (executable)
@@ -41,7 +41,7 @@ if len(argv) > 1:
 b = BPF(src_file = "vfsreadlat.c")
 BPF.attach_kprobe(b.load_func("do_entry", BPF.KPROBE), "vfs_read")
 BPF.attach_kretprobe(b.load_func("do_return", BPF.KPROBE), "vfs_read")
-dist = b.get_table("dist", c_int, c_ulonglong)
+dist = b.get_table("dist")
 dist_max = 64
 
 # header
index b84fbe6..e4c6940 100755 (executable)
@@ -19,7 +19,7 @@ from time import sleep, strftime
 # load BPF program
 b = BPF(src_file = "pidpersec.c")
 BPF.attach_kprobe(b.load_func("do_count", BPF.KPROBE), "sched_fork")
-stats = b.get_table("stats", c_int, c_ulonglong)
+stats = b.get_table("stats")
 
 # stat indexes
 S_COUNT = 1
index 3c5ee99..0be8cec 100755 (executable)
@@ -42,7 +42,7 @@ BPF.attach_kprobe(b.load_func("do_write", BPF.KPROBE), "vfs_write")
 BPF.attach_kprobe(b.load_func("do_fsync", BPF.KPROBE), "vfs_fsync")
 BPF.attach_kprobe(b.load_func("do_open", BPF.KPROBE), "vfs_open")
 BPF.attach_kprobe(b.load_func("do_create", BPF.KPROBE), "vfs_create")
-stats = b.get_table("stats", c_int, c_ulonglong)
+stats = b.get_table("stats")
 
 # stat column labels and indexes
 stat_types = {