handle return value properly for btf__new and btf_ext__new (#2197)
handle return value properly for btf__new and btf_ext__new (#2197)

Currently, in case of error, btf__new or btf_ext__new does not
return NULL pointer. Instead, the return value looks like
ERR_PTR(-errno), and the caller needs to check the range of
return value to decide whether it is a valid pointer.

Let us define similar macros and handle return values
properly. We can restore the change if later kernel libbpf
changes the return value such that NULL pointer stands for failure.

Signed-off-by: Yonghong Song <e76892bbe783db2f627de1232e139db4de43da60@fb.com>
mcaleavya/bcc,brendangregg/bcc,mcaleavya/bcc,brendangregg/bcc,tuxology/bcc,brendangregg/bcc,mcaleavya/bcc,mcaleavya/bcc,tuxology/bcc,iovisor/bcc,iovisor/bcc,iovisor/bcc,iovisor/bcc,tuxology/bcc,mcaleavya/bcc,brendangregg/bcc,tuxology/bcc,tuxology/bcc,iovisor/bcc,brendangregg/bcc