Commit graph

842 commits

Author SHA1 Message Date
Nick Kralevich
d7f0a73f8d am 64c30a79: am 084c00b8: Merge "init: add LOCAL_SANITIZE := integer"
* commit '64c30a79def4dc29749a86c00a970243a2a45f1e':
  init: add LOCAL_SANITIZE := integer
2015-08-17 01:15:05 +00:00
Nick Kralevich
084c00b804 Merge "init: add LOCAL_SANITIZE := integer" 2015-08-16 15:37:35 +00:00
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
38887c50c1 am 51ffedd2: am 1efef4c4: Merge "Revert "init: add LOCAL_SANITIZE := integer""
* commit '51ffedd264389730a76470408a122589f7ce3488':
  Revert "init: add LOCAL_SANITIZE := integer"
2015-08-13 18:27:42 +00:00
Nick Kralevich
1efef4c49d Merge "Revert "init: add LOCAL_SANITIZE := integer"" 2015-08-13 18:15:11 +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
9ec6fcfe09 am 4d74f2cb: am 0b973da5: Merge "init: add LOCAL_SANITIZE := integer"
* commit '4d74f2cb4c30aaf4dfd176b2f970dbf54e5c697d':
  init: add LOCAL_SANITIZE := integer
2015-08-12 19:21:58 +00:00
Nick Kralevich
0b973da532 Merge "init: add LOCAL_SANITIZE := integer" 2015-08-12 19:09:58 +00:00
Dan Albert
68ff9f2ca2 am e78292f2: am cef3508b: Merge "Add missing includes."
* commit 'e78292f2c5a1cffd9fdcb76e5be29f6d14445b93':
  Add missing includes.
2015-08-12 02:11:05 +00:00
Dan Albert
cef3508bb6 Merge "Add missing includes." 2015-08-12 01:50:15 +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
Dan Albert
af9ba4dc6c Add missing includes.
Leaky header cleanup in libc++ means we don't get unistd.h
transitively any more.

Change-Id: I596c24eff418302b19afab6ad3caa55f52241e7c
2015-08-11 16:39:57 -07:00
Tom Cherry
9b005a328b am ba0f24c7: am 5573e3d8: Merge "init: replace strdup() in parse_config()"
* commit 'ba0f24c71767365ff730b763b9af257bad462809':
  init: replace strdup() in parse_config()
2015-08-11 21:05:59 +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
Tom Cherry
2647d2e70e am 4036f5ab: am 4bf3dc93: Merge "Create Service and ServiceManager classes"
* commit '4036f5ab2ffbe5a2e47d46aa376e9791385cc31b':
  Create Service and ServiceManager classes
2015-08-07 21:13:04 +00:00
Tom Cherry
4bf3dc9345 Merge "Create Service and ServiceManager classes" 2015-08-07 19:29:58 +00:00
Tom Cherry
bac3299720 Create Service and ServiceManager classes
Change-Id: I363a5e4751ad83d2f4096882a6fbbeddca03acfe
2015-08-07 10:16:39 -07:00
Yasuhiro Matsuda
39ac947939 am b84e1f54: am 50de8224: Merge "Enable perfboot.py to install APKs before measurement."
* commit 'b84e1f540379c6af9ccfc22e779b67f67b8c210a':
  Enable perfboot.py to install APKs before measurement.
2015-08-06 12:40:27 +00:00
Yasuhiro Matsuda
fb35b7c463 am 9e2ed7b0: am 7f2e05e9: Merge "Fix incorrect exception handling in perfboot.py"
* commit '9e2ed7b080bbe0f01fb82d77b30f6d1df372490a':
  Fix incorrect exception handling in perfboot.py
2015-08-06 12:40:26 +00:00
Yasuhiro Matsuda
50de8224a6 Merge "Enable perfboot.py to install APKs before measurement." 2015-08-06 03:55:04 +00: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
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
75c09ba367 am ee640552: am 1ada513f: Merge "Fix perfboot.py to exit by Ctrl+C."
* commit 'ee6405527f11010e09a72c4eaf2c47bac170c49c':
  Fix perfboot.py to exit by Ctrl+C.
2015-08-05 02:39:00 +00:00
Yasuhiro Matsuda
1ada513f50 Merge "Fix perfboot.py to exit by Ctrl+C." 2015-08-05 02:26:27 +00:00
Yusuke Sato
ba48c3f64a am b57438c8: am e4154f46: Merge "perfboot.py: check 2 more event logs by default"
* commit 'b57438c848e377873aefd89f68afb7650a6043e9':
  perfboot.py: check 2 more event logs by default
2015-08-04 21:05:59 +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
Yusuke Sato
0ef97729c2 am 69386e33: am 81fd50c3: Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags"
* commit '69386e33b67eaee721b4e8d7bddbd4263302ff77':
  perfboot.py: ignore tags not listed in /system/etc/event-log-tags
2015-08-04 00:28:44 +00: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
Yusuke Sato
f2a404b1f3 am 5e34b3ab: am 72488aa0: Merge "perfboot.py: warn if dm-verity is disabled"
* commit '5e34b3abdb3cbc167fa86dab7a746c94f2bd4c6f':
  perfboot.py: warn if dm-verity is disabled
2015-08-03 21:47:13 +00:00
Tom Cherry
087cd35b79 resolved conflicts for merge of 0070026c to mnc-dr-dev-plus-aosp
Change-Id: Ibc802572898b6913c1f5d94aaae19974bfc0eb85
2015-08-03 14:19:35 -07:00
Yusuke Sato
72488aa0fe Merge "perfboot.py: warn if dm-verity is disabled" 2015-08-03 20:26:47 +00:00
Yusuke Sato
b6c66dc0a3 perfboot.py: warn if dm-verity is disabled
Disabling the feature sometimes skews benchmark results.

Bug: 22207911
Change-Id: Idedc7eb14e3cc4e8687b0c0e2975f10a3c4154e5
2015-08-03 11:36:21 -07:00
Yusuke Sato
adda8f7388 am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"
* commit '2f9e1db37416cdb580d870218b5fbfbed47a3758':
  Stop calling fsck on shutdown by default
2015-08-03 17:56:32 +00:00
Tom Cherry
4247ebfd2f Merge "init: use std::vector<std::string> for argument passing" 2015-08-03 17:51:39 +00:00
Lee Campbell
2fb050b893 am 150c05fe: am 0f918878: Merge "init: Adding header guard to tokenizer"
* commit '150c05feeb482de2b4026fc35e392fc8c0ecd2df':
  init: Adding header guard to tokenizer
2015-08-01 15:48:39 +00:00
Yusuke Sato
b5d6ad81cb Merge "Stop calling fsck on shutdown by default" 2015-07-31 23:13:15 +00:00
Tom Cherry
96f67316a2 init: use std::vector<std::string> for argument passing
Change-Id: Ie7a64e65de3a20d0c7f7d8efc0f7c1ba121d07fe
2015-07-31 16:02:12 -07:00
Lee Campbell
06584400dd init: Adding header guard to tokenizer
Fixing missing header guard

BUG: 22843198
Change-Id: Ice5d29d343ffe093aae46d4ac3fd72de628fb12e
2015-07-30 18:48:50 -07:00
Tom Cherry
7da270df1d am a21d8562: am d548e30f: Merge "init: Create classes for Action and Command"
* commit 'a21d85620560896bbed0cd43db9ed3224ab4e974':
  init: Create classes for Action and Command
2015-07-30 21:31:38 +00:00
Tom Cherry
d548e30f04 Merge "init: Create classes for Action and Command" 2015-07-30 21:03:48 +00:00
Lee Campbell
45bd7bcf37 am 1691d968: am 138c540f: Merge "init: Add C++ tokenizer."
* commit '1691d968f8ae5f25036251fd5978be637bbf0b4a':
  init: Add C++ tokenizer.
2015-07-30 20:45:25 +00:00
Tom Cherry
fa0c21c94c init: Create classes for Action and Command
This creates the concept of 'event_trigger' vs 'property_trigger'

Previously these were merged into one, such that 'on property:a=b &&
property:b=c' is triggered when properties a=b and b=c as expected,
however combinations such as 'on early-boot && boot' would trigger
during both early-boot and boot.  Similarly, 'on early-boot &&
property:a=b' would trigger on both early-boot and again when property
a equals b.

The event trigger distinction ensures that the first example fails to
parse and the second example only triggers on early-boot if
property a equals b.

This coalesces Actions with the same triggers into a single Action object

Change-Id: I8f661d96e8a2d40236f252301bfe10979d663ea6
2015-07-30 13:37:23 -07:00
Lee Campbell
138c540f53 Merge "init: Add C++ tokenizer." 2015-07-30 20:30:07 +00:00
Lee Campbell
220ca84223 init: Add C++ tokenizer.
Adds a C++ tokenizer along with unit tests.

This tokenizer will replace the current C implementation
which does a poor job of keeping track of pointers.

This CL is a prerequisite for up coming changes to
the parser. This CL does not wire up this tokenizer and
changes no exsiting code. All that builds is the unit tests.

Change-Id: Iec3740bce7153640adc5e5bbdc57e644cedf0038
TEST: Unit tests all pass. No leaks under valgrind
BUG: 22843198
2015-07-30 18:45:17 +00:00
Yasuhiro Matsuda
70ab38a570 am 102ead3a: am b10e562b: Merge "Introduce a mechanism to trace boot sequence."
* commit '102ead3ae187a007b8a90b61ea243197927b6ae2':
  Introduce a mechanism to trace boot sequence.
2015-07-30 08:05:46 +00:00
Yasuhiro Matsuda
b10e562b4c Merge "Introduce a mechanism to trace boot sequence." 2015-07-30 07:42:09 +00:00
Yasuhiro Matsuda
ea504bc084 am 1a1f9beb: am dcf89091: Merge "Add a script to record Android boot time."
* commit '1a1f9beb1dbd0da0f305ff44816661cc404ba877':
  Add a script to record Android boot time.
2015-07-30 05:48:08 +00:00
Yasuhiro Matsuda
ab3798399d Add a script to record Android boot time.
perfboot.py repeats the record of each event log during Android
boot specified times. By default, interval between measurements
is adjusted in such a way that CPUs are cooled down sufficiently
to avoid boot time slowdown caused by CPU thermal throttling.
This script also works around the issue of dropbox slowing down
boot time on userdebug build (http://b/20890386) by limiting
the number of files to be created by dropbox.
The result is output in a tab-separated value format.

BUG: 22207911
Change-Id: I0ddbac5d1c941efda87bc6db6388d8194d4bb3dd
2015-07-30 14:16:15 +09:00
Yasuhiro Matsuda
f93db4b827 Introduce a mechanism to trace boot sequence.
This CL adds a trigger and a service so that Systrace can be used
for tracing events during boot.
persist.debug.atrace.boottrace property is used for switching on
and off tracing during boot. /data/misc/boottrace/categories
file is used for specifying the categories to be traced.
These property and file are rewritten by Systrace when the newly
added option --boot is specified.

Here is an example of tracing events of am and wm catetories
during boot.

$ external/chromium-trace/systrace am wm --boot

This command will cause the device to reboot. Once the device has
booted up, the trace report is created by hitting Ctrl+C.

As written in readme.txt, this mechanism relies on persistent
property, so tracing events that are emitted before that are not
recorded. This is enough for tracing events after zygote is
launched though.
This only works on userdebug or eng build for security reason.

BUG: 21739901
Change-Id: I03f2963d77a678f47eab5e3e29fc7e91bc9ca3a4
2015-07-29 12:53:05 +09:00