Commit graph

301 commits

Author SHA1 Message Date
Suren Baghdasaryan
4528442fe4 [automerger skipped] Remove hardcoded cgroup v2 path am: 9217ccba51 am: 823ca6fd4e
am: 1a5d98b982 -s ours
am skip reason: change_id Ic9c47b52702767f9934f65d04bb91ab303b1d06e with SHA1 605ae310d4 is in history

Change-Id: I6e084576be0a95767395eef3aff3796926b14840
2019-02-04 21:16:18 -08:00
Suren Baghdasaryan
1a5d98b982 Remove hardcoded cgroup v2 path am: 9217ccba51
am: 823ca6fd4e

Change-Id: I85009d08161811f3a8d3be72624f9cc09de1f8df
2019-02-04 20:57:19 -08:00
Joel Fernandes
3365e895ae Add tests for BPF loader
am: 4845288a6e

Change-Id: Ie7149e369c82ad251a6afe4c701c07d9269622d6
2019-02-04 15:05:47 -08:00
Joel Fernandes
4845288a6e Add tests for BPF loader
Bug: 112334572
Change-Id: I4457ee9ea3044c5c9ecb6ebfd5ad4f5a2c11dce5
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-04 15:28:52 -05:00
Suren Baghdasaryan
823ca6fd4e Remove hardcoded cgroup v2 path
am: 9217ccba51

Change-Id: If1a17a86cddee4cf9e35544006900a3584f82fab
2019-02-03 20:12:01 -08:00
Suren Baghdasaryan
9217ccba51 Remove hardcoded cgroup v2 path
Replace hardcoded cgroup v2 root path with new libprocessgroup API calls.

Bug: 111307099
Test: builds, boots

Change-Id: Ic9c47b52702767f9934f65d04bb91ab303b1d06e
Merged-In: Ic9c47b52702767f9934f65d04bb91ab303b1d06e
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 16:58:40 +00:00
Suren Baghdasaryan
605ae310d4 Remove hardcoded cgroup v2 path
Replace hardcoded cgroup v2 root path with new libprocessgroup API calls.

Bug: 111307099
Test: builds, boots

Change-Id: Ic9c47b52702767f9934f65d04bb91ab303b1d06e
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 05:53:57 +00:00
Christopher Ferris
528da2604b Fix compiler warnings. am: c151c67412 am: c0402548cd
am: 401714e42b

Change-Id: I68b43d6f4f1adafd6aeaed298a6f50be2d186bfb
2019-02-01 18:02:22 -08:00
Christopher Ferris
401714e42b Fix compiler warnings. am: c151c67412
am: c0402548cd

Change-Id: I17a3e5063c58992d69835a9af41b5fb9d72e61bf
2019-02-01 17:58:41 -08:00
Christopher Ferris
c0402548cd Fix compiler warnings.
am: c151c67412

Change-Id: I5ade2daddc0db4571d2c79ceb085bdf5e5632570
2019-02-01 17:54:15 -08:00
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
9db827ea6f Add bpf program to control socket creation am: ef6d45e7cf am: 01806ba3e1
am: 1b479ffa8f

Change-Id: Idcc8f30c1156c51934df5533c5acf5972b2f867e
2019-01-30 13:12:23 -08:00
Chenbo Feng
f68eb5f463 Add cgroup socket bpf kernel program support am: 5aee2f14a5 am: f102a5435f
am: 2e7698a559

Change-Id: I9979db7e5ecb7a205abe491e7c0d0ff8f1d94f40
2019-01-30 13:12:17 -08:00
Chenbo Feng
1b479ffa8f Add bpf program to control socket creation am: ef6d45e7cf
am: 01806ba3e1

Change-Id: I1ce8457fd261bc0bd21eedc2bf0da1e9daa6d053
2019-01-30 13:06:30 -08:00
Chenbo Feng
2e7698a559 Add cgroup socket bpf kernel program support am: 5aee2f14a5
am: f102a5435f

Change-Id: I4624b14742e87aa39d4053ea87c1b4d4dccc7ffc
2019-01-30 13:06:24 -08:00
Chenbo Feng
01806ba3e1 Add bpf program to control socket creation
am: ef6d45e7cf

Change-Id: Id8ccc7d804816d8d445dc510c4768075f7f039b1
2019-01-30 13:01:16 -08:00
Chenbo Feng
f102a5435f Add cgroup socket bpf kernel program support
am: 5aee2f14a5

Change-Id: I3b38a275feb463edf2af4ba64c6b865571ebff51
2019-01-30 13:01:10 -08:00
Chenbo Feng
ef6d45e7cf Add bpf program to control socket creation
For new kernel that support cgroup socket filter, use bpf programs to
control the creation of inet socket.

Bug: 111560570
Bug: 111560739
Test: dumpsys netd trafficcontroller
Change-Id: I94efcdccfcd17f08c731caa700ea5797f2f56e7d
2019-01-29 18:58:03 -08:00
Steven Moreland
33e3b30d09 Merge "Replace clang-format with symlink." am: b78998c447 am: 74175c244a
am: 978a556189

Change-Id: Ideed1255351047038e2eb54b1c6e281d0b2ce764
2019-01-28 22:16:40 -08:00
Steven Moreland
978a556189 Merge "Replace clang-format with symlink." am: b78998c447
am: 74175c244a

Change-Id: I9862af5bf8ff878cbb6a2efda7981ecc964019e2
2019-01-28 21:37:08 -08:00
Steven Moreland
74175c244a Merge "Replace clang-format with symlink."
am: b78998c447

Change-Id: I5dcc53e877904ce06835417865d91697628dfd54
2019-01-28 20:07:02 -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
Treehugger Robot
b78998c447 Merge "Replace clang-format with symlink." 2019-01-28 20:16:54 +00:00
Maciej enczykowski
9a7db5b948 bpf loader - add support for new schedcls type am: ffa7aadf75 am: e5a32ae658
am: f73e8c3112

Change-Id: I4cc8da478f1d6d1edcb32070e8182e7a55dbb1fc
2019-01-25 02:20:20 -08:00
Maciej enczykowski
f73e8c3112 bpf loader - add support for new schedcls type am: ffa7aadf75
am: e5a32ae658

Change-Id: I18bf63463b23844d6fec8b8b60599f7d8c46f244
2019-01-25 02:16:15 -08:00
Maciej enczykowski
e5a32ae658 bpf loader - add support for new schedcls type
am: ffa7aadf75

Change-Id: I60395d1d0db2551f704b204fbe166ab1f34a6f8d
2019-01-25 02:12:12 -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
Chenbo Feng
c8c3020a50 Merge "Do not take cumulative network stats anymore" am: 5b2a4f4159 am: c451e95209
am: fd6718e01b

Change-Id: I846bcbde5be8b6ecb83e93280de68a1fc2486a03
2019-01-24 11:50:41 -08:00
Chenbo Feng
fd6718e01b Merge "Do not take cumulative network stats anymore" am: 5b2a4f4159
am: c451e95209

Change-Id: Icdfadb3269bb746bae6a630a8a9fdd0682eeee58
2019-01-24 11:13:12 -08:00
Chenbo Feng
c451e95209 Merge "Do not take cumulative network stats anymore"
am: 5b2a4f4159

Change-Id: I189c5a1cfc24585d887d38b94e3a04870e9e2286
2019-01-24 10:55:26 -08:00
Chenbo Feng
5b2a4f4159 Merge "Do not take cumulative network stats anymore" 2019-01-24 18:16:25 +00:00
Connor O'Brien
0d8c4105f7 Add time_in_state.o to build am: c8885ccf3f am: 5dfa15cadb
am: a7de47192b

Change-Id: I8ea1b8cfdecee7b13340d0f0522f237dbef8add1
2019-01-23 15:53:54 -08:00
Connor O'Brien
a7de47192b Add time_in_state.o to build am: c8885ccf3f
am: 5dfa15cadb

Change-Id: I5ac698538c5e0c1550c871705bc2dba00a0e8d3b
2019-01-23 15:49:49 -08:00
Connor O'Brien
5dfa15cadb Add time_in_state.o to build
am: c8885ccf3f

Change-Id: Ic46a2f95767377390af60b3209bfe7ec682ca877
2019-01-23 15:44:17 -08:00
Connor O'Brien
c8885ccf3f Add time_in_state.o to build
bpfloader now has CAP_SYS_ADMIN, which allows it to load programs like
time_in_state.o that use eBPF's tracepoint support.

Test: make bpfloader
Test: ls /sys/fs/bpf/ shows time_in_state progs and maps are created
Bug: 112334572
Bug: 78498733
Change-Id: Iedff50381c9ee2b3bdfc6c01b2e2ccaeaf0917d5
Signed-off-by: Connor O'Brien <connoro@google.com>
2019-01-23 12:09:19 -08:00
Chenbo Feng
9cd8f14ed0 Do not take cumulative network stats anymore
Use two maps to record the details of network stats and swap and clean
up after system server pulls the stats. The kernel program checks the
bpf map currently enabled before updating the stats and updates on the
corresponding map. Remove the TAG_STATS_MAP since we don't need to worry
about uid stats overflow problem. All the stats can be stored in the
same map until system server scrapes the stats and clean it up.

Bug: 79171384
Test: dumpsys netd trafficcontroller
      CtsUsageStatsTestCases

Change-Id: Ic79e382f51bf21eee78c4cac5a8a97edaf3654cd
2019-01-22 18:40:10 -08:00
Steven Moreland
65e2b23220 Replace clang-format with symlink.
Automatic consistency.

Bug: 122835115
Test: manual
Change-Id: I3ca92906c3bde25d3314ea3da91f1c42d09332f4
2019-01-18 14:26:33 -08:00
Joel Fernandes
f83ce2a102 Set bpf.progs_loaded property when programs finish loading am: d3ec871017 am: b4ea87be03
am: d3e821739d

Change-Id: I5053bd645c065fd5cd2d611d93a72b9cf6d7be3e
2019-01-14 15:50:15 -08:00
Joel Fernandes
fc1338768e bpfloader: Make it an init service am: 6e1341ef20 am: 71ae90e0f2
am: a95fc2631b

Change-Id: Idba3781a765b36c0a3a0b2228fc98f51fae99084
2019-01-14 15:50:05 -08:00
Joel Fernandes
d3e821739d Set bpf.progs_loaded property when programs finish loading am: d3ec871017
am: b4ea87be03

Change-Id: I01d613fab6393ea54c0cd1508eac3866999e08a8
2019-01-14 15:01:42 -08:00
Joel Fernandes
a95fc2631b bpfloader: Make it an init service am: 6e1341ef20
am: 71ae90e0f2

Change-Id: Ifd0ff0462a86998de551183f96826da5f4e90b9b
2019-01-14 15:01:32 -08:00
Joel Fernandes
b4ea87be03 Set bpf.progs_loaded property when programs finish loading
am: d3ec871017

Change-Id: Ia26b08e968e04085b9e22ef70711f19b4f2843ac
2019-01-14 14:06:42 -08:00
Joel Fernandes
71ae90e0f2 bpfloader: Make it an init service
am: 6e1341ef20

Change-Id: I40258fe60be096d614ecf838f11a2fc2d097e2ae
2019-01-14 14:06:35 -08:00
Joel Fernandes
d3ec871017 Set bpf.progs_loaded property when programs finish loading
The property bpf.progs_loaded will be used by services expecting BPF
programs to be loaded and wait before they are loaded.

Bug: 112334572

Change-Id: I19daa0caa84e2659e8790f0dd551d95ab824e13b
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-01-11 09:02:11 -05:00
Chenbo Feng
d4f64096d3 New bpfloader netd kernel program am: c1dd7648b1 am: 8a9681b360
am: f6c30042b7

Change-Id: Ia1be0c726c98d1aa41dfb198888d6ce80a3319fc
2019-01-09 11:35:00 -08:00
Chenbo Feng
f6c30042b7 New bpfloader netd kernel program am: c1dd7648b1
am: 8a9681b360

Change-Id: I5d686647b75c5ab0beb4ddf6c9327a719ba29e71
2019-01-09 11:15:50 -08:00
Chenbo Feng
8a9681b360 New bpfloader netd kernel program
am: c1dd7648b1

Change-Id: I543955a4d19bc6fd4cd79b6bdd6ea547de217b63
2019-01-09 10:53:27 -08:00
Joel Fernandes
6e1341ef20 bpfloader: Make it an init service
With this, bpfloader does not need to be started by netd and will load
at boot time.

Bug: 112334572
Change-Id: Iad777ed0a5bb5995dbf2fc176a220292a4c5e41f
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-01-07 20:17:42 -05:00
Chenbo Feng
c1dd7648b1 New bpfloader netd kernel program
Change the netd bpf program to the new format. Adding map definition and
necessary helper functions to the kernel program code. Move the netd bpf
programs out of bpfloader to a new directory.

Test: dumpsys netd trafficcontroller
Bug: 112334572
Change-Id: I9287285d188e966193532b1522b5d3e67e32e930
2019-01-07 20:17:42 -05:00
Chih-Hung Hsieh
3da0528055 Remove unused using decls. am: 18d8bfcfe9 am: df2c186b85
am: 762b1d1bee

Change-Id: Ic194b43f2f5aa8a7a9f9cd620a679af7b89f9fdc
2018-12-19 16:09:36 -08:00