Commit Graph

3295 Commits

Author SHA1 Message Date
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
Jeff Sharkey
e2a8a0b310 Merge "Expose quota status for active network." 2011-08-03 17:05:21 -07:00
Chia-chi Yeh
4ac474e88b NativeDaemonConnector: offload callbacks to another thread.
Now callbacks can communicate to the same daemon without causing a
deadlock. This also improves the latency of calls because they no
longer need to wait for the callbacks for the pending events.

Change-Id: I153fcf16bd64de79ee1c1a57d3cfdb12b354cf47
2011-08-03 14:42:11 -07:00
Jeff Sharkey
84b60d6489 Expose quota status for active network.
Create API to expose quota status derived from underlying network
policy.  This is designed to support applications making informed
decisions when performing network requests.

Fix bug with random stats generation, and write policy when changing
restrict background data flag.  Deprecate EXTRA_NETWORK_INFO, since
it varies based on UID.

Bug: 4517283, 5088603
Change-Id: Ic6893a8967f69937e466be226ba7bb86ef5a5d2d
2011-08-02 18:19:54 -07:00
The Android Automerger
5bbb7ca556 merge in ics-release history after reset to master 2011-08-02 06:53:22 -07:00
Jeff Sharkey
7407e09009 Add operation counts to network statistics.
Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats.  Internally is stored at
network layer, but should belong at data layer.  Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory.  Prevent double-counting by ignoring values from
first snapshot.  Watch for duplicate /proc/ entries.  Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09
2011-07-29 22:24:01 -07:00
The Android Automerger
e10b030925 merge in ics-release history after reset to master 2011-07-25 06:48:14 -07:00
repo sync
0c6ebed1df Updated: Wi-Fi p2p framework
First stage. Get the bones in right now even though
we are not ready on the native side.

Once, we have things underneath working - we will further update the
framework

Change-Id: I4a7dab5cd4267373dc5f8989ae4122f91c384ed5
2011-07-24 10:08:47 -07:00
The Android Automerger
2198befb62 merge in ics-release history after reset to master 2011-07-20 06:47:27 -07:00
Alon Albert
2c295f0c6d Add a getter for the active tag
Change-Id: I597e041867fba7efae41feea63fa196bc10e4aa2
2011-07-19 22:04:22 -07:00