Commit graph

4 commits

Author SHA1 Message Date
Christopher Ferris
c151c67412 Fix compiler warnings.
Changed finds that use a string with a single character ("X"), to 'X'.

Remove using statements from header file.

Add a couple of missing includes.

Changed a couple of functions that take a string to const string& to
avoid extra copies.

Test: No warnings when compiled, unit tests pass.
Change-Id: I218ee0e6b6c7fb1c79d1337c1ce3d6f1e318a3cd
2019-02-01 15:48:19 -08:00
Chenbo Feng
5aee2f14a5 Add cgroup socket bpf kernel program support
Add support for cgroup socket filter program loading in bpfloader,
and create a uid permission map to store the uids that have INTERNET
permission.

Bug: 111560570
Bug: 111560739
Test: dumpsys netd trafficcontroller

Change-Id: I658f533d302cb594d7b36d4a3a2a70e394874c33
2019-01-28 15:21:59 -08:00
Maciej Żenczykowski
ffa7aadf75 bpf loader - add support for new schedcls type
which maps to BPF_PROG_TYPE_SCHED_CLS

Bug: 65674744
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7ca5912756c575e2c0667b9dae2d24471845e028
2019-01-24 23:16:10 -08:00
Joel Fernandes
d76a2004a6 Initial checkin for relocatable ELF loader and link with bcc
* Wrote a relocatable ELF loader from scratch. The loader library loads
all objects in /system/etc/bpf/, parses and fixes up eBPF instructions
based on relocation information, creates maps and programs and pins
them. A single API call without arguments is made which results in this
operation. The API has all the information it needs from the filesystem
and the ELF objects, so there is no configuration stored in the code
calling the loader API essentially making it zero conf. Initially this
will be used by time_in_state statistics collection using tracepoints.
In the future, netd's eBPF C code should be rewritten to use this
infrastructure and the old ELF loader can be gotten rid off. This is the
first step.

* Link libbpf with libbpf_android which will come from the external/ bcc
project. This will be used for tracepoint and perf eBPF support. In the
future it can be used for other things as kernel eBPF support advances.

This patch will be merged only after bcc is cloned into external/ to
prevent build breakage.

Bug: 112334572
Change-Id: Ic0fd9504e18031132d40bb627c5e44058d59c9f8
Signed-off-by: Joel Fernandes <joelaf@google.com>
2018-12-17 22:27:56 +00:00