logger: allow disabling KMSG buffer through config 39/230839/5
authorMichal Bloch <m.bloch@samsung.com>
Fri, 10 Apr 2020 14:16:35 +0000 (16:16 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 24 Apr 2020 05:34:45 +0000 (05:34 +0000)
Done through the new "handle_kmsg" entry (defaults to 1).

Change-Id: I399605ae9a6513b233f0613f5330b4d4d1fa412d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
configs/dlog.conf
src/logger/logger.c

index b7e5ace..6702bc6 100644 (file)
 #plog=1
 
 # Whether logging happens to the relevant buffer. Overrides `plog`.
+# Note that the buffer is still there, just libdlog doesn't send logs.
 enable_main=1
 enable_radio=1
 enable_system=1
 enable_apps=1
+# enable_kmsg = 1 # DOESN'T WORK! KMSG is not a libdlog-populated buffer. See below for `handle_kmsg` instead.
 
 # Debugmode - whether write platform debug log or not
 # If disabled, logs at priority levels DEBUG and below - this means also VERBOSE - are completely dropped
@@ -57,6 +59,10 @@ syslog_size=1048576
 # link to /dev/log even if systemd did not pass the socket to logger (default 0)
 #syslog_force=1
 
+# Whether the buffer is handled. This means the buffer is not read by the daemon.
+# This only affects some "external" buffers not populated by libdlog, currently only kmsg.
+handle_kmsg=1
+
 # Syslog handling currently disabled in the daemon - not needed in Tizen.
 #dlog_logger_conf_syslog=dlogutil -b syslog -r 256 -n 1 -f /var/log/dlog/syslog -v recv_realtime
 
index b406408..23737f4 100644 (file)
@@ -2119,7 +2119,7 @@ int prepare_config_data(struct logger_config_data *data)
                ret = -ENOENT;
                goto end;
        }
-       data->is_buffer_enabled[LOG_ID_KMSG] = 1;
+       data->is_buffer_enabled[LOG_ID_KMSG] = log_config_get_boolean(&conf, "handle_kmsg", true);
        data->is_buffer_enabled[LOG_ID_SYSLOG] =
                dev_log_sock_get() >= 0 || log_config_get_boolean(&conf, "syslog_force", false);