Commit graph

13923 commits

Author SHA1 Message Date
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
8715c9396a metricsd: Remove unused Chrome OS specific files.
Change-Id: Iff19b6c83731c4eedebe20d307c079afb1e21491
2015-08-10 15:57:47 -07:00
Bertrand SIMONNET
52e5b99983 metricsd: Relicense as Apache 2.
MODULE_LICENSE_BSD and NOTICE were removed as the license is no longer
different from the rest of system/core.

BUG: 23086670
Change-Id: I1e83ef2ecb9c721150f8aab283c9ff960337da8c
2015-08-10 15:57:47 -07: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
Evgenii Stepanov
0d2dde57fe Read global ASAN_OPTIONS from a file.
Instead of setting global ASAN_OPTIONS in immutable init.environ.rc,
load them from a file that can be changed later. The file has to be
on the /system partition to both be editable and available at the
early stages of boot.

Also add allocator_may_return_null=1 as that is closer to the
non-ASan allocator behavior.

Bug: 22846541
Change-Id: Ib0f41393c528f2e7cb398470e41f50abf5f4f455
2015-08-10 11:30:54 -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
Elliott Hughes
e1101677ea Merge "adb: fix killing of old version of adb process" 2015-08-07 03:04:30 +00:00
Elliott Hughes
db3492cf17 Merge "win32: adb_test/libbase_test fixes" 2015-08-07 01:36:03 +00:00
Spencer Low
cbf26b76c7 win32: adb_test/libbase_test fixes
- My recent change with -DUNICODE=1 required changing
   GetProfilesDirectory() to GetProfilesDirectoryA() for the ANSI version
   of the API.

 - enh's edit to my previous change deleted a test that used
   /proc/version, but I think another test was missed. Merge that test into
   another.

Change-Id: Ic748549848e7be922bcbf218d5b0c3fca2a90704
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-06 18:09:32 -07:00
Elliott Hughes
c672cb0743 Merge "Include the error code if GetPipeProperties fails." 2015-08-06 17:49:41 +00:00
Elliott Hughes
6e02c24cfc Include the error code if GetPipeProperties fails.
Bug: http://b/22829602
Change-Id: I90a89e70518053a4581e1862a7dbd5d09e06dadc
2015-08-06 10:48:19 -07:00
Elliott Hughes
ff52e23f03 Merge "Stop being silly." 2015-08-06 17:21:35 +00:00
Elliott Hughes
5be6b37c5d Stop being silly.
Change-Id: I9c18205457396d625502a83e374c1207a3d90b0b
2015-08-06 08:46:32 -07:00
Yasuhiro Matsuda
50de8224a6 Merge "Enable perfboot.py to install APKs before measurement." 2015-08-06 03:55:04 +00:00
Spencer Low
71635bb966 adb: fix killing of old version of adb process
The original code was:

  if (strcmp(__adb_error, "unknown host service") != 0)

But that was changed by 078f0fcf4c to:

  if (*error == "unknown host service") {

I think the comparison should be != so that "unknown host service"
falls-through and kills the server, and so if it is some other error,
that the other error is returned immediately.

Change-Id: Ia490a4a870d1d123a3c5ab258dd5fa0930e8032d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-05 19:26:50 -07:00
Yasuhiro Matsuda
c0822e83ad Enable perfboot.py to install APKs before measurement.
This CL adds --apk-dir option, which specifies the directory
that contains APK files to be installed before measuring
boot time.

BUG: 22207911
Change-Id: Ifeacf34c779248686443a9ef02485272c140a456
2015-08-06 11:02:17 +09:00