Commit graph

13757 commits

Author SHA1 Message Date
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
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
Yasuhiro Matsuda
7f2e05e9a3 Merge "Fix incorrect exception handling in perfboot.py" 2015-08-06 01:48:34 +00:00
Yasuhiro Matsuda
f3d0d42f1a Fix incorrect exception handling in perfboot.py
RuntimeError used to be missed unintentionally.

BUG: 22207911
Change-Id: I69772350c22fac93d49745c3bc934dda7188bb77
2015-08-05 20:26:03 +09:00
Yasuhiro Matsuda
1ada513f50 Merge "Fix perfboot.py to exit by Ctrl+C." 2015-08-05 02:26:27 +00:00
Yusuke Sato
e4154f46d3 Merge "perfboot.py: check 2 more event logs by default" 2015-08-04 20:42:58 +00:00
Yusuke Sato
43c4d998cf perfboot.py: check 2 more event logs by default
'sf_stop_bootanim' is useful for tracking the time wasted by
showing the 'outro' part of the boot animation.

'wm_boot_animation_done' is also useful for tracking user
perceived boot time.

(cherry-pick of cbcf2778c3)

Bug: 22207911
Change-Id: I3549338a2161fa29675993c239f57809270797f8
2015-08-04 12:06:36 -07:00
Yasuhiro Matsuda
59d32a7515 Fix perfboot.py to exit by Ctrl+C.
BUG: 22207911
Change-Id: I0cc41f834207efd2965483c8636bbc709e54358f
2015-08-04 17:48:41 +09:00
Daniel Rosenberg
516d30d502 Merge "rootdir: Create symlinks in Android.mk" 2015-08-04 01:00:48 +00:00
Elliott Hughes
3cf2a8e0ee Merge "Fix a comment typo." 2015-08-04 00:51:38 +00:00
Daniel Rosenberg
595003a3d0 rootdir: Create symlinks in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some symlinks init.rc would during the build.

Change-Id: I4e7726f38c0f9cd9846c761fad1446738edb52c0
2015-08-04 00:51:19 +00:00
Elliott Hughes
feacf20d1e Merge "adb: win32: file descriptor reliability improvements" 2015-08-04 00:50:43 +00:00
Daniel Rosenberg
13d62278f4 Merge "Skip mounting /, just mark block device as ro if needed." 2015-08-04 00:50:40 +00:00
Daniel Rosenberg
31a4fafc15 Skip mounting /, just mark block device as ro if needed.
Change-Id: I7fbb636d296abc1caab6c7bf88017684c9df7759
2015-08-04 00:47:04 +00:00
Yusuke Sato
81fd50c397 Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags" 2015-08-04 00:08:24 +00:00
Elliott Hughes
bfa7c7d9e2 Fix a comment typo.
Change-Id: Ifacb19b9c31ac81fbf02c8382eb0324ea79075b9
2015-08-03 16:26:13 -07:00
Yusuke Sato
e801cc0b4e perfboot.py: ignore tags not listed in /system/etc/event-log-tags
This is a follow-up CL for http://ag/739815/.

Bug: 22207911
Change-Id: Ie5f529abc4b18454cea8a75a1438a5ea65dd90ab
2015-08-03 15:56:53 -07:00