Commit graph

591 commits

Author SHA1 Message Date
Mark Salyzyn
72031ab878 Merge "logd: liblog: ALOG silently drops excessively long messages" 2014-04-24 23:12:57 +00:00
Mark Salyzyn
8444eb81b3 logd: liblog: ALOG silently drops excessively long messages
Bug: 14280914
Change-Id: Idddd29784625094e54144953c29f64692a88eee9
2014-04-24 15:49:57 -07:00
Mark Salyzyn
7260a5c348 logd: Add README.property
Change-Id: I89da10a73470b037f1811a9890d959cae186f257
2014-04-24 15:07:54 -07:00
Mark Salyzyn
696817d352 liblog: Statistics truncated to 16384 bytes
- if network read/write broken up, reassemble the pieces.
- Use a 20ms poll to check if a new fragment has been
  sent by the other side.
- fixup logd-unit-tests to take a (simplified) fragment
  from the liblog changes.

Bug: 14164765
Change-Id: I98ff87888c119e1e8349717646d0f733e8971bc8
2014-04-21 17:07:25 -07:00
Mark Salyzyn
3ad0af6d04 Merge "logd: liblog: logcat: debuggerd: Add LOG_ID_CRASH" 2014-04-17 23:12:10 +00:00
Mark Salyzyn
dfc47e8685 logd: libsysutils: logd startup outside init environment
Change-Id: I3426b6c3eebdd0c8258e966dcaaaa2825d7a23d1
2014-04-17 16:14:24 +00:00
Mark Salyzyn
99f47a9e7c logd: liblog: logcat: debuggerd: Add LOG_ID_CRASH
Change-Id: Iea453764a1a4fc1661f461f10c641c30150e4d20
2014-04-16 15:38:50 -07:00
Mark Salyzyn
d3ba665020 logd: Add logd_test
* Test statistics output, all four main log id types
  are checked to be present, and output is properly
  formatted with header (ascii new-line terminated
  byte count) and trailer (newline formfeed) frames.
* On dev build test dgram_qlen, circumvent if
  liblog benchmarks executed first though.
* Test if kernel and user space loggers are
  present, and if any content has leaked to both.
* test benchmark and use it to verify worst UID pruning

Change-Id: I890c89f64825956f40108de806ed750b0170ac6c
2014-04-15 10:21:57 -07:00
Mark Salyzyn
8e72c5384b logd: Statistics: Add up to 10 chattiest clients
- embellish pid name
- >1% of the logs
- fix PID gone detection (EPERM)
- some ? : cleanup

Change-Id: Iba3b306e1fee43e53931165819a398693910514b
2014-04-10 08:59:53 -07:00
Mark Salyzyn
472e04f2b4 Merge "logd: liblog: logcat: enable prune features for user" 2014-04-09 23:33:28 +00:00
Greg Hackmann
9101878dd0 Merge "logd: fix LogStatistics::format freeing wrong pointer" 2014-04-07 23:18:58 +00:00
Greg Hackmann
239605ef64 logd: fix LogStatistics::format freeing wrong pointer
Fixes a leak and use-after-free if a client passes in an
already-allocated target buffer (currently none do)

Change-Id: Ie20c30bd5ba31e1b6db73885bd9d2ebd7e40dc27
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-04-07 15:17:30 -07:00
Mark Salyzyn
0bb5288c0e logd: Turn off default prune by worst UID
- Algorithm places too much weight on stack dumps

Change-Id: Ibb31a59892870397b780965ec791f47a4ce87eaf
2014-04-07 12:17:19 -07:00
Mark Salyzyn
e9bebd0eb1 logd: auditd: add logd.auditd.dmesg property
Change-Id: If4a579c2221eec99cf3f6acf59ead8c2d5230517
2014-04-07 10:51:00 -07:00
William Roberts
29d238d2a8 logd: selinux auditd initial commit
Initial commit for an audit daemon that writes kernel audit
messages to the Android logger. The daemon searches dmesg
for all lines that contain "audit" and writes them. Then
receiving the messages from the netlink socket.

It also formats the messages so they are compatable with
ausearch (type=<t> <m> format)

Modified: Mark Salyzyn <salyzyn@google.com>

- do not start auditd
- merge into logd, stripping unnecessary file logging.
- Convert headers and code to support C++
- Fix bugs in libaudit
- squash timestamp (replace with 0.0) due to duplication
- squash pid due to duplication
- squash comm due to duplication

Change-Id: I421bcf33e7e670d596628b1b5c7c25536ce2d3fe
2014-04-07 10:51:00 -07:00
Mark Salyzyn
4ba0387af5 logd: Add pidToUid helper
Change-Id: I23ebae1957c027bff6cbc2573a227bf0c44c08a2
2014-04-07 10:51:00 -07:00
Mark Salyzyn
9a03863e88 logd: Add pidToName helper
Change-Id: Idd8e804ab65feb8dc432150ae701464de1ad5302
2014-04-07 10:50:55 -07:00
Mark Salyzyn
765f782891 logd: transitory reader thread create should be detached
Bug: 13692914
Change-Id: Ia7306e6e844ae9f17c6f594bf6b25f3148652570
2014-04-04 13:12:56 -07:00
Mark Salyzyn
1c95047939 logd: liblog: logcat: enable prune features for user
- Enable whitelist, blacklist and logsize tuneables for user

Change-Id: Id0c283844c71c5263a8cfbebf2e550f7ac415858
2014-04-02 13:12:04 -07:00
Mark Salyzyn
ca4c63d799 logd: build breakage in user
build breakage in branch: git_klp-dev-gpl @ 1101951

Change-Id: I4c9681bf4c97368ec19f5a79fef134aba937f337
2014-04-01 16:57:29 -07:00
Mark Salyzyn
e457b74ce6 logd: Add minimum time bucket statistics
* Only enabled for dev builds because halves performance.
- Used to establish if /proc/sys/net/unix/max_dgram_qlen
  is appropriate for the platform
  (see logd/LogStatistics.cpp comments)
- enabled if logd.dgram_qlen.statistics is not zero/empty

Change-Id: Ib8ecfeb75b6f0f954c099a6b1032b8afb5efcbd4
2014-04-01 14:38:52 -07:00
Mark Salyzyn
c66607a8aa Merge "logd: compile warning message" 2014-03-24 21:56:34 +00:00
Mark Salyzyn
dbb708a0a1 logd: compile warning message
Change-Id: I7ddd010031299395cad96f1743d7a7e6a6866b4c
2014-03-21 15:48:05 -07:00
Mark Salyzyn
22e287df0d logcat: white and blacklist failure
- logcat improperly squashes out count
- logcat test enhanced to catch failure
- logd places entries in ascending sorted order

Change-Id: If39d8e2c40852b520c98e7840034ab63c2538e5d
2014-03-21 15:43:31 -07:00
Mark Salyzyn
b992d0d7d3 logd: liblog: Thread IDs missing from logcat -v thread
- stuff caller's thread id into the packet.

Bug: 13568206
Change-Id: I02d0cdf9b1d9e839ff8969f591db42dfe6e4cc95
2014-03-21 10:37:44 -07:00
Mark Salyzyn
b059cf53c9 logd: Logging is truncated
- stack buffer undersized

Bug: 13514601
Change-Id: I3e5dda2daa7531ddcacece33dfdecaa28dcca765
2014-03-18 16:03:34 -07:00
Mark Salyzyn
a1c60cf80d logd: Find log time for arbitrary time to tail
- prototype to evaluate the increase in complexity or
  performance impact.

Change-Id: I4e815d74c023092fbb75055d260f75de57ad6522
2014-03-14 10:24:19 -07:00
Mark Salyzyn
fa3716b250 logd: liblog: logcat: Arbitrary time to tail
Change-Id: I10e8d92c933e31ee11e78d2d1114261a30c4be0e
2014-03-14 10:23:51 -07:00
Mark Salyzyn
dfa7a07f5b logd: liblog: logcat: Add LogWhiteBlackList
- liblog android_logger_get_log_size and android_logger_get_readable_size
  adjusted to return long instead of int because of -G flag extending range

NB: ifdef'd only for userdebug and eng builds

- liblog Add android_logger_[sg]et_prune_list and android_logger_set_log_size
- logcat Add -P, -p and -G flags
- logd Add LogWhiteBlackList and configurable log size

(cherry picked from commit 18a5432158)

Change-Id: I1572338c1b34bd968ad7867857ef708156ec3b6a
2014-03-13 14:48:07 -07:00
Mark Salyzyn
64d6fe9362 logd: prune by worst offending UID
(cherry picked from commit 3c4919e474)

Change-Id: I39965007569123ff5eebe01b5bfa555bbcb2dfe7
2014-03-13 14:48:02 -07:00
Mark Salyzyn
34facab86b logd: liblog: logcat: Add Statistics
- logd add statistical collection and formatting
- liblog add android_logger_get_statistics call
- logcat add -S flag
- logcat add -b all

(cherry picked from commit 51a29c8dc4)

Change-Id: I521753b1969ecd4590c956aeeb1557d101059d67
2014-03-13 14:47:58 -07:00
Mark Salyzyn
7e2f83c0bc logd: liblog: 64-bit issues
- structure packing
- move towards log_time from struct timespec
- extend log_time to cover differences between
  log_time and struct timespec

Change-Id: I106ed0b609917306d170044054b5b32645f2a295
2014-03-05 16:12:28 -08:00
Mark Salyzyn
581edc1b6c set /proc/sys/net/unix/max_dgram_qlen to large value
- init: set /proc/sys/net/unix/max_dgram_qlen to 300
- libsysutils: Add listen backlog argument to startListener
- logd: set listen backlog to 300

Change-Id: Id6d37d6c937ba2d221e76258d89c9516619caeec
2014-03-03 12:48:00 -08:00
Mark Salyzyn
4381d43848 logd: Always build logd
- build breakage aosp-idea133 @ 1049092

Change-Id: Iabac6009567926137f455044b33ab5d67924896d
2014-02-28 15:29:36 -08:00
Mark Salyzyn
154f4608aa liblog: enable logging to logd.
* Modify liblog to send all messages to the new syslog user
  space daemon.

Original-Change-Id: I0ce439738cd921efb2db4c1d6a289a96bdbc8bc2
Original-Change-Id: If4eb0d09409f7e9be3eb4bb7017073dc7e931ab4
Signed-off-by: Nick Kralevich <nnk@google.com>

* Add a TARGET_USES_LOGD make flag for BoardConfig.mk to manage
  whether logd is enabled for use or not.
* rename syslog to logd to avert confusion with bionic syslog
* Add fake log support back in
* prefilter for logging messages from logd
* Fill in timestamps at logging source
* update abstract log reader
* switch from using suffix for id to v3 format
* log a message when creating devices that a deprecated interface
  is being utilized.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry pick from commit 099e2c1f6f706a8600c1cef74cce9066fc315480)

Change-Id: I47929a5432977a1d7235267a435cec0a7d6bd440
2014-02-28 13:49:11 -08:00
Mark Salyzyn
1114f18065 logd: institute getGroups for socket credentials
(cherry pick from commit 4d851290fc81eb36d2fcf76e6f06213a28b877f5)

Change-Id: Ib8be84d2a3f873e91fb1495df439a498f395c137
2014-02-28 13:48:33 -08:00
Martijn Coenen
89343c1113 logd: Remove $(KERNEL_HEADERS) include.
Points to wrong kernel-headers dir in multi-arch
builds.

(cherry picked from commit 920a5629ff)

Change-Id: I5055bf5cd80119a34f0a6b0872ffb0a422a06baf
2014-02-27 07:57:05 -08:00
Mark Salyzyn
882f856668 logd: Add SCHED_BATCH to reduce priority
(cherry picked from commit 85620a1bff)

Change-Id: Id25cdef0dd7f8c5e154a0da2db2dd0554849babc
2014-02-26 09:55:03 -08:00
Mark Salyzyn
c03e72cc1c logd: Adjust to match defacto coding style
(cherry picked from commit c46f77bd2a)

Change-Id: I80685cdc7116e10c5a5a77abe856fd96804f9117
2014-02-26 09:54:23 -08:00
Mark Salyzyn
740f9b4f97 logd: prune more aggressively when over the top
(cherry picked from commit 63c15d5061)

Change-Id: I929dddc7da048c032fb791c7af23f215f8856bf3
2014-02-26 09:53:55 -08:00
Mark Salyzyn
0175b0747a logd: initial checkin.
* Create a new userspace log daemon for handling logging messages.

Original-Change-Id: I75267df16359684490121e6c31cca48614d79856
Signed-off-by: Nick Kralevich <nnk@google.com>

* Merge conflicts
* rename new syslog daemon to logd to prevent confusion with bionic syslog
* replace racy getGroups call with KISS call to client->getGid()
* Timestamps are filed at logging source
* insert entries into list in timestamp order
* Added LogTimeEntry tail filtration handling
* Added region locking around LogWriter list
* separate threads for each writer
* /dev/socket/logd* permissions

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry picked from commit 3e76e0a497)

Author: Nick Kralevich <nnk@google.com>
Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
2014-02-26 09:52:35 -08:00