Commit graph

6 commits

Author SHA1 Message Date
Chenbo Feng
0a1a9a11d9 Add helper function to set rlimit for tests
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
2019-04-10 05:54:00 +00:00
Maciej Żenczykowski
52108bf52c BpfMap.getOrCreate(size, path, type) -> BpfMap.init(path)
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
2019-04-01 16:54:08 -07:00
Maciej Żenczykowski
04d88b7576 BpfMap - remove mPinnedPath, getPinnedPath, pinToPath
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
2019-04-01 16:54:08 -07:00
Chenbo Feng
1f20ad3d78 Code style clean up
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
2018-11-28 11:31:36 -08:00
Chenbo Feng
249e2f869e Skip the bpf native tests on old devices
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
2018-11-21 12:11:55 -08:00
Chenbo Feng
79a4da2d1e Rename libbpf to libbpf_android
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
2018-11-08 11:32:31 -08:00
Renamed from libbpf/BpfMapTest.cpp (Browse further)