Bcc build fixes for Android (#2142)
* Mark unused parameters as unused In Android, we are building libbpf with -Wunused-parameter, mark the parameters in bpf_detach_tracepoint to prevent errors. Change-Id: I2d0011746af80898e55d456b973a95330ce6be71 Signed-off-by: Joel Fernandes <joel@joelfernandes.org> * Avoid void pointer arithmetic In Android, we build libbpf with -Wpointer-arith, this causes warnings as below. Avoid void pointer arithmetic to prevent the warning. external/bcc/src/cc/perf_reader.c:189:26: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wpointer-arith] memcpy(reader->buf + len, base, e->size - len); ~~~~~~~~~~~ ^ Change-Id: If06535459473c78799b38119786a91e74a208895 Signed-off-by: Joel Fernandes <joel@joelfernandes.org> * Cast correctly for unsigned long format specifier In Android, -Wformat gets passed to the compiler causing a warning. Fix it by casting. external/bcc/src/cc/libbpf.c:972:58: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned lo ng long') [-Werror,-Wformat] Change-Id: I5e70eeff983f20a0b921e81aee7ddbee6d7de2b3 Signed-off-by: Joel Fernandes <joel@joelfernandes.org>
Showing
Please register or sign in to comment