summaryrefslogtreecommitdiff
path: root/libbpf_android/BpfMapTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* SKIP_IF_BPF_NOT_SUPPORTED is a no-opMaciej Żenczykowski2021-01-121-22/+0
| | | | | | | | | Android S requires devices to support eBPF. Test: builds, atest, TreeHugger Bug: 167500195 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I62fb97f79103515f5a2fd531cfa36356d21a4a6f
* More missing calls to Result::ok() in libbpf_android testsBernie Innocenti2020-02-101-14/+14
| | | | | Test: m checkbuild Change-Id: Idb70b975e3c3bcbaa78cb493ec8f66b9b625ef74
* make BpfMap.reset() harder to useMaciej Żenczykowski2020-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Long term we don't even want reset() to exist. It's simply not useful since only the bpfloader can create maps, and thus all we can do is construct from pre-existing pinned bpf path - and we should never destroy/unpin/delete these. Similarly the move constructor is probably spurious. Basically the only real use for reset() is in tests, and even there the overall utility is not clear. Hence, in the mean time, make it harder to use incorrectly, and harder to use in general. To do that we get rid of reset() -> you must call reset(-1) and we eliminate the ability to call reset(unique_fd) which has unclear fd-leaking semantics. Also remove a spot where it is called spuriously. Test: build, atest Bug: 129773125 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ia018224aca0005ab68809b350595485ccd3f1bd3
* BpfMapTest.cpp - construct BpfMap from type/size/flags and not from fdMaciej Żenczykowski2020-01-291-24/+8
| | | | | | | | Test: build, atest mMapFd no longer shows up in this file Bug: 129773125 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ie49f0027d0f04565426ed800b079800b364dd049
* libbpf_android: remove libnetdutils depSteven Moreland2020-01-211-33/+33
| | | | | | | | | | | Remove libnetdutils dependency because bpf is being used for things other than networking these days, and we don't want to make libnetdutils vendor-available in the future. libbase provides an alternative type now. Bug: 140330870 Test: atest libbpf_android_test netd_integration_test netd_unit_test libnetdbpf_test bpf_module_test Change-Id: I72ae8cd7f58a49bfc7dcb914a332a4c4bad5dea5
* fix broken double close in BpfMapTest.cppMaciej Żenczykowski2019-08-101-15/+22
| | | | | | | | Bug: 139175951 Bug: 139205160 Test: atest libbpf_android_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I911ce9276e5f8b2278e459b5b11be8e7ccb3632f
* Add helper function to set rlimit for testsChenbo Feng2019-04-101-0/+2
| | | | | | | | | | Add a helper function to set sufficient MEMLOCK rlimit for bpf related unit tests. Bug: 119279144 Bug: 129246448 Test: libbpf_android_test Change-Id: I5390f4d3b21436abff69a661d1c6e6a6749542ed
* BpfMap.getOrCreate(size, path, type) -> BpfMap.init(path)Maciej Żenczykowski2019-04-011-1/+1
| | | | | | | | | | | | We don't have the appropriate selinux privs to create the maps anyway. Test: builds (when combined with system/netd change) 'git grep getOrCreate' in system/{bpf,netd} comes up empty atest netd_unit_test netd_integration_test libbpf_android_test Bug: 65674744 Bug: 129654883 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Idffbce5b28b723943c6495cfafdecddc7a0f4e67
* BpfMap - remove mPinnedPath, getPinnedPath, pinToPathMaciej Żenczykowski2019-04-011-23/+3
| | | | | | | | | Test: builds, git grep 'mPinnedPath|getPinnedPath|pinToPath' comes up empty atest netd_unit_test netd_integration_test libbpf_android_test Bug: 65674744 Bug: 129654883 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Iad84ce7c74bef77e63cf63563d67b7501dd0165b
* Code style clean upChenbo Feng2018-11-281-10/+10
| | | | | | | | | Apply the git clang format on the bpf project to make sure the existing code compliance with the standard. Test: project compiles and bpfMapTest pass. Bug: 112334572 Change-Id: I4774aa2a197be2c671f6fb307c1fc9b71edfeeec
* Skip the bpf native tests on old devicesChenbo Feng2018-11-211-0/+24
| | | | | | | | | | For older devices that doesn't have bpf support, skip the bpf native tests so we don't get false alarms. Fixed some compiler warning and added the clang-format check. Test: ./libnetdbpf_test/libnetdbpf_test Bug: 119526856 Change-Id: Icb73a8ee9b9dff9a0da28b96578e1245f1f3724f
* Rename libbpf to libbpf_androidChenbo Feng2018-11-081-0/+269
Rename the bpf support library in android to libbpf_android to make it compatible with external bcc project. Fix the Android.bp file to prevent build break. Bug: 112334572 Test: No build breakage. Change-Id: I24ae8aaf8ca8afdded5e46d21f0deec68d6030da