Commit graph

18539 commits

Author SHA1 Message Date
Erik Kline
1f7bcf3e93 Merge "Listen on dualstack sockets." 2015-12-08 06:28:29 +00:00
Nick Kralevich
5358093225 Merge "adb: Make HOME=/data/local/tmp" 2015-12-08 04:56:05 +00:00
Nick Kralevich
6d85c06aa1 Merge "init.rc: restorecon_recursive /sys/kernel/debug" 2015-12-08 04:44:08 +00:00
Erik Kline
46b0b1c694 Merge "Switch from using sockaddr to sockaddr_storage." 2015-12-08 01:41:38 +00:00
Tom Cherry
c68998441c Merge "Remove ANDROID_PROPERTY_WORKSPACE" 2015-12-08 01:29:53 +00:00
Nick Kralevich
715c4dc3f9 init.rc: restorecon_recursive /sys/kernel/debug
If /sys/kernel/debug is present, make sure it has all the appropriate
SELinux labels.

Labeling of /sys/kernel/debug depends on kernel support
added in commit https://android-review.googlesource.com/122130

This patch depends on an external/sepolicy change with the
same Change-Id as this patch.

Change-Id: Id1d6a9ad6d0759d6de839458890e8cb24685db6d
2015-12-07 17:00:40 -08:00
Nick Kralevich
173eb396c7 adb: Make HOME=/data/local/tmp
Make the home directory for adb shell be /data/local/tmp and
automatically change into that directory.

Change-Id: Ib5cc6e1ecdd31a37e986cf03836f7589ebd40868
2015-12-07 16:56:12 -08:00
Mark Salyzyn
50413c7626 Merge "liblog: print message payload of zero length" 2015-12-08 00:27:30 +00:00
Mark Salyzyn
d7bcf40ee6 liblog: print message payload of zero length
logcat will crash if the log message payload is of zero length. Side
effect of possible log messages from LogKlog in eng and userdebug
builds, or lower level logging calls.

NB: The referenced bug cited an example of this native crash, this
    does not fix the problem cited in the bug about the
    com.android.music shutdown.

Bug: 25774695
Change-Id: I5c7a6ad8db640ba9bc8d34fab04ba7cc2a9a426a
2015-12-07 16:14:40 -08:00
Dimitry Ivanov
beceb6ef53 Merge "Native loader as a separate library" 2015-12-07 23:45:50 +00:00
Mark Salyzyn
d1379a8aed Merge changes Ib441cecf,Ieb1bbe3d,I3e63e430,I531b4317,I8dd60545, ...
* changes:
  logcat: Add --wrap timeout
  logcat: Add low hanging fruit long arguments
  logcat: Add long arguments to logcat, support for pid filter
  liblog: Support for ANDROID_LOG_WRAP mode flag on reader
  logd: test wakeup on wrap timeout
  logd: wakeup on wrap or timeout
2015-12-07 22:27:13 +00:00
Mark Salyzyn
41ba25f864 logcat: Add --wrap timeout
Always ANDROID_LOG_WRAP_DEFAULT_TIMEOUT seconds (2 hours).
--wrap takes argument, the argument is currently ignored.

Future: Add new API that allows setting of wrap timeout.

Bug: 25929746
Bug: 21615139
Change-Id: Ib441cecfb6e4264c18adb70c705314440ba85e65
2015-12-07 14:24:02 -08:00
Mark Salyzyn
f8bff87c65 logcat: Add low hanging fruit long arguments
Add long arguments file, rotate_kbytes, rotate_count, format,
dividers, clear, buffer_size, last, buffer, binary, statistics
and prune.

Bug: 21615139
Change-Id: Ieb1bbe3d47e6711a1e91c74522630d39f8981621
2015-12-07 14:24:02 -08:00
Kristian Monsen
562e513d4b logcat: Add long arguments to logcat, support for pid filter
Bug: 21615139
Change-Id: I3e63e43067f8089c18658e4100e901fb2a9630ae
2015-12-07 14:24:02 -08:00
Mark Salyzyn
f8e546e609 liblog: Support for ANDROID_LOG_WRAP mode flag on reader
If ANDROID_LOG_WRAP is specified, add timeout=3600 to the reader
request. logd will comply by going to sleep with the socket open.
If the start time is about to wrap or get pruned in the specified log
buffers, then wakeup and dump the logs; or wakeup on timeout,
whichever comes first.

Bug: 25929746
Change-Id: I531b4317a20abcf3ba87d78c68fa2f268a4488ab
2015-12-07 14:24:02 -08:00
Mark Salyzyn
fc9f5b8af4 logd: test wakeup on wrap timeout
Change-Id: I8dd605452f1fef7706a627eedc251e39bb2e34cc
2015-12-07 14:24:02 -08:00
Mark Salyzyn
b75cce0389 logd: wakeup on wrap or timeout
If a timeout is specified for the reader, then go to sleep
with the socket open. If the start time is about to get
pruned in the specified log buffers, then wakeup and dump
the logs; or wakeup on timeout, whichever comes first.

Bug: 25929746
Change-Id: I7d2421c2c5083b33747b84f74d9a560d3ba645df
2015-12-07 14:24:02 -08:00
Mark Salyzyn
3ea02e8eca Merge "logd: test: leniency towards background cgroup" 2015-12-07 20:59:34 +00:00
Dimitry Ivanov
ac1b1919f8 Native loader as a separate library
Extracted native loader to separate library in order to
be able to reuse it for NativeActivities related native code
in libandroid_runtime.so

Bug: http://b/22548808
Change-Id: Ibcf5ddcdc5aba22e32e4b72887840e9c171c1986
2015-12-07 12:59:02 -08:00
Mark Salyzyn
2e2d2edc59 Merge "logd: test: statistics report chatty effective percentage" 2015-12-07 19:30:51 +00:00
Mark Salyzyn
8ca9a775f7 Merge "liblog: test: liblog.android_logger_get_ failure" 2015-12-07 19:30:40 +00:00
Mark Salyzyn
074f542476 logd: test: leniency towards background cgroup
Accepting a new lower standard of performance due to
the realities of the background cgroup.

Change-Id: Icd85050ffbf7f0129dd4c053323faedd0ff74048
2015-12-07 11:26:12 -08:00
Mark Salyzyn
f33657da4d logd: test: statistics report chatty effective percentage
Add parsing to recognize optional chatty effective
percentage field as reported in the logger statistics.

Bug: 22855208
Change-Id: Id9c5e4a907ed0f9319beb9ddbfa27f4844bffc7d
2015-12-07 11:10:04 -08:00
Mark Salyzyn
7d8939ec1d liblog: test: liblog.android_logger_get_ failure
Change-Id: I8f74eca7857fe4cd6fa979d7bdeeda2b6a3e596b
2015-12-07 11:08:59 -08:00
Mark Salyzyn
69504d646d Merge "logd: liblog: logcat: switch to android_log_clockid() (2)" 2015-12-07 19:08:33 +00:00
Mark Salyzyn
ba7a9a016b logd: liblog: logcat: switch to android_log_clockid() (2)
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()

Bug: 23668800
Change-Id: I38dee773bf3844177826b03a26b03215c79a5359
2015-12-07 18:45:31 +00:00
Mark Salyzyn
b566435b02 Merge "Revert "logd: liblog: logcat: switch to android_log_clockid()"" 2015-12-07 18:31:44 +00:00
Mark Salyzyn
9e18cdcebd Revert "logd: liblog: logcat: switch to android_log_clockid()"
This reverts commit 77b5696b1d.

Change-Id: I7711bf1a7e3f72ed29a2498d7287b725a0e624bd
2015-12-07 18:30:58 +00:00
Mark Salyzyn
9eca0e775b Merge "logd: liblog: logcat: switch to android_log_clockid()" 2015-12-07 18:16:29 +00:00
Elliott Hughes
912ed3d8ca Merge "Track rename of base/ to android-base/." 2015-12-07 17:49:14 +00:00
Erik Kline
c40da92e5b Listen on dualstack sockets.
Change-Id: Id6eff59c65a7f7e190ab9aa93625e32a9806ae6c
2015-12-07 16:09:39 +09:00
Erik Kline
7e16cc15b5 Switch from using sockaddr to sockaddr_storage.
This is to ensure sufficient space is always available.

Change-Id: Ifa87b93ecdc90dcacbfb24446c872344da6703d3
2015-12-07 16:07:46 +09:00
Elliott Hughes
4f71319df0 Track rename of base/ to android-base/.
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-04 22:00:26 -08:00
Elliott Hughes
1efab7acc5 Merge "Add a symlink android-base/ pointing to base/." 2015-12-04 23:22:00 +00:00
Elliott Hughes
7f24c45b7d Add a symlink android-base/ pointing to base/.
This lets us move things over piece by piece without breaking anything.

Change-Id: I06fc29572f63c4af9675888987acdcdea086711d
2015-12-04 15:18:27 -08:00
Mark Salyzyn
77b5696b1d logd: liblog: logcat: switch to android_log_clockid()
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()

Bug: 23668800
Change-Id: I3c4e3e6b87f6676950797f1f0e203b44c542ed43
2015-12-04 14:49:19 -08:00
Tom Cherry
265f525e21 Remove ANDROID_PROPERTY_WORKSPACE
Bug 23290008

Change-Id: I95babe735444ada10c67594ace700cae5d1ec0b3
2015-12-04 14:11:02 -08:00
Bertrand Simonnet
f2eafd21a6 Merge changes Id186dc54,Ie8fee841
* changes:
  metricsd: Allows introspecting the metrics.
  metrics: Remove user action logic.
2015-12-04 21:17:50 +00:00
Bertrand SIMONNET
b13527d14e metricsd: Allows introspecting the metrics.
This CL adds a dump command to metrics_client that will dump the
histograms, aggregated by metricsd since it started, in a human readable
format.
This is useful for developers to ensure that their code uses libmetrics
correctly and the reported values are correct.

Sample output (redacted to fit the commit message):
$ metrics_client -d
Histogram: hello recorded 5 samples, average = 54.8 (flags = 0x1)
0   ...
9   --------O                 (1 = 20.0%) {0.0%}
16  O                         (0 = 0.0%) {20.0%}
29  --------O                 (1 = 20.0%) {20.0%}
54  ------------------------O (3 = 60.0%) {40.0%}
100 O                         (0 = 0.0%) {100.0%}
$

Bug: 25817310
Test: * Send a histogram with metrics_client.
      * `metrics_client -d` shows it.

Change-Id: Id186dc5463403ca9181ee9eef8f46b5e809b8714
2015-12-04 13:14:58 -08:00
Bertrand SIMONNET
f2297eeb1f metrics: Remove user action logic.
User actions are no longer reported anywhere, we can remove the logic.

Bug: 25818567
Change-Id: Ie8fee841bda6503a3f5781d73b0f879babe99b03
2015-12-04 13:04:23 -08:00
Bertrand Simonnet
c5e921fe52 Merge "metricsd: Log over binder." 2015-12-04 17:05:36 +00:00
Bertrand SIMONNET
6b8629a649 metricsd: Log over binder.
This CL converts metricsd, libmetrics and metrics_collector to use
Binder to pass metrics samples.

Bug: 25670685

Change-Id: I657faecdf4ed1226ab30ce69e062028463437e7b
2015-12-03 17:01:27 -08:00
Tom Cherry
65fc485574 Merge changes from topic 'prop-security'
* changes:
  Abort if __system_property_area_init fails
  restorecon /property_contexts
2015-12-03 22:55:32 +00:00
Josh Gao
1c6cd21c43 Merge "adbd: split up writes longer than 16k." 2015-12-03 22:50:11 +00:00
Josh Gao
6b531c4e6d adbd: split up writes longer than 16k.
Also, inline the bulk_read and bulk_write functions which were only
being used by one other function.

Bug: http://b/25847115
Change-Id: I218a869030219f606577a5529601c542488115e0
2015-12-03 14:40:03 -08:00
Bertrand Simonnet
1462c78c9c Merge "metricsd: Add clang format config." 2015-12-02 22:31:33 +00:00
Josh Gao
1702f427b5 Merge "adb: don't divide by zero" 2015-12-02 21:56:04 +00:00
Tom Cherry
6036114f93 Abort if __system_property_area_init fails
If __system_property_area_init() fails, there is a fundamental issue
with the system and we should abort from init.

Bug: 21852512
Change-Id: I05d7978ba3bcc347027a6d9443de7cdd229033d2
2015-12-02 11:29:12 -08:00
Elliott Hughes
d0d87f78e5 Merge "Fix "adb sync" (and "adb push") error reporting." 2015-12-02 18:53:28 +00:00
Bertrand SIMONNET
0c7e29b42e metricsd: Add clang format config.
This will make it easier to catch formatting nits.
This style is based on the Google style guide (well known publicly) and
follows the Chromium style changes we have adopted.

Bug: 25887990

Change-Id: If9562223752dfe611a32c341e703338f806bcc0f
2015-12-02 16:42:11 +00:00