a073c39616
logcatd is the same as logcat, except that the -L flag, if supplied, runs once, then the command re-runs itself without the -L flag with the same argument set. By introducing a logcatd daemon executable we can solve the problem of the longish reads from pstore that sometimes occur when the system is excessively busy, starving this background cgroup daemon as we absorb the delay in a backgrounded init "service", rather than in a forgrounded init "exec". This would not have been efficiently possible without the introduction of liblogcat. There are no doubt many flags that make no sense to run twice with, and without, the -L flag. In the general sense we expect the caller to perform the correct set of operations and not pick these nonsense operations. logcatd is only supplied on engineering and debug builds for logpersist, and is only an automated aid to triage. Test: gTest logcat-unit-tests Test: manual confirm logpersist functions as expected, required reboot Bug: 28788401 Bug: 30041146 Bug: 30612424 Bug: 35326290 Change-Id: I53ba31970749daf37eef42636f039f485932416f
49 lines
1.3 KiB
Makefile
49 lines
1.3 KiB
Makefile
# Copyright 2006-2014 The Android Open Source Project
|
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
logcatLibs := liblog libbase libcutils libpcrecpp
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := logcat
|
|
LOCAL_SRC_FILES := logcat_main.cpp event.logtags
|
|
LOCAL_SHARED_LIBRARIES := liblogcat $(logcatLibs)
|
|
LOCAL_CFLAGS := -Werror
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := logcatd
|
|
LOCAL_MODULE_TAGS := debug
|
|
LOCAL_SRC_FILES := logcatd_main.cpp event.logtags
|
|
LOCAL_SHARED_LIBRARIES := liblogcat $(logcatLibs)
|
|
LOCAL_CFLAGS := -Werror
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := liblogcat
|
|
LOCAL_SRC_FILES := logcat.cpp getopt_long.cpp logcat_system.cpp
|
|
LOCAL_SHARED_LIBRARIES := $(logcatLibs)
|
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
|
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
|
|
LOCAL_CFLAGS := -Werror
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := logpersist.start
|
|
LOCAL_MODULE_TAGS := debug
|
|
LOCAL_MODULE_CLASS := EXECUTABLES
|
|
LOCAL_INIT_RC := logcatd.rc
|
|
LOCAL_MODULE_PATH := $(bin_dir)
|
|
LOCAL_SRC_FILES := logpersist
|
|
ALL_TOOLS := logpersist.start logpersist.stop logpersist.cat
|
|
LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(filter-out $(LOCAL_MODULE),$(ALL_TOOLS)),ln -sf $(LOCAL_MODULE) $(TARGET_OUT)/bin/$(t);)
|
|
include $(BUILD_PREBUILT)
|
|
|
|
include $(call first-makefiles-under,$(LOCAL_PATH))
|