Commit graph

13730 commits

Author SHA1 Message Date
Nick Kralevich
f90b653667 init: add LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: If73e6b382f2ee645fec406805739f9684ddbb5f0
2015-08-15 15:24:23 +00:00
Nick Kralevich
c307b5b7f8 Revert "init: add LOCAL_SANITIZE := integer"
flounder isn't booting

This reverts commit aea73db1e3.

Bug: 23166814
Change-Id: I36c811d1ca30e2366066142d9282bb713dae315f
2015-08-13 18:10:50 +00:00
Nick Kralevich
aea73db1e3 init: add LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: I5f542089753c8fcf7596fd70cfaa48a3caa5b140
2015-08-11 16:55:56 -07:00
Mark Salyzyn
ea56594c94 Merge "logd: sizes > 1M prune in smaller batches" 2015-08-11 23:51:31 +00:00
Mark Salyzyn
62ab0fd4ef logd: sizes > 1M prune in smaller batches
Switch to 1% batch sizes from 10% when individual buffer size > 1M

Bug: 22351810
Change-Id: Ifee570a54643ceb0ba767e1787e937f70cc90b72
2015-08-11 16:20:54 -07:00
Elliott Hughes
7989a7c8d3 Merge "adb: win32: fix USB device hang when resuming from sleep/hibernation" 2015-08-11 21:43:32 +00:00
Tom Cherry
5573e3d839 Merge "init: replace strdup() in parse_config()" 2015-08-11 20:53:11 +00:00
Yusuke Sato
162ec8e637 Merge "Ignore adb/*.pyc files" 2015-08-11 20:03:27 +00:00
Yusuke Sato
83cd266439 Ignore adb/*.pyc files
Python scripts in system/core/ such as perfboot.py may generate
the files.

Change-Id: I0506d47db414a678f1923e747ddce5acfcd7ce1b
2015-08-11 12:59:58 -07:00
Bertrand Simonnet
f71590ffbc Merge "metricsd: Only define the targets on linux." 2015-08-11 18:54:41 +00:00
Bertrand SIMONNET
0a94a3bf1c metricsd: Only define the targets on linux.
libchromeos (dependency of metricsd) is only defined for linux.
All metrics target must only be defined on mac too or the build system
will complain.

BUG: 22879597
Change-Id: I5bee816e001518a8053d1dfc7b39cca81a4314fd
2015-08-11 11:45:05 -07:00
Bertrand Simonnet
3670eab0ba Merge "metricsd: Add Android.mk." 2015-08-11 18:05:35 +00:00
Elliott Hughes
e329a3ec1b Merge "Remove watchprops." 2015-08-11 02:51:58 +00:00
Elliott Hughes
e8606c85c5 Remove watchprops.
Since watchprops would have to be rewritten anyway in the upcoming properties
rewrite, there seems little point in rewriting it for toybox first. Let's
see how many people actually use watchprops and decide whether it's worth
the effort...

Change-Id: I996e7209bc81633ee66602f09f130226336d9987
2015-08-10 19:27:18 -07:00
Elliott Hughes
1f36ae49b9 Merge "adb: win32: write ACK to separate pipe instead of stdout" 2015-08-11 01:38:55 +00:00
Elliott Hughes
5a1f9a3ef0 Merge "Remove the USB vendor id whitelist from fastboot." 2015-08-11 00:28:21 +00:00
Bertrand SIMONNET
ed6ca6f8c6 metricsd: Add Android.mk.
This builds:
* metrics_client: command line interface to log metrics.
* libmetrics: shared library used by services to log metrics.
* metrics_daemon: background daemon responsible for aggregating the
  metrics log and upload it periodically.

BUG: 22879597

Change-Id: I79adc4953d5bfd541df955fbc77d3549f5bbd26b
2015-08-10 15:57:39 -07:00
Gaurav Shah
cd285d7d26 Merge "crash_reporter: Fix initial compile issues with Android toolchain" 2015-08-10 22:41:36 +00:00
Gaurav Shah
b889d7e420 Merge "crash_reporter: Remove Chrome collector, CrOS build files, DBus" 2015-08-10 22:41:26 +00:00
Gaurav Shah
f06041d7f4 Merge "metricsd: Rename metrics to metricsd." 2015-08-10 22:41:00 +00:00
Gaurav Shah
011b2bc3eb Merge "metrics: Add a CLI flag to disable dbus." 2015-08-10 22:40:47 +00:00
Gaurav Shah
dc15f4cd92 Merge "metrics: Enable for non-official builds." 2015-08-10 22:40:32 +00:00
Elliott Hughes
e1746fda6a Remove the USB vendor id whitelist from fastboot.
Change-Id: I661a0538776d4ba74fcee37e2964d987eb861342
2015-08-10 15:30:54 -07:00
Bertrand SIMONNET
da21ac0751 metricsd: Rename metrics to metricsd.
This makes the import path less confusing:
* metrics/metrics_library.h is imported from the exported headers.
* metricsd/* for includes by the metrics daemon itself.

BUG: 22879597
Change-Id: I9f44ea3a548cae39d4546fcd724e8007f6dd4bd0
2015-08-10 15:26:01 -07:00
Bertrand SIMONNET
fec4d2cc3f metrics: Add a CLI flag to disable dbus.
DBus is not setup in several targets and the metrics_daemon will crash
if it cannot connect to DBus.
Running metrics daemon without dbus allows us to test the daemon in any
target.

BUG: 22879597

Change-Id: Ica69c8e96c3df794a210a0fa3d44f85a98a660f0
2015-08-10 15:26:01 -07:00
Bertrand SIMONNET
bae5dcce9b metrics: Enable for non-official builds.
The metrics uploader used to be disabled for non-official images to
avoid polluting the production data with possibly wrong measurements.
This is inconvenient for developers as they can only be sure that a new
metric was added properly until the changes reached a product device.

Instead, this CL change the metrics daemon to upload metrics iff the
consent file exists.
To ensure that testing data does not pollute the production data, we set
the channel to UNKNOWN and the version to 0.0.0.0 when the image is not
official (implied by channel and version missing).

BUG: 22879597

Change-Id: If03847090b732cc06270cbcc8b386b5f9e544a3d
2015-08-10 15:26:01 -07:00
Steve Fung
855b618fba Merge "crash_reporter: Fix header include paths" 2015-08-10 22:17:31 +00:00
Steve Fung
8bafb3da8f crash_reporter: Fix initial compile issues with Android toolchain
Fix some issues to get crash_reporter to compile on Android.

C++ source:
* bits/wordsize.h is used for __WORDSIZE, but is unavailable for most
  Android toolchain architectures.  It instead is available in sys/cdefs.h

Flex source:
* The Flex compiler toolchain doesn't link against the default fl library
  using -lfl.  Thus there is no yywrap() function defined.  Since the
  default fl library implementation just returns 1 (true), instead add a
  directive to disable yywrap.
* The index(..) function has been deprecated in favor of strchr(..)
* Add a directive to disable the "deprecated conversion from string constant
  to 'char*'" warning in the generated code.
* Remove warning suppression for the input() function which doesn't get
  generated with Flex v2.5.39 and the arguments passed in the build command.

Bug: 22874187
Change-Id: I6d7dcf5f801010aeae06db9f0628a6652ee269ee
2015-08-10 15:10:32 -07:00
Steve Fung
c8b741428c crash_reporter: Remove Chrome collector, CrOS build files, DBus
Removed the ChromeOS specific code so that the code compiles.  The code
removed is not needed when running on Android, and includes:
* Chrome collector
* ChromeOS build's gyp file
* ChromeOS-specific DBus calls
* ChromeOS-specific collector path logic
* Chrome bypass logic in user collector

Bug: 22672752
Change-Id: I3c7d87c971a181d8f73293519318e3602d142927
2015-08-10 15:10:22 -07:00
Bertrand Simonnet
6ada1665c9 Merge "metrics: Remove send to autotest." 2015-08-10 21:43:07 +00:00
Bertrand Simonnet
9372228f4e Merge "metrics: Consolidate constants in constants.h." 2015-08-10 21:42:49 +00:00
Bertrand SIMONNET
475dfa6891 metrics: Remove send to autotest.
This code is no longer used and can be removed.

BUG: 22879597

Change-Id: I59a51597f4c3699aa7952b0553144ad0ee03ebde
2015-08-10 14:42:03 -07:00
Bertrand SIMONNET
bd3505e634 metrics: Consolidate constants in constants.h.
Instead of hardcoding system specific constants (like path) in
every file, consolidate them into the constants.h.

BUG: 22879597

Change-Id: I615be017774db629bf43398db7f70e9ef7263a52
2015-08-10 14:42:03 -07:00
Bertrand Simonnet
182673ec6c Merge "metrics: Cleanup the system profile setter." 2015-08-10 21:28:16 +00:00
Bertrand Simonnet
38f55079aa Merge "metrics: Disable stat collection." 2015-08-10 21:27:52 +00:00
Tom Cherry
4ad60fbae5 init: replace strdup() in parse_config()
Previously, the action, command, and service structs contained char*s
that referenced memory within the buffer returned by the strdup() of
the input buffer of parse_config.  This prevented this entire memory
region from being freed, leaking contents that would never be referenced again.

The changes to convert the previous action, command, and service
structs to C++ classes created explicit ownership of the contents within
each class in the form of std::strings.  With these changes, there are
no remaining references to the memory allocated by this strdup(), which
can now be freed.

This commit replaces the strdup() with std::vector<char> to allow for
the copied string to be freed when it goes out of scope instead of
relying on the C strdup() and free() functions.

Change-Id: Id0a5f711e33363082ba201afda6b26043998cb1c
2015-08-10 14:26:03 -07:00
Bertrand SIMONNET
52e1d55fd2 metrics: Cleanup the system profile setter.
Android does not use some of the original mechanisms available in Chrome
OS, so simplify the code by removing them.

BUG: 22879597

Change-Id: I25d71f464cb99d4ca51eab758695fcd59c1d2f3d
2015-08-10 21:23:28 +00:00
Bertrand SIMONNET
eeb7ef0284 metrics: Disable stat collection.
The statistics collected might not be correct on android.
We should make sure that the values reported have the right meaning.

BUG: 22879597
BUG: 22953719

Change-Id: I9fb066333a07f43096bd54a16fcc83816248cc29
2015-08-10 13:31:53 -07:00
Bertrand Simonnet
d16e9c254e Merge "metrics: Don't use the policy file." 2015-08-10 17:45:18 +00:00
Bertrand Simonnet
932d61d9ae Merge "metrics: Fix import paths for headers." 2015-08-10 17:44:56 +00:00
Steve Fung
129bea543b crash_reporter: Fix header include paths
Fix the header include paths to be relative to the crash_reporter
base folder.

Bug: 22873331
Change-Id: Icdd0495a79cd7679f38c54a84e189bfb3c9d7f1c
2015-08-10 01:38:56 -07:00
Spencer Low
5c398d2ce9 adb: win32: write ACK to separate pipe instead of stdout
The win32 version of 9f2d1a9cfc. The big
technique is to fit a Win32 HANDLE value in an int because it only uses
32-bits. This allows most of the other adb code to stay the same.

Also, fix a regression in the 'adb server nodaemon' command that was
erroneously returning an error when --reply-fd was not used, which
should not be necessary for this particular command.

Change-Id: I37e9c609014b813af93bf0d6c12f665b59c93c41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-08 15:07:07 -07:00
Bertrand SIMONNET
5db66c3859 metrics: Don't use the policy file.
Android does not have any policy file. Instead, rely only on the
existence of the consent file to determine whether the metrics are
enabled or not.

BUG: 22879597

Change-Id: I7e628f09d623c97b9bab3a490a636db873230817
2015-08-07 13:39:19 -07:00
Bertrand SIMONNET
4b915ae1b2 metrics: Fix import paths for headers.
This CL fixes the import path to match the Android format.
The libmetrics headers were also moved to include/metrics to make
exporting headers cleaner.

BUG: 22879597

Change-Id: I67d1ac1746cc3560ae4cbddecf97fa48c9dd1480
2015-08-07 13:39:14 -07:00
Tom Cherry
4bf3dc9345 Merge "Create Service and ServiceManager classes" 2015-08-07 19:29:58 +00:00
Elliott Hughes
9871488223 Merge "adb start-server: Use a separate fd for sending initial OK" 2015-08-07 18:31:49 +00:00
Siva Velusamy
9f2d1a9cfc adb start-server: Use a separate fd for sending initial OK
When "adb start-server" is issued, and a server needs to be launched,
adb client forks itself and the child process runs the server routine.
Once the server initializes its various components, it sends an "OK\n"
back to the client via its stderror (or stdout on Windows).

This sequence breaks down if before sending the "OK\n", the server
happens to log something on its stderr. In order to avoid this, the
client now expects the ack to come on a different fd rather than one
of the standard streams.

Bug: https://code.google.com/p/android/issues/detail?id=182150

Change-Id: I9d58a08068d71eb3b77e8a7377e934631c016466
2015-08-07 11:31:07 -07:00
Elliott Hughes
847ec9a88f Merge "More Mac fastboot failure debugging." 2015-08-07 18:17:19 +00:00
Elliott Hughes
2ae8d2ebae More Mac fastboot failure debugging.
Bug: http://b/22829602
Change-Id: I27738883eb545ed72eaae55fe3a077e6d1421302
2015-08-07 10:49:36 -07:00
Tom Cherry
bac3299720 Create Service and ServiceManager classes
Change-Id: I363a5e4751ad83d2f4096882a6fbbeddca03acfe
2015-08-07 10:16:39 -07:00