Commit Graph

2704 Commits

Author SHA1 Message Date
The Android Automerger
77622cdc0b merge in ics-release history after reset to master 2011-10-05 06:58:56 -07:00
Jeff Sharkey
f1369459ed Track xtables summary, move tether stats, time.
Begin tracking xtables summary of data usage to compare with values
reported from /proc/net/dev.  Roll tethering directly into UID stats
to trigger UID stats persisting when crossing threshold.

Include xtables summary and authoritative time in samples.

Bug: 5373561, 5397882, 5381980
Change-Id: Ib7945522caadfbe0864fdf391582dc820f4f371e
2011-10-03 17:21:05 -07:00
The Android Automerger
cc800bb2d2 merge in ics-release history after reset to master 2011-09-27 07:00:12 -07:00
Jeff Sharkey
8cddd4a5c7 Overlay to configure data usage network types.
Specify which network types should be counted when computing data
usage totals.

Bug: 5361005
Change-Id: I830caed1a29199892d209a692b50f8b3e144cafe
2011-09-26 10:50:30 -07:00
The Android Automerger
a3bcf5f03c merge in ics-release history after reset to master 2011-09-26 06:59:53 -07:00
Jeff Sharkey
6a2cbb63b3 Watch network subtype, tethering teardown, empty.
Watch for changes to telephony network subtype, and update iface
mapping to persist stats under correct type.  Update network stats
before removing tethering NAT rules.

Skip recording that would create empty historical buckets.  Query UID
stats before iface stats to always skew positive when counters are
actively rolling forward.

Bug: 5360042, 5359860, 5335674, 5334448
Change-Id: I8aa37b568e8ffb70647218aa1aff5195d3e44d5a
2011-09-22 16:19:06 -07:00
The Android Automerger
39fba68103 merge in ics-release history after reset to master 2011-09-22 07:00:05 -07:00
The Android Open Source Project
f7d44fa995 Reconcile with ics-factoryrom-release
Change-Id: I401a78a2216c8c4042f6f48b4e882035cbccfc82
2011-09-21 06:19:16 -07:00
The Android Automerger
97fb953b02 merge in ics-factoryrom-release history after reset to ics-factoryrom 2011-09-20 20:43:04 -07:00
The Android Automerger
9e76007b3d merge in ics-release history after reset to master 2011-09-20 07:00:19 -07:00
Jeff Sharkey
8d000c17f9 am 88b18eb8: Merge "Upload correct txPackets count." into ics-factoryrom
* commit '88b18eb8c2034e9de35482cc737ef8d608d55867':
  Upload correct txPackets count.
2011-09-19 21:44:00 -07:00
Jeff Sharkey
ed94a3c766 Upload correct txPackets count.
Bug: 5321340
Change-Id: Ie4dc7a91bf1cdc4d64c75ff09ae0cdd0fb141b5d
2011-09-19 18:37:11 -07:00
The Android Automerger
fac40c2576 merge in ics-release history after reset to master 2011-09-19 06:59:57 -07:00
Jeff Sharkey
8d8ecaef37 Sample atomic network stats buckets, full poll.
When sampling network stats, always use atomic buckets instead of
interpolating.  Always poll iface and UID together so we distribute
into buckets equally.  Move stale bucket trimming to just before
writing stats.

Bug: 5321340
Change-Id: I78a2226778a79c875f3668336e39ea24a7b4d5c4
2011-09-18 16:27:21 -07:00
Jeff Sharkey
ffa6efd8e0 am aaf30173: (-s ours) Merge "DO NOT MERGE: Sample atomic network stats buckets, full poll." into ics-factoryrom
* commit 'aaf301736e923db15918617145069658696be453':
  DO NOT MERGE: Sample atomic network stats buckets, full poll.
2011-09-18 16:21:38 -07:00
Jeff Sharkey
b10824574c DO NOT MERGE: Sample atomic network stats buckets, full poll.
When sampling network stats, always use atomic buckets instead of
interpolating.  Always poll iface and UID together so we distribute
into buckets equally.  Move stale bucket trimming to just before
writing stats.

Bug: 5321340
Change-Id: I78a2226778a79c875f3668336e39ea24a7b4d5c4
2011-09-18 16:17:51 -07:00
Jeff Sharkey
c65812835d am 3d1d57dc: Merge "Collect and persist tethering stats." into ics-factoryrom
* commit '3d1d57dcdb02ace6af5810bd4ec3f8fad5fc1799':
  Collect and persist tethering stats.
2011-09-18 16:17:39 -07:00
The Android Automerger
9ccf078edb merge in ics-release history after reset to master 2011-09-18 07:00:21 -07:00
Jeff Sharkey
987f5ff357 Collect and persist tethering stats.
Use new "gettetherstats" netd command to retrieve statistics for
active tethering connections.  Keep tethering poll events separate
from UID poll, even though they end up same historical structures.

Bug: 5244846
Change-Id: Ia0c5165f6712c12b51586f86c331a2aad4ad6afb
2011-09-16 16:05:51 -07:00
Ashish Sharma
468a90a808 Merge "Add packet counts to uid and iface stats. Needed to add Ethernet overhead to uid_stats (IP level) to compare with interface stats (Ethernet level)." 2011-09-15 14:30:40 -07:00
Ashish Sharma
4b8629c4bd Add packet counts to uid and iface stats.
Needed to add Ethernet overhead to uid_stats (IP level)
to compare with interface stats (Ethernet level).

Change-Id: Ia6324c21a868eea5ad3b67f546c9d10c7fb64172
2011-09-15 12:20:27 -07:00
The Android Automerger
e6116f9f87 merge in ics-release history after reset to master 2011-09-15 06:34:24 -07:00
Jeff Sharkey
4d675fdcf6 Network stats flag to force complete poll.
Devices currently delay collecting UID stats during common operations
like global alerts to reduce parsing load.  Here we introduce a flag
to always collect UID and iface stats together to aid debugging.

Bug: 5321340
Change-Id: Ia8e1daf1a6f9d5f5cf1f64a04b6b6766ee965ab6
2011-09-14 19:47:05 -07:00
The Android Automerger
7988f6d310 merge in ics-release history after reset to master 2011-09-14 06:34:13 -07:00
Jeff Sharkey
23f0af822a Remove deprecated TrafficStats API.
Bug: 5314214
Change-Id: If7dc3ef012a0e998e83ab4fef27ff19398d3e14c
2011-09-13 20:43:10 -07:00
The Android Automerger
58841dde81 merge in ics-release history after reset to master 2011-09-13 06:34:10 -07:00
Jeff Sharkey
869f9e165b Data usage structure optimizations.
Driven by traceview hotspots found in Settings UI.

Change-Id: I614a049523c526b7fcd12fffdf53a3e4723623e4
2011-09-12 16:13:20 -07:00
The Android Automerger
71454d62da merge in ics-release history after reset to master 2011-09-08 06:34:13 -07:00
Jeff Sharkey
ede64a7a65 Merge "Poll UID stats during iface changes, enforce idx." 2011-09-07 21:41:05 -07:00
Jeff Sharkey
d905762784 Poll UID stats during iface changes, enforce idx.
When ifaces change, poll UID stats without persisting, since they
depend on knowing active iface to store correctly.  Log dropped UID
stats when iface is unknown.  Switch to using flags when calling
performPoll().

Enforce that "idx" values are consistent from xt_qtaguid.  Transition
to using Log.wtf() for important checks, mostly around file I/O,
kernel stats parsing, and kernel module control.  Increase stats
persist threshold to 2MB to reduce churn.

Bug: 5269476, 5270106
Change-Id: I721215bfb65127f95775c71cf135e907cd567e92
2011-09-07 18:06:30 -07:00
Irfan Sheriff
459657bab0 Use hasSystemFeature() API to check for p2p
Bug: 5267396
Change-Id: I4ff3f77c15322564f63beea793c4585cece596e0
2011-09-07 14:36:32 -07:00
The Android Automerger
6ee8c33aa8 merge in ics-release history after reset to master 2011-09-02 16:02:32 -07:00
Jeff Sharkey
b63138c9b9 Sample network statistics for sanity check.
After detailed poll events, sample high-level network statistics to
sanity check iface totals against UID totals.

Bug: 5248382
Change-Id: I1c1fbb7c094c9ff0c9dde416467c563dda68f478
2011-09-01 15:07:19 -07:00
The Android Automerger
31951e7907 merge in ics-release history after reset to master 2011-08-30 13:42:46 -07:00
The Android Automerger
49c215f9f4 merge in ics-release history after reset to master 2011-08-30 12:45:34 -07:00
The Android Automerger
abaf3d80b2 merge in ics-release history after reset to master 2011-08-30 06:33:59 -07:00
Jeff Sharkey
b4d8c1fd1c Introduce immediate CONNECTIVITY_ACTION variant.
New broadcast that is dispatched immediately after connectivity
changes have been handled by ConnectivityService, bypassing any
applicable CONNECTIVITY_CHANGE_DELAY.

Also protect CONNECTIVITY_CHANGE broadcasts, since they should only
be sent by system.

Bug: 5198167
Change-Id: I75f1fb44b21da1879f0ab960bcaa481126d70fde
2011-08-29 16:10:43 -07:00
The Android Automerger
7f1160b40b merge in ics-release history after reset to master 2011-08-29 06:33:59 -07:00
Jeff Sharkey
dcaeff3175 Always splice historical data stats, debug info.
When reading network counters, always splice in xt_qtaguid values
to avoid counting backwards. Test to verify.

Remove verbose logging around global alerts, and add dumpsys debug
info for NMS and MDST. Also fix subtle bug around stats persisting
and dumping.

Bug: 5212893, 5211028
Change-Id: I783e5286637a67ee2dd2b09878198711a926d0cb
2011-08-26 14:19:54 -07:00
Jeff Sharkey
60ca02379f Data usage buckets active time, parsing ISE.
When recording data usage, measure the actual active time, since
buckets can be quite long.  Offer incrementOperationCount() version
that reads thread stats tag for caller.  Rethrow any NPE as ISE
during stats parsing, which callers already handle.

Bug: 5171812, 5184508, 5180659
Change-Id: I6da80ccc0162be68bee279529e3a23b6f98ebd87
2011-08-24 16:00:39 -07:00
Jeff Sharkey
93db945091 Register for kernel global data usage alerts.
Instead of polling every 15 minutes, register for alerts that trigger
when system-wide traffic passes a threshold.  Still mixed with polling
to persist UID stats, but relaxed to 30 minutes.  Currently watches
for every 512kB.

Make persistence decision separately for network versus UID, and use
total delta bytes when making decision.  Use light bootstrap during
systemReady() instead of heavy poll, which had been force-loading all
UID data unnecessarily.

Bug: 5023631
Change-Id: I04b723d6c4bf872fb1028071122dba66a8e1b576
2011-08-23 18:46:14 -07:00
The Android Automerger
b13942e4ef merge in ics-release history after reset to master 2011-08-16 06:34:02 -07:00
Jeff Sharkey
2665eeb9d4 Merge "Foreground/background network stats using sets." 2011-08-15 18:44:15 -07:00
Jeff Sharkey
806d1fdf9a Foreground/background network stats using sets.
Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background.  Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage.  Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
2011-08-15 17:30:25 -07:00
Jeff Sharkey
7b331c0451 Add NativeDaemonConnector users to watchdog.
To catch instances where NativeDaemonConnector hangs while executing
commands, add users to system_server watchdog.  Also moved qtaguid
enabler to separate thread to prevent blocking systemReady().

Bug: 5145437
Change-Id: I4c6c1dc09864a1c05f9486a31faa1b366548e911
2011-08-10 13:42:01 -07:00
The Android Automerger
220a11fbba merge in ics-release history after reset to master 2011-08-10 06:33:53 -07:00
The Android Automerger
2f3e786008 merge in ics-release history after reset to master 2011-08-05 11:17:03 -07:00
Jeff Sharkey
0c001477c2 Fix random stats generation for debugging.
Change-Id: I53f0e9ea9b15fbf7b99886ea8604eda8d3958d8d
2011-08-05 11:09:46 -07:00
The Android Automerger
aa6a2911b7 merge in ics-release history after reset to master 2011-08-04 06:51:53 -07:00
Jeff Sharkey
c76817d370 Network stats with varint, omit parcel fields.
Persist NetworkStatsHistory using variable-length encoding; since
most buckets have small numbers, we can encode them tighter. Initial
test showed 44% space savings. Also persist packet and operation
counters.

Let NetworkStatsHistory consumers request which fields they actually
need to reduce parcel overhead.

Tests for verify varint and history field requests, also verify end-
to-end by persisting history into byte[] and restoring. Expose
bandwidth control enabled state. Extend random generation to create
packet and operation counts. Moved operation counts to long.

Fix bug that miscalculated bytes since last persist, which would
cause partial stats loss when battery pulled.

Bug: 4581977, 5023706, 5023635, 5096903
Change-Id: If61e89f681ffa11fe5711471fd9f7c238d3d37b0
2011-08-03 17:21:07 -07:00