Commit graph

13045 commits

Author SHA1 Message Date
Elliott Hughes
e49236b3da Fix whitespace in debug logging.
Change-Id: I949317deaf782fea18b5c38b22dfd41811608276
2015-06-04 15:21:59 -07:00
Mark Salyzyn
7ea9e8d266 Merge "logd: switch to unordered_map from BasicHashtable" 2015-06-04 18:01:01 +00:00
Rom Lemarchand
4d2c1ee141 Merge "mkbootimg: misc typo fixes" 2015-06-04 17:01:00 +00:00
Rom Lemarchand
a8221d3427 mkbootimg: misc typo fixes
- Fix whitespace in parse_int
- Use two dashes for kernel_offset instead of four

Change-Id: I59667da457d0f0d78a946e543d1aa0aec5e682d5
2015-06-04 09:59:01 -07:00
Mark Salyzyn
79ae578edd Merge "liblog: logcat: Add printable format modifier" 2015-06-04 15:34:48 +00:00
Mark Salyzyn
b932b2f8ba liblog: logcat: Add printable format modifier
- added printable format modifier:
  logcat -v printable
- opencoded borrowed individual utf8 validity checking algorithm
  from utf8_length() in libutils/Unicode.cpp
- if considered basic one-character ASCII, use popular \x escape
  sequences for non-printable
- logprint convert to C comments to drop mixed-mode

Bug: 19000361
Change-Id: I122a5b8fb41216fc0bc816178c0b768f3df56586
2015-06-04 08:27:29 -07:00
Elliott Hughes
ecb6d5648d Merge "Add a working Windows tmpfile(3) to fastboot." 2015-06-03 23:21:02 +00:00
Elliott Hughes
a26fbeeaa4 Add a working Windows tmpfile(3) to fastboot.
Windows' tmpfile(3) implementation requires administrator rights because
it creates temporary files in the root directory. Write an alternative
that uses the user's temporary directory instead.

Bug: http://b/21558406
Change-Id: Ic9aece5c69429797a332a97681a76b76ac3551bf
2015-06-03 15:27:52 -07:00
Nick Kralevich
2ec8850167 Merge "tzdatacheck: don't hard code SELinux domain name" 2015-06-03 20:30:23 +00:00
Nick Kralevich
221fca7ddd tzdatacheck: don't hard code SELinux domain name
An automatic domain transition is already defined by SELinux
policy. Avoid having redundant information on the exec line.

This commit depends on commit 17fff893c0
which made the SELinux process label optional.

Change-Id: I89464f2bd218c7d6e8db08aa6bed2b62ec6dad2a
2015-06-03 13:08:49 -07:00
Mark Salyzyn
511338dd57 logd: switch to unordered_map from BasicHashtable
BasicHashtable is relatively untested, move over to
a C++ template library that has more bake time.

Bug: 20419786
Bug: 21590652
Bug: 20500228
Change-Id: I926aaecdc8345eca75c08fdd561b0473504c5d95
2015-06-03 13:03:07 -07:00
Elliott Hughes
d3d32a1b13 Merge "Fix file descriptor leak when opening invalid archives." 2015-06-03 19:18:12 +00:00
Narayan Kamath
f6e9ffbc73 Fix file descriptor leak when opening invalid archives.
Also add -Wunreachable-code to the set of compiler flags, otherwise
noreturn becomes considerably less useful.

bug: https://code.google.com/p/android/issues/detail?id=171099
Change-Id: I9a95d45633c731c7046d4e4a39844d9cebfd1718
(cherrypick of 241bcf05e0e394bbf2681f359f52646dd6c707f6.)
2015-06-03 12:16:43 -07:00
Christopher Ferris
493cdcbb77 Merge "Change the 64 bit map address format." 2015-06-03 18:53:42 +00:00
Badhri Jagan Sridharan
59be5aedbf Merge "libziparchive: fix fallocate failures" 2015-06-03 18:04:53 +00:00
Elliott Hughes
ac462d9333 Merge "Don't say "update package missing" unless we mean it." 2015-06-03 18:02:53 +00:00
Badhri Jagan Sridharan
a68d0d1fe4 libziparchive: fix fallocate failures
The objective of fallocate call seems to be to
make sure that we have enough enough space left
in the disk to house the uncompressed file.
But, fallocate is only supported in the following
file systems:
btrfs, ext4, ocfs2, and xfs

Return error only when fallocate fails due to
lack of space. The immediate ftruncate call is
going to take of the majority of other errors.

Bug: 21561449
Change-Id: I7083f3c7e5d745bd6e8a190ac9020297d638d9d4
2015-06-03 11:02:26 -07:00
Elliott Hughes
acdbe92c60 Don't say "update package missing" unless we mean it.
unzip_to_file reports failures itself these days, so there's it's unhelpful
of the caller to just guess what might have gone wrong.

Bug: http://b/21558406
Change-Id: I1e3d06c6cf902b8c6ef333dc60fd8f49680a493b
2015-06-03 11:01:41 -07:00
Christopher Ferris
862fe02919 Change the 64 bit map address format.
Previously, the map printing in tombstones for 64 bit devices uses
a variable length value. This means that the maps are not lined up.
The new format is to print the map as 00000000'00000000 in all ways.

Also fix a bug where the backtrace_map_t did not initialize all
parameters.

Add unit tests for all of the dump_all_maps function.

Bug: 20950813
Change-Id: I30901c8a0251b00d85c4c01476b033ef8db84e32
2015-06-03 10:24:21 -07:00
Elliott Hughes
f26eb51c2a Merge "Add "fastboot --version"." 2015-06-03 02:36:50 +00:00
Rom Lemarchand
8773d62c74 Merge "mkbootimg: parse hexadecimal ints" 2015-06-03 02:04:16 +00:00
Rom Lemarchand
45f2ce1cb8 mkbootimg: parse hexadecimal ints
Allow passing int arguments as hexadecimal values

Change-Id: If5a199007e9868f994dd740ccd15c455eb536327
2015-06-02 19:01:25 -07:00
Elliott Hughes
98a4dd48bd Merge "'usb' doesn't need to be global in fastboot." 2015-06-03 01:14:32 +00:00
Rom Lemarchand
f34015bf36 Merge "mkbootimg: delete obsolete C source" 2015-06-02 23:13:13 +00:00
Rom Lemarchand
fe18b45ade Merge "mkbootimg: turn into a python script" 2015-06-02 23:12:49 +00:00
Rom Lemarchand
2aa78ce625 mkbootimg: delete obsolete C source
Change-Id: Ic36cbf370b7d54c3dd425a25d938c661e8d3405a
2015-06-02 16:10:52 -07:00
Rom Lemarchand
ad6ec0c7fe mkbootimg: turn into a python script
Turn mkbootimg into a python script instead of a C utility

Change-Id: I36d35dfacfbbef2cc16bd6695ab15ee716bb0cdb
2015-06-02 16:10:52 -07:00
Mark Salyzyn
0bda352f7f Merge changes from topic 'logcatd'
* changes:
  init.rc: logd: Add logpersistd (nee logcatd)
  init: change exec parsing to make SECLABEL optional
  logcat: -f run in background
  logcat: -f flag to continue
2015-06-02 22:20:24 +00:00
Mark Salyzyn
100658c303 init.rc: logd: Add logpersistd (nee logcatd)
- logpersistd is defined as a thread or process in the context of the
  logd domain. Here we define logpersistd as logcat -f in logd domain
  and call it logcatd to represent its service mechanics.
- Use logcatd to manage content in /data/misc/logd/ directory.
- Only turn on for persist.logd.logpersistd = logcatd.
- Add logpersist.start, logpersist.stop and logpersist.cat debug
  class executables, thus only in the eng and userdebug builds.

ToDo: Wish to add Developer Options menu to turn this feature on or
off, complicated by the fact that user builds have no tools with
access rights to /data/misc/logd.

Bug: 19608716
Change-Id: I57ad757f121c473d04f9fabe9d4820a0eca06f31
2015-06-02 15:17:59 -07:00
Mark Salyzyn
17fff893c0 init: change exec parsing to make SECLABEL optional
Allow SECLABEL to be - to denote default

Change-Id: I58cdc6c805dc6e50dc42b7e13e72d0eaf4864f11
2015-06-02 15:17:52 -07:00
Mark Salyzyn
3ef730c57f logcat: -f run in background
- if saving to file, set SP_BACKGROUND policy
- if saving to file, set BATCH priority
- sort include files

Bug: 19608716
Change-Id: I00acb8b8db0d2ff9ff36c97f9e74604d31938376
2015-06-02 14:56:44 -07:00
Mark Salyzyn
f3555d9427 logcat: -f flag to continue
On startup, check the current logging content, then grab logs from
that time forward rather than restarting from the beginning. Add
support for reading tail time down to the nano-second.

Bonus, permits us to create a logcatd logpersist daemon

Bug: 19608716
Change-Id: Iaab58de4c02b7f97c69de12cf954fedc2163059e
2015-06-02 14:56:44 -07:00
Spencer Low
d0f66c3616 adb: win32: fix logging to adb.log
In the adb client, redirect stdin and stderr of the adb server to `nul',
so that when the adb server starts up, it avoids issues in the C Runtime
where it closes stderr, making it hard to properly reopen. There are
probably other ways to avoid this issue, but I think this is the
cleanest that will keep working over the years and will exercise the
most commonly used code-paths in the C Runtime.

Fix some adb_close() calls to be unix_close() (only really matters on
Windows).

Make stderr non-buffered on Windows, to match the (sensible) Linux
behavior.

Change-Id: I1b15c64240e50dbeb56788b0d0d901f4536ad788
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-06-02 21:04:56 +00:00
Mark Salyzyn
66e39275be Merge "rootdir: init.trace.rc too early" 2015-06-02 21:01:03 +00:00
Elliott Hughes
379646b2ca Add "fastboot --version".
So bug reporters can actually tell us what they're running.

Bug: http://b/21583225
Change-Id: If2a4ae97b4792aa321566603ce2c354a72d32307
2015-06-02 13:50:00 -07:00
Elliott Hughes
c0ce65f961 'usb' doesn't need to be global in fastboot.
Change-Id: Id014399640865d889918661bae0161b3165eee48
2015-06-02 13:34:07 -07:00
Mark Salyzyn
89357d23a1 rootdir: init.trace.rc too early
debugfs is mounted on boot

Bug: 21566233
Change-Id: I2ba106fbb1e8164ff3d8b2d5b16a16d7926c2732
2015-06-02 12:51:42 -07:00
Rom Lemarchand
1333694c85 Merge "system/audio.h: Make function inline" 2015-06-01 22:08:30 +00:00
Mark Salyzyn
a8b6131ddf Merge "logd: test modernization" 2015-06-01 21:16:58 +00:00
Mark Salyzyn
10a124d342 Merge "logd: whitelist should not preserve expire messages" 2015-06-01 21:16:57 +00:00
Mark Salyzyn
fba413d831 Merge changes I04fad67e,I5ab24bc7
* changes:
  logd: KISS & fix preserve a day
  logd: deal with sloppy leading expire messages
2015-06-01 21:16:11 +00:00
Christopher Ferris
7a67c3359d Merge "Modify the code to avoid potential deadlocks." 2015-06-01 21:08:36 +00:00
Christopher Ferris
2d09171758 Modify the code to avoid potential deadlocks.
If the signal to dump a thread is never delivered, then it's
possible for a deadlock. The signal handler is responsible for
unlocking and deleting the ThreadEntry created for the pid/tid
combination. This means if the signal is lost, the ThreadEntry
gets stuck locked and never deleted. If a second attempt to get
a backtrace of this thread occurs, there is a deadlock.

Also, decrease the timeout from 10 seconds to 5 seconds. The original
10 seconds was because the unwind was actually done in the signal
handler. Now the signal handler does nothing but copy the ucontext
structure and let the caller do the unwind.

Bug: 21086132
Change-Id: Idc735dbf6147ec879d35bd4f034c5d227e26a98d
2015-06-01 13:51:51 -07:00
Mark Salyzyn
5921276a16 logd: KISS & fix preserve a day
Code in 833a9b1e38 was borken,
simpler approach is to simply check last entry (to save a
syscall) minus EXPIRE_HOUR_THRESHOLD. This does make longer logs
less likely to call upon the spam detection than the algorithm
being replaced, but sadly we ended up with a log entry in the
future at the beginning of the logs confounding the previous
algorithm.

Bug: 21555259
Change-Id: I04fad67e95c8496521dbabb73b5f32c19d6a16c2
2015-06-01 13:06:35 -07:00
Mark Salyzyn
5392aac95d logd: deal with sloppy leading expire messages
The odds of chatty content also leading the logs is pretty high eg:

 1799 12017 I logd: uid=10007 chatty comm=Binder_B, expire 4 lines
 1799  1829 I logd: uid=10007 chatty comm=Binder_2, expire 4 lines
 1919 20637 I logd: uid=10007 chatty comm=m.sersistent, expire 1 line
 1919 20638 I logd: uid=10007 chatty comm=s.persistent, expire 1 line
 1919  2316 I logd: uid=10007 chatty comm=UlrDispatch, expire 4 lines
19379 20634 I logd: uid=10045 chatty, expire 14 lines
19379 19388 I logd: uid=10045 chatty comm=lizerDaemon, expire 4 lines
  591  4396 I logd: uid=1000 chatty comm=Thread-220, expire 5 lines
  591  1377 I logd: uid=1000 chatty comm=Thread-92, expire 4 lines
 1919  2267 I logd: uid=10007 chatty comm=WifiScanner, expire 4 lines
  591  4397 I logd: uid=1000 chatty comm=DhcpClient, expire 4 lines
  591  4398 I logd: uid=1000 chatty comm=Thread-222, expire 4 lines
  226   580 D CommandListener: Setting iface cfg

Change-Id: I5ab24bc7bf5d2690bae7e789831b07f23ff8bcc6
2015-06-01 13:04:09 -07:00
Elliott Hughes
ce817c38d2 Merge "Fix error handling/reporting for "adb forward" and "adb reverse"." 2015-05-30 01:29:20 +00:00
Evgeniy Stepanov
5788769ddc Merge "Revert "Fix ODR issues in ART."" 2015-05-30 01:16:54 +00:00
Elliott Hughes
424af02f36 Fix error handling/reporting for "adb forward" and "adb reverse".
We really need better infrastructure for parsing adb subcommands, but
in the meantime...

At least this cleans up a little more of the implementation too.

Bug: http://b/20736014
Change-Id: I76209847da3724906c71924017bcb69fa31e0b49
2015-05-29 18:03:57 -07:00
Evgeniy Stepanov
a8cc2081b4 Revert "Fix ODR issues in ART."
Fails build on Mac.

This reverts commit 2148a1243e.

Change-Id: Ib4f0ba0b0a42500f20b7d73ca91363477fe3d093
2015-05-30 00:47:30 +00:00
Arman Uguray
0aee2ac3a0 system/audio.h: Make function inline
This patch makes the audio_device_address_to_parameter inline. All of the other
helpers defined in this header are inline functions except for this one and this
causes compile failures when -Werror=unused-function is used.

BUG=21339022

Change-Id: I7db58bf7bed3b89b6752ec2cd2c1f358ba2a4d89
2015-05-29 16:12:31 -07:00