2016-07-08 00:24:51 +08:00
|
|
|
#
|
|
|
|
# init scriptures for logcatd persistent logging.
|
|
|
|
#
|
|
|
|
# Make sure any property changes are only performed with /data mounted, after
|
|
|
|
# post-fs-data state because otherwise behavior is undefined. The exceptions
|
|
|
|
# are device adjustments for logcatd service properties (persist.* overrides
|
|
|
|
# notwithstanding) for logd.logpersistd.size and logd.logpersistd.buffer.
|
|
|
|
|
|
|
|
# persist to non-persistent trampolines to permit device properties can be
|
|
|
|
# overridden when /data mounts, or during runtime.
|
|
|
|
on property:persist.logd.logpersistd.size=256
|
|
|
|
setprop persist.logd.logpersistd.size ""
|
|
|
|
setprop logd.logpersistd.size ""
|
|
|
|
|
|
|
|
on property:persist.logd.logpersistd.size=*
|
|
|
|
# expect /init to report failure if property empty (default)
|
|
|
|
setprop logd.logpersistd.size ${persist.logd.logpersistd.size}
|
|
|
|
|
|
|
|
on property:persist.logd.logpersistd.buffer=all
|
|
|
|
setprop persist.logd.logpersistd.buffer ""
|
|
|
|
setprop logd.logpersistd.buffer ""
|
|
|
|
|
|
|
|
on property:persist.logd.logpersistd.buffer=*
|
|
|
|
# expect /init to report failure if property empty (default)
|
|
|
|
setprop logd.logpersistd.buffer ${persist.logd.logpersistd.buffer}
|
|
|
|
|
2015-08-15 04:02:51 +08:00
|
|
|
on property:persist.logd.logpersistd=logcatd
|
2016-07-08 00:24:51 +08:00
|
|
|
setprop logd.logpersistd logcatd
|
|
|
|
|
|
|
|
# enable, prep and start logcatd service
|
|
|
|
on load_persist_props_action
|
|
|
|
setprop logd.logpersistd.enable true
|
|
|
|
|
|
|
|
on property:logd.logpersistd.enable=true && property:logd.logpersistd=logcatd
|
2015-08-15 04:02:51 +08:00
|
|
|
# all exec/services are called with umask(077), so no gain beyond 0700
|
|
|
|
mkdir /data/misc/logd 0700 logd log
|
|
|
|
# logd for write to /data/misc/logd, log group for read from pstore (-L)
|
2016-06-15 06:26:30 +08:00
|
|
|
# b/28788401 b/30041146 b/30612424
|
2016-08-09 04:10:35 +08:00
|
|
|
# exec - logd log -- /system/bin/logcat -L -b ${logd.logpersistd.buffer:-all} -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 1024 -n ${logd.logpersistd.size:-256} --id=${ro.build.id}
|
2015-08-15 04:02:51 +08:00
|
|
|
start logcatd
|
|
|
|
|
2016-07-08 00:24:51 +08:00
|
|
|
# stop logcatd service and clear data
|
|
|
|
on property:logd.logpersistd.enable=true && property:logd.logpersistd=clear
|
|
|
|
setprop persist.logd.logpersistd ""
|
2016-06-07 02:22:13 +08:00
|
|
|
stop logcatd
|
|
|
|
# logd for clear of only our files in /data/misc/logd
|
2016-07-08 00:24:51 +08:00
|
|
|
exec - logd log -- /system/bin/logcat -c -f /data/misc/logd/logcat -n ${logd.logpersistd.size:-256}
|
|
|
|
setprop logd.logpersistd ""
|
|
|
|
|
|
|
|
# stop logcatd service
|
|
|
|
on property:logd.logpersistd=stop
|
2016-06-07 02:22:13 +08:00
|
|
|
setprop persist.logd.logpersistd ""
|
2016-07-08 00:24:51 +08:00
|
|
|
stop logcatd
|
|
|
|
setprop logd.logpersistd ""
|
2016-06-07 02:22:13 +08:00
|
|
|
|
2016-07-08 00:24:51 +08:00
|
|
|
on property:logd.logpersistd.enable=false
|
2016-06-07 02:22:13 +08:00
|
|
|
stop logcatd
|
|
|
|
|
2016-07-08 00:24:51 +08:00
|
|
|
# logcatd service
|
2016-08-04 06:17:06 +08:00
|
|
|
service logcatd /system/bin/logcat -b ${logd.logpersistd.buffer:-all} -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 1024 -n ${logd.logpersistd.size:-256} --id=${ro.build.id}
|
2015-08-15 04:02:51 +08:00
|
|
|
class late_start
|
|
|
|
disabled
|
|
|
|
# logd for write to /data/misc/logd, log group for read from log daemon
|
|
|
|
user logd
|
|
|
|
group log
|
2015-09-22 05:25:34 +08:00
|
|
|
writepid /dev/cpuset/system-background/tasks
|