Commit graph

14020 commits

Author SHA1 Message Date
Elliott Hughes
56bf309843 Fix 32-bit build.
fs_config uses "unsigned int" instead of mode_t. Work around this.

Change-Id: I57b97d5bfc1b88089a41b4e8a50f1391b5c5113b
2015-08-25 11:01:39 -07:00
Elliott Hughes
8fcd8bc046 EINTR is handled by adb_read/unix_read and friends.
No need to clutter the code with cases that won't happen.

Change-Id: I47c5a2e6170f902d2618719f44492234a4869567
2015-08-25 10:59:45 -07:00
Elliott Hughes
d3c726064a Merge "Clean up error handling/reporting in file_sync_service.cpp." 2015-08-25 17:46:02 +00:00
Elliott Hughes
fdd4e58868 Clean up error handling/reporting in file_sync_service.cpp.
In an earlier code review it was pointed out that there was something
very weird about fail_errno. It didn't seem to make sense that we'd
often try to continue after reporting failure. This patch cleans up
all that and assumes that if we've reported failure to the client,
we should stop what we're doing.

Bug: http://b/23437039
Change-Id: I39c38650ed9f9d5e30adbf68a7545c9e4a6ab812
2015-08-25 08:41:05 -07:00
Steve Fung
b440e50b6f crash_reporter: Run with supplemental groups
In order to use metrics_lib, crash_reporter needs to be run with
system group permissions.  To use dbus, it needs dbus group
permissions.

Bug: 23406290
Change-Id: Ic679a057afa46aaadd59429aab0aea072c1973c5
2015-08-24 23:56:07 -07:00
Elliott Hughes
e13fd9aa23 Merge "lsof fixes." 2015-08-25 00:37:49 +00:00
Elliott Hughes
703a3f1d07 lsof fixes.
Change-Id: Ie3befc7c8e3540b9ebe93786e711f8445cf6f6c7
2015-08-24 17:21:31 -07:00
Tom Cherry
77d634f7dd Merge "remove TARGET_PROVIDES_INIT_RC" 2015-08-24 23:23:36 +00:00
Elliott Hughes
42640e5224 Merge "Add missing #include <memory> for std::unique_ptr on Windows." 2015-08-24 21:50:26 +00:00
Elliott Hughes
a925dba0e0 Add missing #include <memory> for std::unique_ptr on Windows.
Change-Id: Ic02f53003a20a646cbbf2aa08e0e10be9bd8b97f
2015-08-24 14:49:43 -07:00
Nick Kralevich
e80ec0c560 Merge "libutils: Enable LOCAL_SANITIZE := integer" 2015-08-24 21:39:28 +00:00
Elliott Hughes
93b9e8653e Merge "There are no big endian hosts, grandpa." 2015-08-24 21:29:31 +00:00
Elliott Hughes
f4465203b6 There are no big endian hosts, grandpa.
Change-Id: I6f64f702f919fe4af10d82c5f395a051571815ed
2015-08-24 14:27:03 -07:00
Mark Salyzyn
49afe0d00f logd: worst uid record watermark part deux
Only record watermark if not known, or represents the worst UID
currently under focus. This has resulted in a halving of the average
prune time in the face of heavy spam because we get less processing
spikes.

Bug: 23327476
Change-Id: I19f297042b9fc2c98d902695c1c36df1bf5cd6f6
2015-08-24 14:04:45 -07:00
Tom Cherry
0ea4ffdc06 remove TARGET_PROVIDES_INIT_RC
Change-Id: I15105a8dc11e218d95d4f5a4cee5b2a166d3d639
2015-08-24 13:56:43 -07:00
Elliott Hughes
186f1dee2a Merge "adb sync cleanup." 2015-08-24 20:48:01 +00:00
Ruchi Kandoi
cc338801e4 healthd: Adds cycle_count, current_now and full_charge properties.
Bug: 22981343
Change-Id: I4b942b891f61e6bf12e3b23f4e0ada5b7f14fd83
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-08-24 13:01:16 -07:00
Elliott Hughes
aa24549190 adb sync cleanup.
We can double the speed of "adb sync" (on N9) if we increase SYNC_DATA_MAX
from 64KiB to 256KiB. This change doesn't do that, because I still haven't
managed to plumb through the information about whether we're a new adb/adbd
to file_sync_client.cpp and file_sync_service.cpp. But this is already a big
change with a lot of cleanup, so let's do the cleanup and worry about the
intended change another day...

This change does improve performance somewhat by halving the number of
lstat(2) calls made on the client side, and ensuring that most packets are
sent with a single write. This has the pleasing result of making the null
sync on an AOSP N9 go from just over 300ms to around 100ms, which means it
now seems instantaneous (https://en.wikipedia.org/wiki/Mental_chronometry).

Change-Id: If9f6d4c1f93ec752b95f71211bbbb1c513045166
2015-08-24 11:15:01 -07:00
Nick Kralevich
4d587f2f9a libutils: Enable LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Change-Id: I475e5e9fb04160dd2d201e926ab2b897539f8bb6
2015-08-24 10:51:38 -07:00
Badhri Jagan Sridharan
e3c028836f Merge "adbd: enable USB SuperSpeed (again)" 2015-08-24 17:33:20 +00:00
Nick Kralevich
786e5e263b Merge "libutils: cleanups for -fsanitize=integer" 2015-08-24 15:52:57 +00:00
Nick Kralevich
1f28698998 libutils: cleanups for -fsanitize=integer
* Hashing functions rely on integer overflow behavior.
Mark those functions as safe.

* abort() if a passed in size_t value is greater than
UINT32_MAX. This can occur on 64 bit builds where size_t
is larger than uint32_t.

* Special case the index lookup for an empty sorted vector.
Without the special case, size() == 0, and size()-1 underflows.

Change-Id: I343a14b589fc8f0d221c1998ae5d6f0b9e2781f8
2015-08-24 15:52:22 +00:00
Siva Velusamy
9498fc68ec Merge "Use glog for logging in the OSX USB layer" 2015-08-24 15:35:51 +00:00
Siva Velusamy
743883b570 Use glog for logging in the OSX USB layer
Change-Id: I8a3a4dfc768fdd335f03dc582c85b410c808aeb7
2015-08-24 08:22:15 -07:00
Steve Fung
f87f5f90c5 Merge "crash_reporter: Fix tmp directory location" 2015-08-24 03:26:21 +00:00
Steve Fung
ea1e07e940 Merge "crash_reporter: Relicense as Apache 2." 2015-08-24 01:03:14 +00:00
Steve Fung
da98133cc0 crash_reporter: Fix tmp directory location
It is unsafe to use /data/local/tmp.  Use our own temporary
directory under /data/misc/crash_reporter.

Bug: 23430484
Change-Id: I186ba6b146bd884064177a3bb29b18b8edcc0b62
2015-08-23 17:57:19 -07:00
Yusuke Sato
3b94cef1b7 Merge "Add FORK_EXECVP_OPTION_CAPTURE_OUTPUT to logwrap.h" 2015-08-22 02:27:46 +00:00
Yusuke Sato
7980426a6f Add FORK_EXECVP_OPTION_CAPTURE_OUTPUT to logwrap.h
This allows raw popen calls in e.g. system/netd/ to be replaced
with android_fork_execvp_ext().

Change-Id: I159ece7369fa38ff8782024bef0d7cfafe74ecee
2015-08-21 17:14:59 -07:00
Chih-hung Hsieh
34d0e782af Merge "To compile with llvm integrated assembler." 2015-08-21 23:42:31 +00:00
Steve Fung
2e2dc00399 Merge "crash_reporter: Fix path to dbus-send" 2015-08-21 23:23:34 +00:00
Chih-Hung Hsieh
7244cf2aa5 To compile with llvm integrated assembler.
* Explicitly specify default .align 0.
* Use standard ldmfdlo instruction.
* Before and after gas outputs are identical,
  with align 0 sections.
* Objdump showed .text/.data/.bss section alignment
  attributes are 2^0 from gas and 2^2 from llvm
  assembler. These .S files might be working when
  compiled by gas, but llvm assembler's output should
  be more correct or conservative.

Change-Id: I4e578dbc8155c0d06d1bbc1c33ec4cc851a18479
2015-08-21 15:58:26 -07:00
Steve Fung
0f6c07b7b8 Merge "crash_reporter: Add Android.mk" 2015-08-21 22:08:32 +00:00
Tom Cherry
a1b2036f4d Merge "remove bundled services from rootdir/init.rc" 2015-08-21 20:16:52 +00:00
Tom Cherry
2d8be6c279 Merge "init: import init rc scripts from file systems after mount_all" 2015-08-21 20:16:46 +00:00
Tom Cherry
ff5be396d7 Merge changes from topic 'init-rc-breakup'
* changes:
  init: Queue Triggers instead of Actions
  bundle init.rc contents with its service
2015-08-21 17:42:29 +00:00
Tom Cherry
837135a64f remove bundled services from rootdir/init.rc
Services definitions for core services are now bundled with the source
for the service itself in the form of <service name>.rc.  These
individual .rc files are now located in /system/init/... and are
parsed when the system partition is mounted.

Bug: 23186545
Change-Id: Ia1b73af8d005633aa4252d603892064d7804163d
2015-08-21 10:14:44 -07:00
Tom Cherry
b8dd0272e5 init: import init rc scripts from file systems after mount_all
Import /{system,vendor,odm}/etc/init/... after file systems are mounted

Bug: 23186545
Change-Id: Idb0cae9773f904c0330054c8b3e31eb87b2fb7cb
2015-08-21 10:14:43 -07:00
Tom Cherry
cb716f976b init: Queue Triggers instead of Actions
When init queues a trigger, it actually enqueues all of the Actions
that match with that given trigger.  This works currently because
all init scripts are loaded and therefore all Actions are available
before init starts queueing any triggers.

To support loading init scripts after init has started queueing
triggers, this change enqueues Trigger objects instead of their
matching Actions.  Each Trigger object then matches its associated
Actions during its execution.

Additionally, this makes a few cosmetic clean ups related to triggers.

Bug: 23186545
Change-Id: I5d177458e6df1c4b32b1072cf77e87ef952c87e4
2015-08-21 10:14:43 -07:00
Tom Cherry
20391b1de5 bundle init.rc contents with its service
Bug: 23186545
Change-Id: I52616b8ab1165fdef716f9b8f958665f2308c12e
2015-08-21 10:14:43 -07:00
Mark Salyzyn
8a4beeb694 Merge "logd: switch asprintf to std::string" 2015-08-21 16:47:20 +00:00
Mark Salyzyn
67f3dd9c47 Merge "logd: statistics switch to std::string" 2015-08-21 16:43:28 +00:00
Mark Salyzyn
cf5bd8ba05 Merge "logd: white and black switch to std::string" 2015-08-21 16:43:15 +00:00
Steve Fung
cba296cacb Merge "metricsd: Give directory group permissions" 2015-08-21 16:39:26 +00:00
Mark Salyzyn
25967bbccb Merge "libsparse: use strcmp and validate last_used pointer" 2015-08-21 14:26:07 +00:00
lei wang wang
c227a1d855 libsparse: use strcmp and validate last_used pointer
This patch is used to fix two Bugs in backed_block.c

First, fix wrong comparing string way: we should use strcmp rather than
just compare their address. Second, fix using illegal memory risk in
bbl->last_used pointer. When entering queue_bb function,
bbl->last_used = new_bb, but in the following code if
queue_bb(xx, bb, new_bb) return ok, the space of new_bb is released. So
next time, if you use bbl->last_used pointer, may cause segment fault !

Change-Id: I6abb505f9b903b697448639fc64fb7518df5cca1
2015-08-21 14:23:31 +00:00
Steve Fung
8b8878a7d1 crash_reporter: Fix path to dbus-send
Bug: 22486906
Change-Id: If70b387bf95709719bb781719e7d0c195385be78
2015-08-21 02:17:01 -07:00
Steve Fung
3f62060b8d metricsd: Give directory group permissions
Since crash_reporter gets run as root, in order to use metrics_lib
it has to use group permissions to interact with metrics files.

Bug: 23406290
Change-Id: Ie9556233105312f973c0a3e018fc0305a466148d
2015-08-21 02:02:19 -07:00
Christopher Ferris
711e776cc2 Merge "Display the map offset for each frame." 2015-08-20 21:10:03 +00:00
Christopher Ferris
600017332c Display the map offset for each frame.
The dlopen of a shared library in an apk results in large map offsets.
Unfortunately, the current way that the frame data is printed, it's
impossible to tell what the relative pc is relative to. With the
addition of the offset, it's possible to figure out what the relative
pc actually references.

Bug: 23348999
(cherry picked from commit e0ab23223a)

Change-Id: I950f92c1cb29ee05eed777f47453efa03318cf3e
2015-08-20 14:07:30 -07:00