Commit graph

307 commits

Author SHA1 Message Date
Treehugger Robot
22b82c47d6 Merge "libbpf_android: allow bpf w/o maps section" 2020-01-14 22:03:43 +00:00
Steven Moreland
cdeb9203af libbpf_load_test: fix map location
This test had bitrot.

Bug: N/A
Test: `atest libbpf_load_test`
Change-Id: I3480286e225d8dfbd0badd7bbb7cb77ff29ab0ea
2020-01-14 11:37:49 -08:00
Maciej Żenczykowski
c66f5c6bc1 libbpf_android/BpfUtils - remove unused bpfProgLoad
(due to switch to bpfloader from loading via netd)

Test: build, atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic95cdfde26b8e7b905551a7fd2b465e0cf99bbce
2020-01-14 09:10:32 -08:00
Maciej Żenczykowski
d5f6cf505b Merge "remove network specific struct definitions from BpfUtils.h" 2020-01-14 09:03:11 +00:00
Steven Moreland
1362229a2e Merge "libbpf_android: waitForProgsLoaded" 2020-01-13 22:12:06 +00:00
Steven Moreland
87a1b19052 OWNERS: +smoreland +connoro -fengc -joelaf
Bug: N/A
Test: N/A
Change-Id: I33e5cb5a5e2b0bce588cb90c4d0b74da7cc8dace
2020-01-10 15:42:06 -08:00
Steven Moreland
4891e61341 libbpf_android: waitForProgsLoaded
Creating a function for this rather than having people copy/paste a loop
there.

It's very intentional that there is no timeout here. If bpfloader is
down, there is a serious problem, and we shouldn't let code move forward
in a state where it may not have been tested.

Bug: 140330870
Test: boot & use bpf/netd
Change-Id: I358d1fcf77ad5406e294dd57307bc411e2c8ad6a
2020-01-10 15:37:53 -08:00
Steven Moreland
c0905b4880 libbpf_android: allow bpf w/o maps section
Currently, if a bpf program object has no map section, this error is
propagated, and the program will fail to load. However, it is desirable
to have programs without any map.

Bug: 140330870
Test: load program w/ bpf w/o maps section
Change-Id: Ia53c699212a8cb962e3c2db562921880fef0cce0
2020-01-10 13:33:03 -08:00
Maciej Żenczykowski
841dd444dd remove network specific struct definitions from BpfUtils.h
This is part of 3 commits in 3 diff git repos, the main one is:
  https://android-review.googlesource.com/c/platform/system/netd/+/1200479
  "share eBPF struct definitions between ebpf and C++ netd"

The struct definitions are being moved to system/netd in:
  libnetdbpf/include/netdbpf/bpf_shared.h

(they also become typedefs and more consistent naming is used)

Test: builds
Bug: 146787904
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0200bce35f910414b96d802cd316717b4307b950
2020-01-06 23:28:06 +00:00
Maciej Żenczykowski
be15fa1edd remove spurious equals comparators
These are unused by virtue of the code continuing to build.

C++20 has https://en.cppreference.com/w/cpp/language/default_comparisons
but still requires explicit declaration of them with '=default' annotation.

Test: builds
Bug: 146787904
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I751ad5592acc1ed4cf763d1ca82c301f2e233e56
2020-01-06 13:57:05 +00:00
Maciej Żenczykowski
480c70ac14 bpfloader - remove dead code
Test: builds, atest
Bug: 146787904
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iea667cf4adaccdfd8fbffae8960cbe243ae77d70
2019-12-30 04:12:36 -08:00
Steven Moreland
804bca0d66 libbpf_android: bpf_prog_load no log success error
errno is left unchanged on successful calls to this function, so it is
confusing to log it in the success path.

Fixes: 146171927
Test: looking at logs
Change-Id: Ia424dd865bd518d8c533e99fb1a64b02bc92e759
2019-12-12 17:24:00 -08:00
Maciej Żenczykowski
8ccd5f6b95 Merge "Revert "bpf: change how we detect device bpf support level""
am: 26dbcb7707

Change-Id: I51227ce953b7f7ee18b236c88285ca3ba26ea17a
2019-11-14 18:18:48 -08:00
Maciej Żenczykowski
26dbcb7707 Merge "Revert "bpf: change how we detect device bpf support level"" 2019-11-15 00:54:28 +00:00
Maciej Żenczykowski
1b5491d758 Revert "bpf: change how we detect device bpf support level"
This reverts commit 8daa0b6070.

Reason for revert: Not clear if O -> R will be supported or not.

Change-Id: I02818f35b4468cb3676a02951876c7768bb0451f
2019-11-15 00:54:05 +00:00
Connor O'Brien
4731c9104f bpfloader: use unique_fd
am: 8d49fc7434

Change-Id: Ib79e003fb0b06d601a43996bb32b97a18bc4750d
2019-11-14 00:11:39 -08:00
Connor O'Brien
58175341b3 bpf: move time in state struct definitions into a single shared header
am: 85087ae737

Change-Id: Ib7fa88cd0898e3e1df9186263c4505728848d45c
2019-11-14 00:11:34 -08:00
Connor O'Brien
8d49fc7434 bpfloader: use unique_fd
Using unique_fd to ensure we release bpf prog fds when they are no
longer needed.

Change-Id: I9d5c2673c7e1bdf05052771e06ac78cec21957ec
Merged-In: I9d5c2673c7e1bdf05052771e06ac78cec21957ec
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit 206dd3381e)
2019-11-13 21:58:28 -08:00
Connor O'Brien
85087ae737 bpf: move time in state struct definitions into a single shared header
Key and value formats for time in state related BPF maps currently
have to be kept in sync between the BPF prog and
libtimeinstate. Add a new bpf_timeinstate.h header file in a directory
that already gets added to the include path for BPF progs, and add
this file to a cc_library_headers module so it can be used from
libtimeinstate as well.

Test: build libtimeinstate and time_in_state.o
Bug: 138317993
Change-Id: Ic56b2b64746f2211f3c802e074339750f26303c0
Merged-In: Ic56b2b64746f2211f3c802e074339750f26303c0
Signed-off-by: Connor O'Brien <connoro@google.com>
(cherry picked from commit badb20f528)
2019-11-13 21:58:27 -08:00
Joel Fernandes (Google)
343e679ebb libbpf: Add errno string to loader debug messages
am: 88eef6ad55

Change-Id: Ie5a4e2181c2cc82c1d770af7ba4f9a4f7e68a308
2019-11-11 07:13:06 -08:00
Joel Fernandes (Google)
88eef6ad55 libbpf: Add errno string to loader debug messages
The return of bpf_prog_load() library call is insufficient, we also need
errno to know what the bpf(2) syscall did.

Bug: 143236645

Change-Id: Id2c543fdb63b1e077278a8b1ede03a21afad74dc
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
2019-11-08 16:51:11 -05:00
Maciej enczykowski
dd60c100c1 move networking bpf helpers to system/netd
am: 2ff3b5c0f4

Change-Id: I0957f2f9ca989f3ca701429b8cf4fa546826ce4b
2019-11-01 19:15:53 -07:00
Maciej Żenczykowski
2ff3b5c0f4 move networking bpf helpers to system/netd
Test: build, atest
Bug: 141532657
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If7b13a80d3db07da7c540dc7661e92ea8e0ad8c8
2019-10-31 01:04:49 -07:00
Xin Li
47086e9c40 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: Ib0092e265522d7389c550942c9740c3787a1d857
2019-10-30 11:50:41 -07:00
TreeHugger Robot
cd3a04e280 Merge "Skip QD1A.190821.011 in stage-aosp-master" into stage-aosp-master 2019-10-24 00:26:49 +00:00
Maciej enczykowski
0ac670a1da bpf: change how we detect device bpf support level
am: 8daa0b6070

Change-Id: I5f99e54059e401e9e8573249150b0d9c8325169e
2019-10-23 15:24:01 -07:00
Maciej Żenczykowski
8daa0b6070 bpf: change how we detect device bpf support level
Now that we're developing Android R and we know upgrades
will only be supported from Android P & Q, we no longer
need to check for Android pre-P (ie. O) - so we can remove
that check.

We also take the opportunity to slightly refactor the code
to make it more readable.

Note: it's not appropriate to backport this into any 'normal'
Q branch, since it *will* break 4.9-O devices upgrading to Q
userspace without upgrading the kernel to at least 4.9-P.

Test: builds, atest
Bug: 139501958
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iacb3c2db489061b3f278d8e971e44dd1a5c4c1e6
2019-10-23 07:31:24 +00:00
Xin Li
c5699fd992 Skip QD1A.190821.011 in stage-aosp-master
Bug: 141248619
Change-Id: I37c725007bee3b7210d62b69bc0833abf4524f80
2019-10-16 15:19:30 -07:00
Maciej enczykowski
ac70a88aa8 libbpf_android_test - add 'require_root: true' am: 1a4659c1ba am: 2b79aca859
am: b90500c5e5

Change-Id: I54918f99246dc9031a4c4658d97fb1d5740b2f00
2019-09-19 15:49:27 -07:00
Maciej enczykowski
b90500c5e5 libbpf_android_test - add 'require_root: true' am: 1a4659c1ba
am: 2b79aca859

Change-Id: Icf7ed8ecef55750ff4f2dfa973321f3eae5ee0a9
2019-09-19 15:42:48 -07:00
Maciej enczykowski
2b79aca859 libbpf_android_test - add 'require_root: true'
am: 1a4659c1ba

Change-Id: Ia910a637fe53a6cc3af69700638eae5545b3aac2
2019-09-19 15:37:57 -07:00
Maciej Żenczykowski
1a4659c1ba libbpf_android_test - add 'require_root: true'
Bug: 141272654
Bug: 141307514
Test: now passes
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I29f89838743aa4bab3bf7cc643891e33da5fffdf
2019-09-19 14:41:56 -07:00
Maciej enczykowski
c800757ef9 fix broken double close in BpfMapTest.cpp am: e6cbd40468 am: e756a927e7 am: 3b959063ef
am: d8f21f0eaa

Change-Id: I44e3f03f14a89530d03c8943d9f25f288fd87ca0
2019-08-10 05:56:17 -07:00
Maciej enczykowski
d8f21f0eaa fix broken double close in BpfMapTest.cpp am: e6cbd40468 am: e756a927e7
am: 3b959063ef

Change-Id: Ie56db7a700eb4b13bcdc5f661487391fa12af700
2019-08-10 05:47:27 -07:00
Maciej enczykowski
3b959063ef fix broken double close in BpfMapTest.cpp am: e6cbd40468
am: e756a927e7

Change-Id: I4c693c1cd37bec2dd356703e24826c733abea215
2019-08-10 05:38:03 -07:00
Maciej enczykowski
e756a927e7 fix broken double close in BpfMapTest.cpp
am: e6cbd40468

Change-Id: Icf3e5dd8056e5c58d62c0bd91fd00837fbaa9dce
2019-08-10 05:29:13 -07:00
Maciej Żenczykowski
e6cbd40468 fix broken double close in BpfMapTest.cpp
Bug: 139175951
Bug: 139205160
Test: atest libbpf_android_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I911ce9276e5f8b2278e459b5b11be8e7ccb3632f
2019-08-10 01:25:17 +00:00
android-build-team Robot
667b5fa140 Snap for 5674532 from efae2596a8 to qt-c2f2-release
Change-Id: I135c4c6e0d3a39f149e5e3efcb6ee368a1f40ff1
2019-06-20 03:04:22 +00:00
Android Build Merger (Role)
1e00c836a7 Merge "Revert "libprocessgroup users use libcutils" am: 855cf18f8b am: 5f3b546b33" into qt-r1-dev-plus-aosp 2019-06-19 06:06:24 +00:00
Zhijun He
ae8e5fc211 Revert "libprocessgroup users use libcutils" am: 855cf18f8b
am: efae2596a8

Change-Id: Ib18ad32dc2ffaf2beeac0f54b6867f5d3efb4ccc
2019-06-18 23:04:16 -07:00
Zhijun He
a6f2a2696f Revert "libprocessgroup users use libcutils" am: 855cf18f8b
am: 5f3b546b33

Change-Id: Id23f86affd4b2e7668c3777f90644c4423a2d3b7
2019-06-18 23:02:19 -07:00
Zhijun He
efae2596a8 Revert "libprocessgroup users use libcutils"
am: 855cf18f8b

Change-Id: I707da7fbad3dbbc8d1f49fd4ebd0f5f7596261b0
2019-06-18 22:50:48 -07:00
Zhijun He
5f3b546b33 Revert "libprocessgroup users use libcutils"
am: 855cf18f8b

Change-Id: I4dd6e78b36a74588405695af1cddd5a89ef1c713
2019-06-18 22:50:38 -07:00
Zhijun He
855cf18f8b Revert "libprocessgroup users use libcutils"
This reverts commit f0336cb586.

Reason for revert: breaks all camera use cases

Bug: 135568875

Exempt-From-Owner-Approval: revert, no build cop

Change-Id: Ie228b8dd167d4788c3cf570d0ff531e88a06a170
2019-06-19 04:50:36 +00:00
Steven Moreland
4e2e9d3095 libprocessgroup users use libcutils am: f0336cb586
am: dde3f0f74c

Change-Id: I242cacd21bb8c7a27c4d32b547ddfd72835646d1
2019-06-18 17:20:49 -07:00
Steven Moreland
ac40993c89 libprocessgroup users use libcutils am: f0336cb586
am: 5bdf785f63

Change-Id: Id69e276288e615a9998803c5494483c0603227e9
2019-06-18 17:17:22 -07:00
Steven Moreland
5bdf785f63 libprocessgroup users use libcutils
am: f0336cb586

Change-Id: I18b2c745e2b547c2835235cb5ddf5c27cfd828b7
2019-06-18 16:48:56 -07:00
Steven Moreland
dde3f0f74c libprocessgroup users use libcutils
am: f0336cb586

Change-Id: I1afec6580bf088a31133db4684483bf2150ef6f4
2019-06-18 16:48:44 -07:00
Steven Moreland
f0336cb586 libprocessgroup users use libcutils
libprocessgroup symbols are being moved into libcutils in order to
optimize linking/memory usage. libprocessgroup will no longer be
required in the future (however removing references to it will come
separately).

Bug: 135145426
Test: boot
Change-Id: Ie268ddbdb5a8b2eb254c956c8262aed8405752fa
2019-06-18 16:25:28 +00:00
android-build-team Robot
56b8a95ea4 Snap for 5663715 from d9787c2aa4 to qt-c2f2-release
Change-Id: Id3e4aff784c300ab87a55271783a4bd4dfedaa97
2019-06-15 23:17:39 +00:00