Skip to content

Commit

Permalink
Merge pull request iovisor#511 from vmg/vmg/find-library
Browse files Browse the repository at this point in the history
bpf: Wrap `bcc_procutils_which_so` as `BPF.find_library`
  • Loading branch information
drzaeus77 committed Apr 28, 2016
2 parents 7d29a46 + 6641cbb commit 55513a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/python/bcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ def _check_path_symbol(cls, module, symname, addr):
raise Exception("could not determine address of symbol %s" % symname)
return sym.module, sym.offset

@staticmethod
def find_library(libname):
return lib.bcc_procutils_which_so(libname)

def attach_uprobe(self, name="", sym="", addr=None,
fn_name="", pid=-1, cpu=0, group_fd=-1):
"""attach_uprobe(name="", sym="", addr=None, fn_name=""
Expand Down
3 changes: 3 additions & 0 deletions src/python/bcc/libbcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class bcc_symbol(ct.Structure):
('offset', ct.c_ulonglong),
]

lib.bcc_procutils_which_so.restype = ct.c_char_p
lib.bcc_procutils_which_so.argtypes = [ct.c_char_p]

lib.bcc_resolve_symname.restype = ct.c_int
lib.bcc_resolve_symname.argtypes = [
ct.c_char_p, ct.c_char_p, ct.c_ulonglong, ct.POINTER(bcc_symbol)]
Expand Down

0 comments on commit 55513a3

Please sign in to comment.