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
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
'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
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
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
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
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