[NETD-BPF#9] bpf_benchmark links liblog
1. bpf_benchmark needs to link liblog because some functions it used are
moved from BpfUtils.cpp to BpfUtils.h. These functions use ALOGX().
2. Move LOG_TAG in TcUtils.cpp to first line to avoid LOG_TAG
redefinition. LOG_TAG should be defined before including headers.
Otherwise, LOG_TAG may have been defined as NULL (by log.h) in included
headers. It causes redefinition warning when cpp file tries to define
LOG_TAG again.
Bug: 202086915
Test: build; flash; cd system/netd; atest
Change-Id: I12c54e9e2d91083cf752c3cad5a9c4ec0d5fd6f2
diff --git a/server/TcUtils.cpp b/server/TcUtils.cpp
index 45d02bb..15812ba 100644
--- a/server/TcUtils.cpp
+++ b/server/TcUtils.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "TcUtils"
+
#include "TcUtils.h"
#include <arpa/inet.h>
@@ -27,7 +29,6 @@
#include <sys/types.h>
#include <unistd.h>
-#define LOG_TAG "TcUtils"
#include <log/log.h>
#include "NetlinkCommands.h"
diff --git a/tests/benchmarks/Android.bp b/tests/benchmarks/Android.bp
index 2aa8df0..86747d7 100644
--- a/tests/benchmarks/Android.bp
+++ b/tests/benchmarks/Android.bp
@@ -50,6 +50,7 @@
shared_libs: [
"libbase",
"libbpf_android",
+ "liblog",
"libnetdutils",
],
srcs: [