Commit Graph

14446 Commits

Author SHA1 Message Date
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 f69a27f80e am 182673ec: Merge "metrics: Cleanup the system profile setter."
* commit '182673ec6cd7538661cc76a984cded725d03f456':
  metrics: Cleanup the system profile setter.
2015-08-10 21:33:01 +00:00
Bertrand Simonnet 73e5c7680a am 38f55079: Merge "metrics: Disable stat collection."
* commit '38f55079aaefd339ce7b851323be4c9d7f0c01b8':
  metrics: Disable stat collection.
2015-08-10 21:33:00 +00: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 1cdf6e9472 am d16e9c25: Merge "metrics: Don\'t use the policy file."
* commit 'd16e9c254ee22fdfbe76d9ee3e6f230002c5c170':
  metrics: Don't use the policy file.
2015-08-10 17:51:20 +00:00
Bertrand Simonnet a8b959bb91 am 932d61d9: Merge "metrics: Fix import paths for headers."
* commit '932d61d9ae1f5ede45702c381694880cfb6d700b':
  metrics: Fix import paths for headers.
2015-08-10 17:51:18 +00: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 4036f5ab2f am 4bf3dc93: Merge "Create Service and ServiceManager classes"
* commit '4bf3dc9345dcbadd79d26406c0c33e0c4a16ce29':
  Create Service and ServiceManager classes
2015-08-07 19:36:38 +00:00
Tom Cherry 4bf3dc9345 Merge "Create Service and ServiceManager classes" 2015-08-07 19:29:58 +00:00
Elliott Hughes af60acef82 am 98714882: Merge "adb start-server: Use a separate fd for sending initial OK"
* commit '9871488223b5bd8f08f4a22920057297f942f94a':
  adb start-server: Use a separate fd for sending initial OK
2015-08-07 19:11:32 +00:00
Elliott Hughes c5cacda572 am 847ec9a8: Merge "More Mac fastboot failure debugging."
* commit '847ec9a88fdae3364b5124e505abc16fa4036d6a':
  More Mac fastboot failure debugging.
2015-08-07 19:11:31 +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 c1b6378d96 am e1101677: Merge "adb: fix killing of old version of adb process"
* commit 'e1101677eabaaddc2a60c6456cce1fd5e38f5b4e':
  adb: fix killing of old version of adb process
2015-08-07 03:10:57 +00:00
Elliott Hughes e1101677ea Merge "adb: fix killing of old version of adb process" 2015-08-07 03:04:30 +00:00
Elliott Hughes c61955305e am db3492cf: Merge "win32: adb_test/libbase_test fixes"
* commit 'db3492cf1703e15a1e92218fe00291932780656f':
  win32: adb_test/libbase_test fixes
2015-08-07 01:43:34 +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 2fbae4829b am c672cb07: Merge "Include the error code if GetPipeProperties fails."
* commit 'c672cb07431c66e80a4e1b8845f25a7abb0bac9b':
  Include the error code if GetPipeProperties fails.
2015-08-06 17:58:07 +00: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 802c6fd090 am ff52e23f: Merge "Stop being silly."
* commit 'ff52e23f0327ec1b68495e84f7e42e7c3a3d3f0e':
  Stop being silly.
2015-08-06 17:29:49 +00: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 b84e1f5403 am 50de8224: Merge "Enable perfboot.py to install APKs before measurement."
* commit '50de8224a6ec2e6e0de4197eb545c17ee4303dff':
  Enable perfboot.py to install APKs before measurement.
2015-08-06 12:33:37 +00:00
Yasuhiro Matsuda 9e2ed7b080 am 7f2e05e9: Merge "Fix incorrect exception handling in perfboot.py"
* commit '7f2e05e9a3f44528d9fa624da9386b01ccaa54a6':
  Fix incorrect exception handling in perfboot.py
2015-08-06 12:33:32 +00: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 ee6405527f am 1ada513f: Merge "Fix perfboot.py to exit by Ctrl+C."
* commit '1ada513f5042a13fff3fb64671d110defb6725fc':
  Fix perfboot.py to exit by Ctrl+C.
2015-08-05 02:32:43 +00:00
Yasuhiro Matsuda 1ada513f50 Merge "Fix perfboot.py to exit by Ctrl+C." 2015-08-05 02:26:27 +00:00
Yusuke Sato b57438c848 am e4154f46: Merge "perfboot.py: check 2 more event logs by default"
* commit 'e4154f46d38f58bdc01a2bdb6923d0f7ba098426':
  perfboot.py: check 2 more event logs by default
2015-08-04 20:55:20 +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