From: Kichan Kwon Date: Fri, 10 Jun 2016 01:18:01 +0000 (+0900) Subject: dump_systemstate : follow dlog backend checking method with newly patched dlog X-Git-Tag: accepted/tizen/common/20160615.193713^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F73867%2F3;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git dump_systemstate : follow dlog backend checking method with newly patched dlog Change-Id: I3a3a3b111804f81e8339a5632b7e70f332887b5e Signed-off-by: Kichan Kwon --- diff --git a/src/dump_systemstate/dump_systemstate.c b/src/dump_systemstate/dump_systemstate.c index 5206bf0..b3a6245 100644 --- a/src/dump_systemstate/dump_systemstate.c +++ b/src/dump_systemstate/dump_systemstate.c @@ -36,8 +36,6 @@ #include "shared/util.h" #include "shared/log.h" -#define DLOG_BACKEND_PATH "/run/dloginit.conf" - #define FILE_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH) static struct dump_item { const char *title; @@ -79,31 +77,6 @@ static int get_disk_used_percent(const char *path) return percent; } -static bool dlogutil_supported(void) -{ - FILE *fp; - char buf[32]; - - fp = fopen(DLOG_BACKEND_PATH, "r"); - if (!fp) { - _E("cannot open dlog backend file(errno:%d)", errno); - return false; - } - - if(!fgets(buf, sizeof(buf), fp)) { - _E("Failed to read dlog backend"); - fclose(fp); - return false; - } - - fclose(fp); - - if (!strncmp(buf, "LOG_TYPE=journal", 16)) - return false; - - return true; -} - int main(int argc, char *argv[]) { int c, ret, i, is_root, dpercent; const char *arg_file = NULL; @@ -220,29 +193,10 @@ int main(int argc, char *argv[]) { } if (arg_dlog) { - if (dlogutil_supported()) { - fprintf_fd(out_fd, "\n==== main log messages (/dev/log_main)\n"); - ret = run_command_write_fd("/usr/bin/dlogutil -d -v dump -b main", out_fd); - if (ret < 0) - goto exit_close; - - if(is_root) { - fprintf_fd(out_fd, "\n==== system log messages (/dev/log_system)\n"); - ret = run_command_write_fd("/usr/bin/dlogutil -d -v dump -b system", out_fd); - if (ret < 0) - goto exit_close; - - fprintf_fd(out_fd, "\n==== radio log messages (/dev/log_radio)\n"); - ret = run_command_write_fd("/usr/bin/dlogutil -d -v dump -b radio", out_fd); - if (ret < 0) - goto exit_close; - } - } else { - fprintf_fd(out_fd, "\n==== Log messages (journalctl)\n"); - ret = run_command_write_fd("/usr/bin/journalctl", out_fd); - if (ret < 0) - goto exit_close; - } + fprintf_fd(out_fd, "\n==== Log messages\n"); + ret = run_command_write_fd("/usr/bin/dlogutil -d -v threadtime", out_fd); + if (ret < 0) + goto exit_close; } exit_close: