Commit Graph

27103 Commits

Author SHA1 Message Date
Jorge Lucangeli Obes 41aa8f07b2 Merge "Add a sample service for testing init."
am: d7b5c7b2da

Change-Id: Id4600c9dc36f6b22ca165622967bb68a2bc51425
2017-02-10 01:41:57 +00:00
Treehugger Robot d7b5c7b2da Merge "Add a sample service for testing init." 2017-02-10 01:40:12 +00:00
Evan Ralston 281fa200fb Merge "Check against LOG_ID_MAX instead of LOG_ID_KERNEL"
am: 9fcabf739b

Change-Id: I6a07a22d727e2e5a886bf6c717d787273feb3226
2017-02-10 01:19:55 +00:00
Treehugger Robot 9fcabf739b Merge "Check against LOG_ID_MAX instead of LOG_ID_KERNEL" 2017-02-10 01:14:23 +00:00
Michael Wright f5951632d0 Merge "Only allow system to write to existing input nodes."
am: bab6ec555c

Change-Id: Iff70503026c0e43d44e0f3d79edae22e9356aa5d
2017-02-10 00:19:59 +00:00
Treehugger Robot bab6ec555c Merge "Only allow system to write to existing input nodes." 2017-02-10 00:15:24 +00:00
Connor O'Brien 76bdadbf7d Merge "Fastboot: use flash erase & logical block size for building userdata"
am: 6e0dd6285e

Change-Id: I1b9fa4a0335f4a9f834607b92d7f74b9d7afed94
2017-02-10 00:08:22 +00:00
Connor O'Brien 6e0dd6285e Merge "Fastboot: use flash erase & logical block size for building userdata" 2017-02-10 00:01:41 +00:00
Jorge Lucangeli Obes 28e980b59c Add a sample service for testing init.
I find myself using something like this every time I add functionality
to init. I cannot possibly be the only one doing this. On the other
hand, if this hasn't been added for so long, maybe there's a reason
for that.

The advantage of using a test service versus modifying an existing
service is that the test service doesn't *require* any permissions or
privileges, so you can add and/or remove whatever you need to test
without breaking the service.

I found it useful to have the service check its own /proc/<pid>/status
from command-line arguments, so that's what the service does.

This CL also adds a .clang-format file for init.

Bug: None
Test: Service runs and exits successfully.

Change-Id: I3e7841a7283158e10c0bf55e0103c03902afb1f0
2017-02-09 18:23:09 -05:00
Michael Wright 344e929e6d Only allow system to write to existing input nodes.
This prevents the shell user from injecting input as if it were coming
from an existing input device, which in turn makes it easier for malware
/ abuse analysis to detect when someone is injecting input via the
command line vs a real user using a device.

(cherrypick of 95637eb2a332b9a09914b1bf32c10fccfba4a175.)

Bug: 30861057
Test: ran getevent, saw correct output, played with device
Change-Id: Ib53eea1b7767f25510b5d36fe6109101a9fad8e0
2017-02-09 14:45:25 -08:00
Sandeep Patil 48b32bf398 Merge "ueventd: source ueventd configs from vendor and odm"
am: d54d4c275e

Change-Id: I39565fa11c5a8ac9611c5970cc574a405657be77
2017-02-09 21:33:00 +00:00
Treehugger Robot d54d4c275e Merge "ueventd: source ueventd configs from vendor and odm" 2017-02-09 21:25:44 +00:00
Yunlian Jiang 90cc4fd6a4 Merge "fix warning: Null pointer argument in call to memory comparison function"
am: ce07b6fa4f

Change-Id: Ida2150c0640ff30fc694c6a84c3777eaff906a7c
2017-02-09 17:23:36 +00:00
Treehugger Robot ce07b6fa4f Merge "fix warning: Null pointer argument in call to memory comparison function" 2017-02-09 17:20:14 +00:00
Mark Salyzyn 66181b9bd8 Merge changes Ia23b932a,I33e8a0ca,I0a5e7939,I13db1f45,I2a9dba81, ...
am: 71c0993126

Change-Id: Ief17305629740f695cecc038a7b25166b699b0f4
2017-02-09 15:33:57 +00:00
Mark Salyzyn 1947f3960b liblog: add local_logger
am: 7100288532

Change-Id: Ib4b2ce1f7633fc20ef792693bfb132e7da9b9440
2017-02-09 15:33:55 +00:00
Mark Salyzyn 81fcfc88f6 liblog: add __android_log_config_*_close()
am: 96432fc665

Change-Id: If7ce3adfeeb82cf621a90e750efc49ab7605c3bf
2017-02-09 15:33:50 +00:00
Mark Salyzyn a042b3a78e liblog: add android_log_logger_list management
am: cf983bcbae

Change-Id: I2344a384ad8a51f156b970267714677ede7d3a1b
2017-02-09 15:33:45 +00:00
Mark Salyzyn 5221ac3dfd liblog: add logprint to host build
am: 62d0d2d683

Change-Id: I487132a928ad33acfab90df5da781635070d2c57
2017-02-09 15:33:41 +00:00
Mark Salyzyn a2c9787367 liblog: benchmark: Use local LOGGER_NULL frontend
am: 8f2492f582

Change-Id: I738e97874f8a237750377ce1a03c06c6fedbb295
2017-02-09 15:33:36 +00:00
Mark Salyzyn 9d68551f47 liblog: Add android_set_log_frontend
am: 850d06e1c9

Change-Id: I4c47a1a6ed54d98d37ec5f9ab54b0d49156e1905
2017-02-09 15:33:30 +00:00
Mark Salyzyn 71c0993126 Merge changes Ia23b932a,I33e8a0ca,I0a5e7939,I13db1f45,I2a9dba81, ...
* changes:
  liblog: add local_logger
  liblog: add __android_log_config_*_close()
  liblog: add android_log_logger_list management
  liblog: add logprint to host build
  liblog: benchmark: Use local LOGGER_NULL frontend
  liblog: Add android_set_log_frontend
2017-02-09 15:30:47 +00:00
James Hawkins cefdacef3c Merge "Revert "bootstat: Remove custom uptime parser in favor of elapsedRealtime.""
am: 23f4e6b0a5

Change-Id: Ibef66ccd1a1fe362692ee45cb86cd9c0212c1f85
2017-02-09 02:31:44 +00:00
Connor O'Brien ce16a8a940 Fastboot: use flash erase & logical block size for building userdata
If the bootloader provides erase-block-size and logical-block-size
getvar variables, then pass these to libext4_utils when building a new
userdata image. This info is used to tune stride and stripe-width.

Bug: 33243520
Test: Modify fb_getvar to return values for "erase-block-size" and
"logical-block-size" and check that fastboot -w sets userdata
parameters correctly.
Signed-off-by: Connor O'Brien <connoro@google.com>

Change-Id: Id48b7a3ebb9074983a4422a79a64dcb437c0f888
2017-02-08 18:30:40 -08:00
Yunlian Jiang 33f671782a fix warning: Null pointer argument in call to memory comparison function
This fixes  warning: Null pointer argument in call to
memory comparison function [clang-analyzer-cplusplus.NewDeleteLeaks]

Bug: None
Test: The warning is gone.
Change-Id: I957365184966cc1435d7e37d64f2cc6a32846ebd
2017-02-08 16:47:20 -08:00
James Hawkins 23f4e6b0a5 Merge "Revert "bootstat: Remove custom uptime parser in favor of elapsedRealtime."" 2017-02-09 00:12:54 +00:00
Mark Salyzyn 7100288532 liblog: add local_logger
- Create the local-only logger module
- Add LOGGER_LOCAL flag to android_set_log_frontend to enable
- Permit log reader for host compilation

android_set_log_frontend(LOGGER_LOCAL) will result in logs going
into application local memory.  logcat can not retrieve the data,
the user must utilize the log reading interface directly to
acquire their own logs.  Some local logger tests dropped as they
represent testing other liblog facilities.  Other local logger
tests dropped because we make the conscious decision to not
support LOG_ID_SECURITY logging.

ToDo: Some local logger tests dropped because of missing
      functionality associated with blocking reader.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests, liblog-benchmarks and CtsLiblogTestCases_list
Bug: 27405083
Change-Id: Ia23b932af9e05756eaa60bab9139876b14faf72d
2017-02-08 15:07:06 -08:00
James Hawkins 0e3167e203 Revert "bootstat: Remove custom uptime parser in favor of elapsedRealtime."
This reverts commit 26f40c04c3.

This change broke the Darwin SDK target.

Test: none
Change-Id: Ia54fe2c31da8d8fa2825e023b035fb8321dcd457
2017-02-08 14:16:51 -08:00
Sandeep Patil bf298e6d0c ueventd: source ueventd configs from vendor and odm
While keeping the old /ueventd.$ro.hardware.rc configuration for devices
without early mount or vendor,odm split

b/34967636

Test: Boot angler and sailfish without regressions

Change-Id: I8d671911fd23fb1c0b5624ae209bad86137c88b7
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-08 13:51:02 -08:00
Mark Salyzyn 96432fc665 liblog: add __android_log_config_*_close()
Add __android_log_config_read_close() and
__android_log_config_write_close().  Fortify the list macros
to detect for list corruption, looking for entries pointing
to themselves, deleted entries in list.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: I33e8a0cae7e202f1989ddd7c2a96752b44c8e746
2017-02-08 13:37:44 -08:00
Mark Salyzyn cf983bcbae liblog: add android_log_logger_list management
Add list of android_log_logger_list entities as a way of
accessing the list of transport contexts from within
one of the transports.  This will enable us to iterate back
to an internal transport context which may house a last index
or signalling semaphore to propagate a wakeup on a blocking
read.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests
Bug: 27405083
Change-Id: I0a5e793946c020d97ffe10192369998e4ed92a83
2017-02-08 13:37:44 -08:00
Mark Salyzyn 62d0d2d683 liblog: add logprint to host build
- cleanup of some style issues
- resolve a few minor bugs
- add -lrt for host so that clock_gettime can be issued
- enable write-only logging, logprint and event list
  handling tests for host consumption.

NB: CtsLiblogTestCases_list is only outlet for host testing of
    the interfaces, but it is not part of any automated testing

Test: gTest liblog-unit-tests, liblog-benchmarks and
      CtsLiblogTestCases_list && build mmma system/core/liblog
Bug: 27405083
Change-Id: I13db1f45f67569407587a5a909248de33809b8cf
2017-02-08 13:37:44 -08:00
Mark Salyzyn 8f2492f582 liblog: benchmark: Use local LOGGER_NULL frontend
Additional benchmarks to check the effects and performance of the
frontend changes.

Test: manual liblog-benchmarks
Bug: 27405083
Change-Id: I2a9dba81b70e9d71cdb8de1b35e8dff099ad6038
2017-02-08 13:37:44 -08:00
Mark Salyzyn 850d06e1c9 liblog: Add android_set_log_frontend
android_set_log_frontend allows one to select LOGGER_DEFAULT,
LOGGER_LOGD or LOGGER_NULL, the latter allows a runtime mechanism to
turn logging on or off.  LOGGER_DEFAULT is LOGGER_LOGD.

Test: gTest liblog-unit-tests notably liblog.android_set_log_frontend
      and liblog-benchmarks before and after.
Bug: 27405083
Change-Id: I365dbee9f7d83112da0ef8d1cace748d247773c8
2017-02-08 13:37:41 -08:00
Josh Gao c2d9b60e0a Merge changes I1a28c21c,I02faec3b,I16a2050b
am: ec5d6cb8fd

Change-Id: I77a30bdf59ae0ec156d8ab2b9ad69b050e3e9ec2
2017-02-08 19:37:12 +00:00
Josh Gao db22633766 crash_dump: collect open files before dropping caps.
am: c24cc8a9e5

Change-Id: Ic27d13c1132e8dc6f3a36757e56eff4af65c55c4
2017-02-08 19:37:11 +00:00
Josh Gao 1255609232 debuggerd_test: improve error when crasher fails to exec.
am: 7a0ee64f9d

Change-Id: I6c07c11094e67f502c7d2cd71dac0cbf78e7d422
2017-02-08 19:37:06 +00:00
Josh Gao 8c1ebc6037 debuggerd_test: fix crasher path.
am: a7d7eb6d2a

Change-Id: Ie87aa723909ea7eb9ce7fef17c9145fc8ce11b42
2017-02-08 19:37:00 +00:00
Josh Gao ec5d6cb8fd Merge changes I1a28c21c,I02faec3b,I16a2050b
* changes:
  crash_dump: collect open files before dropping caps.
  debuggerd_test: improve error when crasher fails to exec.
  debuggerd_test: fix crasher path.
2017-02-08 19:31:57 +00:00
James Hawkins cdfe67f575 Merge "bootstat: Remove custom uptime parser in favor of elapsedRealtime."
am: 914955ae9e

Change-Id: I5565b341338f75e9dbdd8405b07419219f61a940
2017-02-08 17:32:47 +00:00
Ting-Yuan Huang 68a6676c77 Merge "liblog: fix an undefined-behavor in __write_to_log_daemon()"
am: a3b6d30ba7

Change-Id: I5a50c19876333dfec5445838e6bcd3c406cdc5b2
2017-02-08 17:32:32 +00:00
Treehugger Robot 914955ae9e Merge "bootstat: Remove custom uptime parser in favor of elapsedRealtime." 2017-02-08 17:28:12 +00:00
Treehugger Robot a3b6d30ba7 Merge "liblog: fix an undefined-behavor in __write_to_log_daemon()" 2017-02-08 17:21:58 +00:00
Ting-Yuan Huang 161953f49c Merge "liblog: fix a memory leak in __android_log_pmsg_file_write()"
am: a8629e8e15

Change-Id: I9eabd9930467bd540dbc603e68c3dcca4ba452df
2017-02-08 17:20:49 +00:00
Treehugger Robot a8629e8e15 Merge "liblog: fix a memory leak in __android_log_pmsg_file_write()" 2017-02-08 16:50:09 +00:00
Ting-Yuan Huang 6efb877973 liblog: fix an undefined-behavor in __write_to_log_daemon()
The behavior of passing NULL to c-string functions is undefined.

Test: passed clang-tidy checks
Bug: none

Change-Id: Ie7bcc43cd19bc4a1c314381af3929eae0a6154b9
2017-02-07 16:42:53 -08:00
Ting-Yuan Huang 106c3e6189 liblog: fix a memory leak in __android_log_pmsg_file_write()
Free the strdup()-ed filename before returning error.

Test: passed clang-tidy checks
Bug: none
Change-Id: I555492cb4e50400db758f7c721647a8747874a01
2017-02-07 15:53:32 -08:00
James Hawkins 26f40c04c3 bootstat: Remove custom uptime parser in favor of elapsedRealtime.
Refactored init/utils/boot_clock into base/chrono_utils.

Bug: 34352037
Test: none
Change-Id: Ied0c00867336b85922369d7ff37520e3d28fc61e
2017-02-07 15:43:32 -08:00
Mark Salyzyn a8c7b6e24f Merge "liblog: logger.h fortify comments"
am: 8eb237ad57

Change-Id: Ifedfe4ab79a915c712e4e4f967e6dd5514dbd6ff
2017-02-07 23:42:31 +00:00
Mark Salyzyn 8eb237ad57 Merge "liblog: logger.h fortify comments" 2017-02-07 23:36:55 +00:00