Commit Graph

19182 Commits

Author SHA1 Message Date
Mark Salyzyn ac02db3bda Merge "liblog: add gTests for logging with leading newline" 2016-02-10 18:32:11 +00:00
Mark Salyzyn d18a6d4764 Merge "logd: use ro.debuggable instead of ro.build.type" 2016-02-10 18:26:42 +00:00
Mark Salyzyn d1f41d606b logd: use ro.debuggable instead of ro.build.type
Change-Id: Ic644f1f78e68094f700834675f4acc63386a6b92
2016-02-10 10:23:03 -08:00
Mark Salyzyn 3f94122ced liblog: add gTests for logging with leading newline
Bug: 27091726
Change-Id: Idff0e4e7c025426002c6381c3afb00e12d9fc1b5
2016-02-10 09:52:13 -08:00
Yabin Cui 250f5956d6 Merge "adb: setsid() for adb host server." 2016-02-10 04:34:53 +00:00
James Hawkins 5cb07147e4 Merge "bootstat: Add support for logging the boot_reason metric." 2016-02-10 00:25:43 +00:00
Yabin Cui 6bf323b97a adb: setsid() for adb host server.
To create a daemon for adb host server, we should call setsid()
for the daemon process. However, previously we call setsid() for
the adb client process, which results in nothing but EPERM error.

Bug: 26982628
Change-Id: I2763ae3d5a243706927d7ef6af5095138c0ce2d8
2016-02-09 16:15:56 -08:00
James Hawkins a4a1a4ac85 bootstat: Add support for logging the boot_reason metric.
This value is read from the ro.boot.bootreason system property.

Bug: 21724738
Change-Id: I43bef3d85ba9c8d87669a91da1aa675d9a86e348
2016-02-09 15:32:38 -08:00
Elliott Hughes dc5bd3a1b9 Merge "Fix generation of event labels for getevent." 2016-02-09 19:17:38 +00:00
Mark Salyzyn 37adf180c7 Merge "logd: add internal prdebug function" 2016-02-09 16:01:24 +00:00
Mark Salyzyn d048f113a3 logd: add internal prdebug function
Usage: android::prdebug(const char *fmt, ...) __printflike(1, 2);

Will add logd prefix tag, log as debug priority in kernel logs,
and will suffix a newline if one is not supplied. To be used to
aid debugging of the logger only.

Change-Id: I217326ef34dc4eb0ea076bacb7a7a8b564c931c3
2016-02-09 07:46:39 -08:00
Josh Gao b2803b5060 Merge "adb: make ctrl-c when spawning a daemon not kill the daemon." 2016-02-09 01:05:18 +00:00
Josh Gao 1a34944cde Merge "adb: fix mkdirs test." 2016-02-09 01:02:22 +00:00
Josh Gao b72b3f8c92 adb: make ctrl-c when spawning a daemon not kill the daemon.
Previously, using ctrl-c in a command that needs to spawn a daemon
because one isn't already available would kill the daemon along with the
foreground process.

Bug: http://b/26982628
Change-Id: I7fefc531c3e4895423e7b466322b5426d01dc9ef
2016-02-08 16:59:10 -08:00
Yabin Cui b958d22310 Merge "libziparchive: port unit tests to darwin and windows." 2016-02-09 00:56:43 +00:00
Yabin Cui 8e6f722764 libziparchive: port unit tests to darwin and windows.
Also use ReadFully to replace read, because read can
return reading bytes less than requested. And use
WriteFully to replace write.

Bug: 26962895
Change-Id: Iff0b2bc6d925619a537f7fef682c2a7ad89a2dc2
2016-02-08 16:52:55 -08:00
Dan Willemsen 3f68ba4dc6 Merge "Fix windows 64-bit builds" 2016-02-08 23:40:48 +00:00
Elliott Hughes bd02a47b22 Fix generation of event labels for getevent.
The recent uapi header update moved all the interesting constants
out into another file. Track that, and add the missing makefile
dependency.

Bug: http://b/27073568
Change-Id: I8ac1dd1122865479f69a76cbf427d4aacdf7b790
2016-02-08 14:56:03 -08:00
Josh Gao 1172b2ec71 adb: fix mkdirs test.
The behavior of mkdirs was changed a while ago, without updating the
test.

Change-Id: I2aaa73818933b281e911c42a14e3c843d8bd972a
2016-02-08 11:22:50 -08:00
David Pursell d4ac11a57d Merge "fastboot: add Socket timeout detection." 2016-02-08 16:13:39 +00:00
Christopher Ferris 45c8586dad Merge "Fix use of uninitialized memory." 2016-02-06 03:46:28 +00:00
Dan Willemsen 86cf941c48 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718
Change-Id: I4e43e7cf18a96f22b3a9a08dbab8c3e960c12930
2016-02-05 16:10:10 -08:00
Christopher Ferris d4c884330c Fix use of uninitialized memory.
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.

Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.

Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b
2016-02-05 15:22:34 -08:00
David Pursell c742a7f174 fastboot: add Socket timeout detection.
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914
Change-Id: Id7b598f8aea5df1a3676d24702b489042d5f9e3a
2016-02-05 13:22:06 -08:00
Elliott Hughes 718625010d Merge "init: fix writepid wrong pid written in file(s)" 2016-02-05 18:41:52 +00:00
Elliott Hughes ead369bdf0 Merge "Fix libbase's logging dependency." 2016-02-05 18:25:43 +00:00
Mark Salyzyn 76f99770d1 Merge "libcutils: abort for invalid fd" 2016-02-05 18:05:24 +00:00
Mark Salyzyn 20a6f0ff3b Merge "init-debug.rc: add runtime mmc max speed property actors" 2016-02-05 15:21:35 +00:00
Anestis Bechtsoudis b702b46f68 init: fix writepid wrong pid written in file(s)
When child (pid==0) executes fork branch 'pid_str'
will always be 0 writting wrong value to file(s).
Fix by utilizing getpid() to obtain correct pid.

Tracker link provides some insight on why use cases
aren't broken.

Bug: https://code.google.com/p/android/issues/detail?id=200392

Change-Id: I29989365a8bac94502c090918fa30e5cc88eb1ea
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
2016-02-05 16:49:28 +02:00
Christopher Ferris 14c06e0769 Merge "Newer kernels added SEGV_BNDERR." 2016-02-05 02:08:27 +00:00
Chih-hung Hsieh cfd44ee74f Merge "Suppress false positive memory leak warnings." 2016-02-05 01:21:14 +00:00
Chih-Hung Hsieh f7e7bd4c3b Suppress false positive memory leak warnings.
Clang static analyzer does not know the transfer of
object ownership to hashmapPut. Use a fake global
pointer variable to trick the analyzer.

BUG: 26955438
Change-Id: Id3ac595fff14e48d28a1147461cd836914857086
2016-02-04 16:38:04 -08:00
Alex Deymo 205cdb8868 Merge "metricsd: Create a brillo::MessageLoop." 2016-02-04 23:38:54 +00:00
Jorge Lucangeli Obes 42a53e0c2a Merge "Unit tests: Compile only on 'eng' builds." 2016-02-04 22:24:46 +00:00
Jorge Lucangeli Obes 1e7592c9d5 Unit tests: Compile only on 'eng' builds.
metrics_collector_tests, metricsd_tests.

Bug: 26967770
Change-Id: I6d7e8fb6d3d98ab747d922bfeef05aa344b2179c
2016-02-04 14:17:46 -08:00
Christopher Ferris 5d56e28537 Newer kernels added SEGV_BNDERR.
Bug: 23789423
Change-Id: I6fdce75715edfce179df8c0e6a7205f26341ebd0
2016-02-04 14:07:23 -08:00
Jorge Lucangeli Obes a7d277796f Merge "crash_reporter_tests: Compile only on 'eng' builds." 2016-02-04 22:00:25 +00:00
Alex Deymo f1bf9e5fc9 metricsd: Create a brillo::MessageLoop.
brillo::BinderWatcher now requires a brillo::MessageLoop, so this patch
creates a brillo::BaseMessageLoop and passes it when creating the
brillo::BinderWatcher.

Bug: 26356682
TEST=Deployed metricsd to edison-eng.

Change-Id: I6a9e592623faf231205ae44e479bec2b873b8898
2016-02-04 13:56:38 -08:00
Jorge Lucangeli Obes 512d677a5e crash_reporter_tests: Compile only on 'eng' builds.
Bug: 26967770
Change-Id: I2bebd3da5f0d845edec24279c160d9cc62577210
2016-02-04 13:56:25 -08:00
Mark Salyzyn 9dead6deec Merge "logcat: build cleanup" 2016-02-04 21:40:16 +00:00
Mark Salyzyn 7864e36751 init-debug.rc: add runtime mmc max speed property actors
persist.mmc.max_read_speed  - KB/s speed cap
persist.mmc.max_write_speed - KB/s speed cap
persist.mmc.cache_size      - MB of high-speed on-device write cache

device default directly to associated /sys/block/mmcblk0/ attributes,
not delivered on "user" builds.

Bug: 26976972
Change-Id: Ic82b9614489b6406ce830d127c85affc9095e256
2016-02-04 13:10:19 -08:00
Mark Salyzyn 5b89b49fc9 logcat: build cleanup
LOCAL_MODULE_TAGS debug encompasses eng

Bug: 26976972
Change-Id: I44b30f2ebb0173b203bf975f01dfead737b4e5bf
2016-02-04 13:10:19 -08:00
Mark Salyzyn 11aebd8c9a Merge "logcatd.rc: only deliver on eng and userdebug" 2016-02-04 20:33:20 +00:00
Mark Salyzyn 6de62e52c7 logcatd.rc: only deliver on eng and userdebug
Change-Id: I694d33a041e40fe181d3c2f1c8604765ba29e709
2016-02-04 11:11:52 -08:00
Elliott Hughes 5cf0dcd5b2 Fix libbase's logging dependency.
Get liblog directly, rather than transitively through libcutils.

Change-Id: Ia08ac6f04ac68c39807989d869709bae0a051578
2016-02-04 08:24:55 -08:00
Josh Gao aae1eb2c4f Merge "adb: don't append a slash to a path that already ends with one." 2016-02-04 00:36:32 +00:00
Elliott Hughes 1617dd4fe9 Merge "adb: win32: fix start-server to properly display UTF-8 on the console" 2016-02-04 00:26:36 +00:00
Spencer Low 53a0a99fe8 adb: win32: fix start-server to properly display UTF-8 on the console
fwrite() is a macro that maps to adb_fwrite(), which can write UTF-8 to
the console. Use it to write the output that comes from the subprocess
adb server.

To do this, dup the stdout/stderr file descriptor and make a duplicate
FILE* stream, in binary mode (since we're reading raw bytes from the
subprocess), and unbuffered.

Change-Id: I480761bae0bd576dc9e03fa4d31266f4e49635ed
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2016-02-03 16:24:37 -08:00
Josh Gao 323899b6d3 adb: don't append a slash to a path that already ends with one.
Bug: http://b/26964908
Change-Id: I1fbd752fd97f5414a306b46f7bfce3373362f8b3
2016-02-03 16:24:13 -08:00
Elliott Hughes ba3014c914 Merge "Add support for USB_HVDCP chargers" 2016-02-04 00:08:33 +00:00