Add informative messages for crash-worker processes running with high LogLevel 08/226208/6
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 27 Feb 2020 17:04:16 +0000 (18:04 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 3 Mar 2020 08:23:33 +0000 (09:23 +0100)
Change-Id: Id7a6e66d3dd371b0efb961195daca98ef42b5260

src/crash-manager/crash-manager.c

index 1958578..1154283 100644 (file)
@@ -936,21 +936,25 @@ static void compress(struct crash_info *cinfo)
        (void)spawn_wait(args, NULL, &param0, ZIP_TIMEOUT_MS, NULL);
 }
 
-static void move_dump_data(const char *from_path, const struct crash_info *cinfo)
+static bool move_dump_data(const char *from_path, const struct crash_info *cinfo)
 {
        int lock_fd;
+       bool is_ok = true;
 
        if ((lock_fd = lock_dumpdir()) < 0)
-               return;
+               return false;
        if (!rename(from_path, cinfo->result_path))
                clean_dump();
-       else
-               _E("Failed to move %s to %s",
-                               from_path, cinfo->result_path);
+       else {
+               _E("Failed to move %s to %s", from_path, cinfo->result_path);
+               is_ok = false;
+       }
        unlock_dumpdir(lock_fd);
 
        if (remove_dir(cinfo->temp_dir, 1) < 0)
                _E("Failed to delete temp directory");
+
+       return is_ok;
 }
 
 static int wait_for_opt(unsigned int timeout)
@@ -1027,6 +1031,9 @@ static bool run(struct crash_info *cinfo)
                        _W("Failed to call extra script from config");
        }
 
+       _I("Creating report for pid %d, tid %d, cmdline %s, pkgid %s",
+          cinfo->pid_info, cinfo->tid_info, cinfo->cmd_line, cinfo->pkgid);
+
        /* Exec crash modules */
        if (!execute_crash_modules(cinfo)) {
                _E("Failed to get basic crash information");
@@ -1050,7 +1057,8 @@ static bool run(struct crash_info *cinfo)
        } else
                temp_report = cinfo->info_path;
 
-       move_dump_data(temp_report, cinfo);
+       if (move_dump_data(temp_report, cinfo))
+               _I("Report for pid %d created at %s", cinfo->pid_info, cinfo->result_path);
 
        if (cinfo->print_result_path)
                printf("REPORT_PATH=%s\n", cinfo->result_path);