Commit Graph

20223 Commits

Author SHA1 Message Date
Casey Dahlin 5c8b99da1a Merge changes Ie52ddf30,Idfa637f6
* changes:
  logcat: Add --max-count option
  logcat: Add --regex option
2016-03-25 21:41:27 +00:00
James Hawkins c0dc139b4a Revert "Revert "bootstat: Handle v1 record files which do not contain file contents.""
This reverts commit 756b6a53a7.

The change is updated to use utimes (instead of futimens) since only
support for seconds resolution is required.

Bug: 27836969
Change-Id: I7134f759fb643e1a149158fcf6e20f76538b57d3
2016-03-25 14:26:13 -07:00
Casey Dahlin 6ac498d4bb logcat: Add --max-count option
This new option causes logcat to quit after it prints N messages.

Test: New unit test passes
Bug: 27706081
Change-Id: Ie52ddf300160a041e68a6bac0ae7ade68bb28a7c
2016-03-25 13:55:29 -07:00
Casey Dahlin dc42a8734e logcat: Add --regex option
You can now filter log output by a regex on the messages.

Test: New unit test passes
Bug: 27706081
Change-Id: Idfa637f62a25fb1b92e9b49b89572dff0fec6e08
2016-03-25 13:55:29 -07:00
James Hawkins 5d47ab5a3a Merge "Revert "bootstat: Handle v1 record files which do not contain file contents."" 2016-03-25 18:24:37 +00:00
James Hawkins 756b6a53a7 Revert "bootstat: Handle v1 record files which do not contain file contents."
Breaks the darwin-x86 build.

This reverts commit 84fda19c83.

Change-Id: Ia55b5ba756ec2ba4195f493ea505d05f68a9c37e
2016-03-25 18:21:58 +00:00
Daniel Cashman bb296fdaec Merge "Revert "Set mmap_rnd_bits to maximum value."" 2016-03-25 17:50:47 +00:00
Daniel Cashman c8f026fc9c Revert "Set mmap_rnd_bits to maximum value."
Prebuilt kernels have not been updated with the requisite patches.

This reverts commit c819e78e7f.

Change-Id: I8e63373a9b8a1e5adcb2471dfe43bde28e3f8e65
2016-03-25 10:45:20 -07:00
James Hawkins 593ea57553 Merge "bootstat: Handle v1 record files which do not contain file contents." 2016-03-25 17:23:26 +00:00
James Hawkins 84fda19c83 bootstat: Handle v1 record files which do not contain file contents.
Bug: 27836969
Change-Id: I18fcdab7ca32d00af3f8827f42d47868492ed719
2016-03-25 09:34:44 -07:00
Alex Deymo 92a70439d6 Merge "fastboot: Minor fix to help text." 2016-03-25 04:38:12 +00:00
Alex Deymo f62d0cd943 fastboot: Minor fix to help text.
Help text had some missing end of line markers.

Bug: None
TEST=make out/host/linux-x86/bin/fastboot; fastboot

Change-Id: Iaa9e4e0a2d70c7d427f5e99e72fe1c2e2c26ee92
2016-03-24 19:51:05 -07:00
Mark Salyzyn abdb758ef6 Merge "liblog: logprint: deal with malformed log messages" 2016-03-24 19:20:29 +00:00
Kees Cook b27026f925 Merge "init: improve mmap ASLR failure reporting" 2016-03-24 02:44:25 +00:00
Elliott Hughes 54c72aaccc Fix <android-base/*.h> header guards.
I've been meaning to do this for a while, and it came up on the bug below
that there have been conflicts with similar-named files in <base/*.h>,
so let's rule out one possible explanation.

Bug: http://b/27804373
Change-Id: I69e5d52b6260c573c308513420aee0e281426bd4
2016-03-23 15:04:52 -07:00
Elliott Hughes c0e6e40cc9 Copy the good comment and warn_unused_result from ScopedFd to unique_fd.
Also list all known aliases of this class to increase the chances that
anyone searching for it by another name finds it anyway.

Change-Id: I58ea0a5421987fb69f93cc56252a771e9c34147e
2016-03-23 14:56:37 -07:00
Josh Gao 8aeabe15dd Merge "debuggerd: waitpid for all children, and log the result." 2016-03-23 21:10:38 +00:00
Josh Gao 6e183586e3 Merge "debuggerd: always send SIGCONT after detaching." 2016-03-23 21:09:21 +00:00
Josh Gao 2808005521 debuggerd: waitpid for all children, and log the result.
Change-Id: Ic575e6db76ab153b4b238589a8cd299812d0e046
2016-03-23 14:07:58 -07:00
Josh Gao 24464185eb debuggerd: always send SIGCONT after detaching.
Bug: http://b/27330889
Change-Id: I104248af1cde03dbdbacc03c87fe7e2dffd6c037
2016-03-23 14:07:58 -07:00
Elliott Hughes 6c03e3111d Merge "Switch debuggerd over to unique_fd." 2016-03-23 18:36:54 +00:00
Kees Cook 39caeb5bee init: improve mmap ASLR failure reporting
This should help people track down the reason for entropy setting
failures.

Bug: 27681085
Change-Id: I6bde342ca0215e32c1f851365a1723630c7d4372
2016-03-23 10:00:11 -07:00
Mattias Nissler 4c9b1494e2 Merge "Add nvram user." 2016-03-23 08:17:56 +00:00
Pierre Imai e65f8bedec Merge "Add C++ thread annotations support to core." 2016-03-23 03:13:22 +00:00
Elliott Hughes ae38923c3e Switch debuggerd over to unique_fd.
Change-Id: I858b9ac6a3ed47b4cc81cfe49f1ceb1e06356a03
2016-03-22 20:03:13 -07:00
Pierre Imai 021ea2d176 Add C++ thread annotations support to core.
Change-Id: I7b8940c12e0f3121d8c09d86d2d4077b0a0ce376
2016-03-23 11:23:28 +09:00
James Hawkins ce8bc7b3fa Merge "bootstat: Track record inconsistencies w/ a debug metric, bootstat_mtime_matches_content." 2016-03-23 01:22:56 +00:00
Daniel Cashman 8108b80d55 Merge "init: Fix typo." 2016-03-22 23:18:04 +00:00
dcashman 754dd9660f init: Fix typo.
Bug: 27681085
Change-Id: I4308435a5b58189852c991d1bec65ed11933566a
2016-03-22 16:15:24 -07:00
James Hawkins 6f28299d0d bootstat: Track record inconsistencies w/ a debug metric, bootstat_mtime_matches_content.
Fixed a file descriptor leak while I was in here.

Bug: 27550578
Change-Id: I8e252e4f5bb3c4e2ae96a1560fbb32ae636722a0
2016-03-22 16:02:01 -07:00
Daniel Cashman 4390837bf9 Merge "Temporarily add set_mmap_rnd_bits brillo exception" 2016-03-22 22:38:33 +00:00
dcashman 3396b4b665 Temporarily add set_mmap_rnd_bits brillo exception
(cherry-picked from internal commit: 69022e03d8)
Bug: 27794137
Change-Id: Idc6fc1e208bdb19556173d40215feb66e235c6d6
2016-03-22 15:37:19 -07:00
Mark Salyzyn 593a5c1573 Merge changes from topic '27176738-pmsg-write-core'
* changes:
  liblog: add __android_log_pmsg_file_read
  liblog: add __android_log_pmsg_file_write
  liblog: split out transports into separate files
2016-03-22 20:59:11 +00:00
Daniel Cashman 8eacf24283 Merge "Set mmap_rnd_bits to maximum value." 2016-03-22 20:21:08 +00:00
dcashman c819e78e7f Set mmap_rnd_bits to maximum value.
Also make sure it is above a minimum threshold, else abort.

(cherry-pick of internal commit: 5d36813dc8)

Bug: 27681085
Change-Id: Ia1d9583254fd64828092533298a99ec64b8233f7
2016-03-22 13:16:26 -07:00
Mark Salyzyn 864e8e80e4 liblog: add __android_log_pmsg_file_read
- This is considered an Android Private function, not exported
  for general use.
- goal is to retreive a file's content from a series of log
  messages from pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- files are presented in reverse sorted order, first based on
  _any_ numerical content, then by alphanumeric order.
- Add a gTest for this function, relies on gTest for
  liblog.__android_log_pmsg_file_write from prior to reboot.

Bug: 27176738
Change-Id: If37ef423009bd28b598b233af3bccef3429bdc22
2016-03-22 13:03:53 -07:00
Mark Salyzyn d4b061bde2 liblog: add __android_log_pmsg_file_write
- This is considered an Android Private function, not exported
  for general use.
- goal is to record a file's content into a series of log
  messages into pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- filename reference is converted to a tag-unique
  "<dirbase>:<filebase>".
- buffer and length representing the filename contents are
  recorded, along with a sequence number placed into the nsec
  time field to ANDROID_LOG_PMSG_FILE_MAX_SEQUENCE.
- Add a gTest for this function.

Bug: 27176738
Change-Id: If93df3ae8bfc1bb75516d4a1fd8dae0301af644b
2016-03-22 13:03:36 -07:00
Mark Salyzyn 018a96d03f liblog: split out transports into separate files
Create config_logger, logger and logger_read to house the log
interfaces. Add fake_logger, logd_logger and pmsg_logger to
house the write and read transports. Allows for an easier and
direct path to add new transports to the library.

SideEffects: None, logger benchmark performance unaffected

Bug: 27176738
Bug: 27405083
Change-Id: I01b38637334a5242905c8c89f6ab0a92e2540008
2016-03-22 13:01:15 -07:00
James Hawkins c30eb20658 Merge "bootstat: Add a value option to allow recording an associated value for a boot event." 2016-03-22 19:44:57 +00:00
James Hawkins c627558a48 bootstat: Add a value option to allow recording an associated value for a boot event.
This has been useful in debugging, but I could see it being used
practically.

Change-Id: Ied6e23d0f7a1bc39f606b2dba88fea92adc31bda
2016-03-22 11:45:59 -07:00
Mattias Nissler 0897ab0849 Add nvram user.
This is intended to be used by user space daemons that are part of
access-controlled NVRAM HAL implementations for Brillo. Because there
might be sensitive data flowing through the daemon, we'd like to run
it as a separate user.

BUG: 27764637
Change-Id: If6ad7923af3c650963ee9e926f732001b6a8cb5d
2016-03-22 10:11:26 +01:00
Yabin Cui 80b1b18828 Merge "base: Avoid compilation error when compiled with -Wdangling-else." 2016-03-22 01:50:16 +00:00
Yabin Cui 2527628eda base: Avoid compilation error when compiled with -Wdangling-else.
As logging macros uses `if xxx else yyy` style, it is reported as an
error when DCHECK() is compiled with -Wdangling-else option. Because
after preprocess, DCHECK(x) becomes:
if (EnableDChecks)
  if (x)
    ;
  else
    LogMessage(FATAL) << yyy;

This CL avoids compilation error by replacing `if xxx else yyy`
with `xxx && yyy` or `!(xxx) || yyy`.

Bug: 26962895

Change-Id: Ib0bf242cc04a238ec31a1ab66b53fc8a5b5ed28f
2016-03-21 17:46:21 -07:00
Mark Salyzyn 083c53462a liblog: logprint: deal with malformed log messages
Try to print as much content as possible should the application
logging only submit content as part of a tag with an empty message.
We search for the first non-printable ascii character in the tag, in
order to split it up for printing.

Applications (such as com.yahoo.mobile.client.android.weather) that
malform their log messages will no longer be punished by truncating
the content, but this should never be considered advocacy for their
bad behavior.

Bug: 27585978
Change-Id: Idb0680e8d6a6ad2bef5150661905acccb5b70afb
2016-03-21 23:06:29 +00:00
Elliott Hughes a01de8fee1 Merge "Multiple consoles" 2016-03-21 16:49:37 +00:00
Viorel Suman 70daa67062 Multiple consoles
This CL allows enabling of multiple consoles. A service can be
mapped to a specific console by providing the optional argument,
IE "tty0", to "console" service attribute as follows:

service fbconsole /system/bin/sh
    class core
    console tty0
    disabled
    user shell
    group shell log readproc
    seclabel u:r:shell:s0

Bug: None
Change-Id: I3b24e7f6848bbe5c6475f11334c04ec536e6af88
Tracked-On: https://jira01.devtools.intel.com/browse/BP-289
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
2016-03-21 08:50:01 -07:00
Alex Vakulenko 5b8ab65123 Merge "metricsd: Fix upload service to compile with new libchrome version" 2016-03-21 15:43:33 +00:00
Elliott Hughes ba44383197 Merge "Revert "Enable multiple consoles"" 2016-03-21 15:15:03 +00:00
Viorel Suman efc7275172 Revert "Enable multiple consoles"
This reverts commit caafe5c620.

Bug: None
Change-Id: Iea2a80003d996ce542393242f87dc658ac6d01c9
Tracked-On: https://jira01.devtools.intel.com/browse/BP-289
Signed-off-by: Viorel Suman <viorel.suman@intel.com>
2016-03-21 11:21:19 +02:00
Alex Vakulenko 3d979292d8 metricsd: Fix upload service to compile with new libchrome version
libmetric's HistogramSnapshotManager::PrepareDeltas now takes the
iterators for the histogram collection to work on, instead of getting
a global one.

Change-Id: I3997ea7d2c330431379d055b0cb876069bddf395
2016-03-18 15:36:20 -07:00