History log of /frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9a865ec91cf32d41496a28d800279cd86832b027 18-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: revert large ringbuffers for userdebug/eng

When the WiFi code is sufficiently mature, we'll use
this patch to return to using small ring buffers
on all builds.

Note that this patch is not a literal/full revert of
CL:1048267. The reason for the more focused change
is to minimize merge conflicts, in case other code
changes by the time this CL lands.

BUG=28822174
TEST=unit tests

Change-Id: I9facadf8aaf779e0627b15815a426b86bde692a1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
1bf155710ada7a6ee27453a120690d2c91a0fec5 19-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: fetch packet fate on dump()

We've observed that it's tricky to detect when a connection
fails. Consequently, even if the user is careful to generate
a bugreport while the device is in the failed state, the
bugreport will not include packet fate data for the most
recent connection.

Improve the utility of packet fate, by fetching the most
recent fate on the call to dump(). With this change in place,
we'll get packet fates for the most recent connection
attempt (even if it's still in progress).

BUG=28849396
TEST=unit tests, manual

Manual test
- configure bullhead for open network
- configure bullhead for wpa-2 network, wrong password
- let bullhead fail connecting to wpa-2 network
- let bullhead succeed connecting to open network
$ adb dumpsys > /tmp/dumpsys
$ grep 'fates ---' /tmp/dumpsys
--------------------- Last failed connection fates ----------------------
--------------------- Latest fates ----------------------

Change-Id: Iaeb2584020f70ac5d2f3139bac72ea07a7ddce81
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
eaf6303a081b4a7f2231b5053099da7a1c16b7bd 18-May-2016 mukesh agrawal <quiche@google.com> WifiNative: add wallclock timestamps for packet fate

Packet fate reports are timestampped in a different format than
logcat messages. This makes it hard to correlate packet fate
summaries with other system activity.

Resolve this, by adding wall-clock timestamps to packet fate
summaries.

BUG=28701632
TEST=manual test

Manual test:
- set bullhead to non-GMT timezone
- install build on bullhead
- trigger connection failure
- verify that walltime column is in the right ballpark,
relative to logcat messages

Change-Id: I3aed8d9acca42f0ef0cc4f2f2fbdabdde33ce4c8
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
8df302f5b9c647f69acee24e09fa20d8b5c54c4a 18-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: use large ringbuffers on eng/userdebug

We're having trouble resolving some field reports, due
to insufficient time coverage in the HAL ring buffers.

Increase the ringbuffer size of eng/userdebug builds,
to make it easier to debug issues reported by
dogfooders.

This change will be reverted closer to launch.
(b/28822174 has been filed for the reversion.)

BUG=28729317
TEST=unit tests

Change-Id: I5884dee05db79245d211a457ff44b5e7b96ddbcb
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
0b775f08887d4d52e57a06c6a8680aa10a1c7bb8 21-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "WifiLogger: fix bug in HAL callback registration" into nyc-dev
956fd40b6145c4aba9160e10bfc1ea609873ce8d 20-Apr-2016 mukesh agrawal <quiche@google.com> WifiLogger: fix bug in HAL callback registration

When we call WifiLogger.startLogging(), WifiLogger
may or may not register callbacks for ring-buffer
data delivery, and WiFi alerts.

Whether or not WifiLogger registers the callbacks
depends on whether or not the callbacks have already
been reigstered. If WifiLogger has already registered
callbacks, then a new call to startLogging() will
skip callback registration.

Now, it's not entirely clear if this already-registered
check is necessary. It is certainly conceivable that the
HAL implementations allow us to replace existing callbacks,
without explicitly removing the existing callbacks first.

But, the necessity of the check aside, the immediate
problem is that the already-registered check fails to
handle the case where an early registration failed.

This CL revises the code, to handle this case.

While there:
- Fix some whitespace issues.
- Remove unnecessary comment about the effects of
resetLogHandler(). (Even if the comment _were_ necessary,
it should be part of the Javadoc for resetLogHandler().)

BUG=28274991
TEST=(new) unit tests, manual

Manual test:
- boot device
$ adb shell dumpsys | grep -A1 'ring-buffer = driver_prints_rb'
ring-buffer = driver_prints_rb
<base64 encoded data...>

Change-Id: I04e9bc1863aaf5bda00ca9cf8dc35696ae1e5f24
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
590f3fc2045389d5ef274c4b3bd6162d93b1a0ac 13-Apr-2016 Samuel Tan <samueltan@google.com> Log summarized packet fate reports

When verbose debugging is not turned on, log
summarized packet fate reports that include the
timestamp, direction, fate, protocol, and type of the
network frame, but nothing more. These one-line
summaries will be logged to the system dump in
table format.

BUG: 28150622
TEST: 'runtest frameworks-wifi' passes.
TEST: Manually trigger a WiFi connection failure (e.g. enter
wrong password for a secured network), and examine the
output of 'adb shell dumpsys' for the logged packet fate
summaries.

Change-Id: Id4cc9c3cdc85d209788e0eb1c51e5a47e04d0a6a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
2ecb62764d26c3f0d95a9dc5c0a616af1b2bf8de 12-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: nuke verbose logs on no-verbose

When a user disables verbose Wi-Fi logging, they
probably don't want to retain firmware dumps or
driver dumps. Similarly for packet fate logs (at
least in raw form).

Nuke such data on entering non-verbose mode,
accordingly.

While there: update reportConnectionFailure(),
to use the recently added isVerboseLoggingEnabled()
method.

BUG=27554392
BUG=27528124
TEST=unit tests

Change-Id: I8da6c1a4ab11e5f43b9e660fb64efed62e7cb9e3
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
d0cb2fae195ebb9f658095667f3c7b7b8d69a204 07-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: add support for driver dump HAL API

Implement the framework side of the driver dump HAL API:
- When a bugreport is generated, ask the HAL to provide
a driver memory dump.
- When dumping a bugreport, include the driver memory
dump (if available).

Along the way: add a stub implementation of the driver
dump HAL API, in case a particular vendor HAL does not
implement the API.

While there: declare the (existing) callback for
firmware memory dumps as static. There's no need for
on_firmware_memory_dump() to be visible outside of
com_android_server_wifi_WifiNative.cpp. (Modules
that need access to on_firmware_memory_dump() will be
provided with a pointer; they don't need to reference
the function by name.)

BUG=27554392
TEST=unit tests
TEST=bullhead: dumpsys + verify that driver dump is present
TEST=angler: dumpsys + verify we properly handle unimplemented API

Change-Id: I619b9c819a41a795c1119a8c2fa22447f0c44b56
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
d604bbd63d620244ef43408de10f65ead01d5026 06-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: use large ringbuffers in verbose mode

When the user has chosen to enable wi-fi verbose
logging, we'd like to use larger ring buffers.

Make it so.

BUG=27578082
TEST=unit tests

Change-Id: I1e2447df2beda455cea37072e91fa0aac338bb3f
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
ed510cfa64decd813f76faf9bb1b0a70b74b9898 01-Apr-2016 mukesh agrawal <quiche@google.com> WifiLogger: add support for packet fate

1) Provide a method for other parts of wifi service
to report connection failures to WifiLogger.
2) Start packet fate monitoring if/when we start
logging in verbose mode.
3) Fetch packet fates on failure, as appropriate.
4) Include packet fate information in dumps.

While there:
a) Change visibility of the single-arg dump() method
in BaseWifiLogger. (Only derived classes should be
calling that overload.)
b) Disambiguate the call from WifiLogger.dump() to
BaseWifiLogger.dump(), by adding |super| to the
expression.
c) Remove unused WifiNative.WIFI_ERROR_UNINITIALIZED

BUG=27528124
TEST=unit tests

Change-Id: Ica85ce39e79983194c3930ef54c29ac07454faed
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
fef1495477206d4cabfc95325d71de41790cf9cc 02-Mar-2016 mukesh agrawal <quiche@google.com> make ringbuffer size configurable

Different builds of the WiFi service may want to have different
ring buffer sizes. To allow for this, have the WiFi service
consult Resources for the size to use.

BUG=27264418
TEST=unit tests
TEST=add Log call in WSM ctor, verify size from values.xml was used

Change-Id: Ie6adc9efe107dfeaf4894aaff35c0beb6f7f9819
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
b46c550a7305e6c42af4ca92a964b801c33f1f72 02-Mar-2016 mukesh agrawal <quiche@google.com> WifiLogger: manage ring buffers by bytes

At present, we manage the ring buffers by the number of
entries, rather than the number of bytes. Since the size
of an entry is variable, managing by the number of entries
doesn't give us solid control over the amount of memory
used.

To solve this, switch from LimitedCircularArray<byte[]>, to
ByteArrayRingBuffer. ByteArrayRingBuffer limits the number of
bytes, rather than the number of entries.

To facilitate testing, make two of WifiLogger's inner classes
(BugReport and LimitedCircularArray) package-private, instead
of strictly private.

BUG=27264379
TEST=(new) unit tests

Change-Id: I2ed6557bd0b40db3227e1e22ea7ff9f8a27ab2ba
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java
1b8a2b3c8724e29ce669f5bd6b0b82250824d034 17-Feb-2016 mukesh agrawal <quiche@google.com> WifiLogger: add unit test for startLogging()

WifiLogger has no unit tests. How disappointing. :-(

It's going to take time to add a full complement of unit tests. But
let's not wait to get started.

We start by adding a unit test for startLogging(), as that method
recently had a bug.

BUG=27204661
TEST=ran tests

Change-Id: I248937dd90c35b14e95dbb4d624746eb0ebc48bd
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiLoggerTest.java