Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bcc] Add macros to check libbcc version
Summary: Currently, libbcc only exposes its version via a string constant. This makes it complicated for libraries built on top of libbcc to be compatible across multiple versions when there is API changes for instances, as happens in iovisor/gobpf#311 Exposing MAJOR/MINOR/PATCH versions would allow libraries which are not shipped as part of iovisor/bcc to handle those API changes. This diffs exposes those values, provides a macro to perform version comparison (a la `LINUX_VERSION()`). One thing it does not address currently is exposing whether this is an "exact tag" version, e.g a release, or in between releases. Test plan: When building: ``` -- Latest recognized Git tag is v0.24.0 -- Git HEAD is f26cdb33068187d04d9dc058834985df841e28fa -- Revision is 0.24.0-f26cdb33 (major 0, minor 24, patch 0) -- Found LLVM: /usr/lib/llvm-11/include 11.1.0 (Use LLVM_ROOT envronment variable for another version of LLVM) ... ... ``` and the produced `bcc_version.h`: ``` $ cat build/src/cc/bcc_version.h ```
- Loading branch information