diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-24 01:02:39 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-24 01:02:39 +0000 |
commit | c67bb4a642343cf382c7d5f6cc2bee4e433c6d72 (patch) | |
tree | e89666e108f62e9e4c9553d06e108ac370fe461d | |
parent | 584184efa90221a974965c0cf47e92043fd597c8 (diff) | |
parent | f847fd7131b17b32364e9e4d7c26fafa03eb2dfd (diff) | |
download | bpftool-c67bb4a642343cf382c7d5f6cc2bee4e433c6d72.tar.gz |
Snap for 8494130 from f847fd7131b17b32364e9e4d7c26fafa03eb2dfd to udc-releaseandroid-vts-14.0_r4android-vts-14.0_r3android-vts-14.0_r2android-vts-14.0_r1android-security-14.0.0_r9android-security-14.0.0_r8android-security-14.0.0_r7android-security-14.0.0_r6android-security-14.0.0_r5android-security-14.0.0_r4android-security-14.0.0_r3android-security-14.0.0_r2android-security-14.0.0_r1android-platform-14.0.0_r8android-platform-14.0.0_r7android-platform-14.0.0_r6android-platform-14.0.0_r5android-platform-14.0.0_r4android-platform-14.0.0_r3android-platform-14.0.0_r2android-platform-14.0.0_r1android-cts-14.0_r4android-cts-14.0_r3android-cts-14.0_r2android-cts-14.0_r1android-14.0.0_r28android-14.0.0_r2android-14.0.0_r15android-14.0.0_r14android-14.0.0_r13android-14.0.0_r1android14-tests-releaseandroid14-security-releaseandroid14-s2-releaseandroid14-s1-releaseandroid14-releaseandroid14-platform-releaseandroid14-gsi
Change-Id: I19b86f3ea5cf07999b974b659288eab0096d0f00
-rw-r--r-- | Android.bp | 13 | ||||
-rw-r--r-- | src/perf.c | 13 | ||||
-rw-r--r-- | src/tracelog.c | 2 |
3 files changed, 27 insertions, 1 deletions
@@ -31,6 +31,19 @@ cc_binary_host { "include/uapi", "src/kernel/bpf" ], + target: { + musl: { + // There is an unfortunate interaction between the bionic uapi headers + // used by musl and the kernel headers distributed with bpftool. The + // bionic uapi headers include <linux/compiler_types.h>, which they + // expect to be resolved to their own copy of compiler_types.h that + // includes compiler.h. It instead resolves to the bpftool copy, + // which includes compiler-gcc.h directly, triggering an error if + // the _LINUX_COMPILER_H_ header guard is not already defined. Hack + // around it by always including linux/compiler.h from the command line. + cflags: ["-include linux/compiler.h"], + }, + }, static_libs: [ "libbpf", "libcap", @@ -17,6 +17,19 @@ #include "main.h" +/* musl libc doesn't implement these GNU extensions. They are used below + * to optimize out walking unnecessary subtrees of /proc, #defining them + * to 0 here disables the optimization but leaves the functionality otherwise + * unchanged. + */ +#ifndef FTW_SKIP_SUBTREE +#define FTW_SKIP_SUBTREE 0 +#endif + +#ifndef FTW_ACTIONRETVAL +#define FTW_ACTIONRETVAL 0 +#endif + /* 0: undecided, 1: supported, 2: not supported */ static int perf_query_supported; static bool has_perf_query_support(void) diff --git a/src/tracelog.c b/src/tracelog.c index e80a5c7..d218a58 100644 --- a/src/tracelog.c +++ b/src/tracelog.c @@ -3,13 +3,13 @@ /* Copyright (c) 2018 Netronome Systems, Inc. */ #include <errno.h> +#include <fcntl.h> #include <limits.h> #include <signal.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <linux/magic.h> -#include <sys/fcntl.h> #include <sys/vfs.h> #include "main.h" |