dump_systemstate : follow dlog backend checking method with newly patched dlog 67/73867/3 accepted/tizen/common/20160615.193713 accepted/tizen/ivi/20160616.002705 accepted/tizen/mobile/20160616.002645 accepted/tizen/tv/20160616.002648 accepted/tizen/wearable/20160616.002635 submit/tizen/20160615.071949
authorKichan Kwon <k_c.kwon@samsung.com>
Fri, 10 Jun 2016 01:18:01 +0000 (10:18 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 10 Jun 2016 05:42:08 +0000 (14:42 +0900)
Change-Id: I3a3a3b111804f81e8339a5632b7e70f332887b5e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/dump_systemstate/dump_systemstate.c

index 5206bf0..b3a6245 100644 (file)
@@ -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: