* changes:
logd: clearAll by UID speedup
logd: clear return and deal with busy if readers locked
logd: update region lock after entry has passed to reader socket
logcat: do not exit buffer loop on error
logd: clientHasLogCredentials false negatives
procrank only exists on userdebug/eng builds. For those builds,
procrank can be executed by running "su 0 procrank" instead of
relying on the binary being setuid root. This reduces the number
of setuid binaries on Android and allows for the deletion of
SELinux policy to support this.
Bug: 18342188
Change-Id: I982283f2e0f6fbe5efaffc08501c1ec175f65373
- If doing a clear, skip accounting
- Ensure for busy checking, behind a region lock for instance, only
break out if there was something to do. Basically move the filter
actions first, and defer checking the region lock to the ends of
the loops.
Bug: 23711431
Change-Id: Icc984f406880633516fb17dda84188a30d092e01
- Propagate to caller the clearing errors, busy blocked by reader.
- For clear, perform retries within logd with a one second lul each,
telling readers to skip, but on final retry to kill all readers if
problem still persists due to block reader (or high volume logspammer).
Bug: 23711431
Change-Id: Ie4c46bc9480a7f49b96a81fae25a95c603270c33
- The reader region level indicates the location to protect, but once
it has been passed to the calling reader, then allow us to go
one beyond so that a clear or prune thread can remove the entry.
Bug: 23711431
Change-Id: I0f2389858dd8c83366c034360f67d7c363625b56
- Alter logcat to collect error(s) for open, clear, get size or set
size; moving on to other buffer ids. Then after loop completed,
report and exit for the last error reported.
Bug: 23711431
Change-Id: I63a729d27544ea8d5c6119625c1de0210be0eb70
Vote three times in /proc/pid/status to look for AID_LOG group
If not, we may default to the callers UID, and the net result is
to perform the task related to that UID. For adb logcat and
shell logcat, the UID is AID_SHELL which typically has no logs,
leaving no net action taken.
Bug: 23711431
Change-Id: I2b5900a2d37173bd995eb308ee9ecafa20602b62
If -d/-e fail, get-serialno and friends will now report an error
and return a failure status code on exit.
Also fix the behavior of -d/-e with $ANDROID_SERIAL --- -d/-e
should override $ANDROID_SERIAL, not the other way round.
I'm deleting my own comment here about always returning "unknown"
for scripts. I can't find any evidence that there are scripts
relying on that, so I think my comment meant "I fear that there
are scripts doing so".
Bug: http://b/24403699
Change-Id: Ie13a751f1137abcfe0cc6c46a0630ba5e02db676
Ensure that /data/misc/update_engine exists since it will be referenced
by selinux policy.
Bug: 23186405
Change-Id: I96e4ff341086da6474ef7f7c934f1f35bffc1439
We use product_id instead of build_target_id, the protobuffer should
rename that field too to be consistent.
The same change was made on the backend.
BUG: 24712895
Change-Id: Id9492e3debab986c9df7d4ec0caef8730eb14240
Issue introduced as part of new logcatd functionality in
commit f3555d9427
Faulty logic, add a gTest to confirm.
Bug: 19608716
Change-Id: Ic1b97def25e03e69faae4398a3dff2ff0f88545e
metrics_daemon will export _metrics._AnalyticsReportingState containing
"enabled"/"disabled" depending on the current state and two weave
commands (_metrics._{enable,disable}AnalyticsReporting) to update it.
BUG: 24386281
TEST: manual. Enabled and disabled metrics reporting.
`metrics_client -c` reports the correct answer.
Change-Id: Ic4a5ffc1e9f9cbc0b47ee34d3af83584d95da155
metrics_daemon should never get a stale answer on whether or not the
metrics are enabled.
This is important as metrics_daemon will be the "source of truth" for
other components.
BUG: 24386281
TEST: unit tests.
Change-Id: I573568abe5d1b840683cede2fdf32cdae028a81a
"Out of date" is only probably true. You might equally well have an older
client talking to a newer server. So tell the truth and include the actual
version numbers.
Change-Id: I821de88f5baf65bf2623363129c60c496b407bff
Discovered that we had a few libc hotspots. Adjust code to generally
reduce or nullify the number of calls to malloc, free, strlen,
strcmp, strncmp, memcmp & strncasecmp. Total gain looks to be about
3% of logd's processing time. malloc still contributes to 3%, but all
others are now total 0.5%.
Bug: 23685592
Change-Id: Ife721121667969260cdb8b055524ae90f5911278
Sending the SEND/DATA/DONE packets all in one write makes small file and
symbolic link transfer orders of magnitude faster. Transferring all the
symbolic links in /system/bin or all the cacerts in /system/etc goes down
from about 6s in each case to less than 0.5s.
Change-Id: Ia1706cef25535d0b685d3744241a0557a52b22ff
strcmp was 1/10 #2 behind find_property in __android_log_level(),
now virtually eliminated from performance profile.
Bug: 23685592
Change-Id: I3978886193af77e489c6d1728d6a26b7f53f8f2f
Instead of reporting the metrics over both a long and a short period,
collect and report only over a short period. This makes the code simpler
and the metrics easier to understand.
Also move the collection out of metrics_daemon and into a separate
collector to make it simpler to understand.
BUG: 24464945
Change-Id: I17e52536aaa75321a5e34f42ed488545c2c3efde