Add option for custom log string to bpf_prog_load
authorBrenden Blanco <bblanco@plumgrid.com>
Wed, 29 Jul 2015 22:47:51 +0000 (15:47 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Thu, 30 Jul 2015 07:25:15 +0000 (00:25 -0700)
commit759029fea8066b41b54be5447137db95cb1313c4
tree00a0c497a026374307cd2f081f716778cd6f1a46
parenta1655269a3cedc4a61c53d85ab51c9ea67399b2d
Add option for custom log string to bpf_prog_load

bpf_prog_load was unconditionally printing the error from the kernel to
stderr. If libbpf is used in a library, that library may want to collect
the error to a custom location (a logfile). So, provide an option to
store the string elsewhere than stderr.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
src/cc/libbpf.c
src/libbpf.h
src/python/bpf/__init__.py