Change API of attach_kprobe to take a name argument
authorBrenden Blanco <bblanco@plumgrid.com>
Wed, 19 Aug 2015 22:39:19 +0000 (15:39 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Wed, 19 Aug 2015 22:39:19 +0000 (15:39 -0700)
commit5eef65e6854ad47d4df12e5ac3cc7f66f906b90b
tree8407a9c378b4e9655fd81fed2725b82144bc11d4
parent307ac0b35e379de28cd626a64a4edf19b38fcf1b
Change API of attach_kprobe to take a name argument

Per feedback on the attach_kprobe api, change up the arguments to remove
the load_func that typically preceeds the call. Instead, move this
inside the attach_kprobe implementation. Also, this makes attach_kprobe
need to be non-static. The same applies to attach_kretprobe.

Old:
fn = b.load_func("hello", BPF.KPROBE)
BPF.attach_kprobe(fn, "sys_clone")

New:
b.attach_kprobe(event="sys_clone", fn_name="hello")

Note that the kwarg style is not required, but I fixed up the current
usages to provide readability.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
13 files changed:
examples/bitehist.py
examples/disksnoop.py
examples/hello_world.py
examples/task_switch.py
examples/vfsreadlat.py
src/python/bpf/__init__.py
tests/cc/test_trace1.py
tests/cc/test_trace2.py
tests/cc/test_trace3.py
tools/pidpersec
tools/syncsnoop
tools/vfscount
tools/vfsstat