Commit 79631664 authored by Brenden Blanco's avatar Brenden Blanco

Merge pull request #453 from yadutaf/jt-endian

expose buitin byte swap methods
parents af66546d e3b3b4c2
...@@ -39,6 +39,11 @@ ksyms = [] ...@@ -39,6 +39,11 @@ ksyms = []
ksym_names = {} ksym_names = {}
ksym_loaded = 0 ksym_loaded = 0
_kprobe_limit = 1000 _kprobe_limit = 1000
BASE_CFLAGS = [
'-D__HAVE_BUILTIN_BSWAP16__',
'-D__HAVE_BUILTIN_BSWAP32__',
'-D__HAVE_BUILTIN_BSWAP64__',
]
@atexit.register @atexit.register
def cleanup_kprobes(): def cleanup_kprobes():
...@@ -140,6 +145,7 @@ class BPF(object): ...@@ -140,6 +145,7 @@ class BPF(object):
self.debug = debug self.debug = debug
self.funcs = {} self.funcs = {}
self.tables = {} self.tables = {}
cflags = BASE_CFLAGS + cflags
cflags_array = (ct.c_char_p * len(cflags))() cflags_array = (ct.c_char_p * len(cflags))()
for i, s in enumerate(cflags): cflags_array[i] = s.encode("ascii") for i, s in enumerate(cflags): cflags_array[i] = s.encode("ascii")
if text: if text:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment