Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f434e86a authored by Chenbo Feng's avatar Chenbo Feng
Browse files

Take non-incremental network stats from bpf maps

Use two maps to record the details of network stats. Swap and clean up
after system server pulls the stats. The TAG_STATS_MAP is removed since
we don't need to worry about losing the stats for each uid if the eBPF map
is full. All the stats can be stored in the same map now and it is very
unlikely to overflow the map before system server scrapes the stats and
clean it up. Add a benchmark test to measure the performance of creating
and closing pf_key socket. A typical result is:
------------------------------------------------------------------------
Benchmark                                 Time           CPU Iterations
------------------------------------------------------------------------
BpfBenchMark/WaitForRcu/1             86615 ns      54858 ns      20209

Bug: 79171384
Test: dumpsys netd trafficcontroller
      NetworkUsageStatsTest

Change-Id: Ic79e382f51bf21eee78c4cac5a8a97edaf3654cd
parent 528af60e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment