From: Karol Lewandowski Date: Thu, 27 Feb 2020 17:04:16 +0000 (+0100) Subject: Add informative messages for crash-worker processes running with high LogLevel X-Git-Tag: accepted/tizen/unified/20200315.214856~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e76afd6d7bd3fe938eccb372def88b2362cb0dff;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git Add informative messages for crash-worker processes running with high LogLevel Change-Id: Id7a6e66d3dd371b0efb961195daca98ef42b5260 --- diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c index 1958578..1154283 100644 --- a/src/crash-manager/crash-manager.c +++ b/src/crash-manager/crash-manager.c @@ -936,21 +936,25 @@ static void compress(struct crash_info *cinfo) (void)spawn_wait(args, NULL, ¶m0, 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);