Chenbo Feng 828f1b45fb Add bpf support for NetworkStatsFactory
Add the native method used to read the detail information of network
stats from bpf maps. The native method of NetworkStatsFactory should
choose the correct implementation to get the stats detail depending on
the kernel version. Currently the bpf result is printed as a reference
and the actual behavior of NetworkStatsFactory should not change.

Test: NetworkStatsFactory related cts test should not fail.
Bug: 30950746
Change-Id: I4715a23559b5b2306bd556cea0431f0ed172a993
2018-01-23 00:34:53 -08:00
..

These benchmarks use the Caliper benchmark framework, and can be
run on a remote device using Vogar:

http://code.google.com/p/caliper/
http://code.google.com/p/vogar/

-------------------------

Quick Command Line Reference:

# Build vogar and dependencies.
$> mmma -j32 external/vogar

# First make sure art has permissions to dalvik-cache, otherwise it will run slower with interpreter.
$> adb root

# Run vogar in benchmark mode, telling it to use app_process (not dalvikvm which is default)
# Otherwise you will likely crash with UnsatisfiedLinkError despite having correct JNI code.

$> vogar --mode app_process --benchmark path/to/Benchmark.java

# Sometimes your benchmarks might time out, if so increase the timeout:
# (--timeout goes to vogar, and --time-limit goes to caliper)
$> vogar --timeout 1000 --mode app_process --benchmark path/to/Benchmark -- --time-limit 9999s