Merge "maintenance: Add log for compilation failure." into rvc-dev am: ee129665c3

Change-Id: Ic3231840d222a754ca7c95ebf89cd3dd1ee66894
diff --git a/src/maintenance/controller.cc b/src/maintenance/controller.cc
index 073b938..e654e92 100644
--- a/src/maintenance/controller.cc
+++ b/src/maintenance/controller.cc
@@ -176,9 +176,16 @@
       LOG(ERROR) << "Child terminated abnormally, status: " << WEXITSTATUS(wstatus);
       return false;
     }
-    LOG(DEBUG) << "Child terminated, status: " << WEXITSTATUS(wstatus);
 
-    return true;
+    int status = WEXITSTATUS(wstatus);
+    LOG(DEBUG) << "Child terminated, status: " << status;
+    if (status == 0) {
+      LOG(DEBUG) << "Iorap compilation succeeded";
+      return true;
+    } else {
+      LOG(ERROR) << "Iorap compilation failed";
+      return false;
+    }
   } else {
     // we are the child that was forked.
     std::vector<std::string> argv_vec = MakeCompilerParams(params);
@@ -338,10 +345,9 @@
                                           activity_name.c_str());
     if (!StartViaFork(compiler_params)) {
       LOG(ERROR) << "Compilation failed for package_id:" << package_id
-                 <<" activity_name: " <<activity_name;
+                 << " activity_name: " << activity_name;
       return false;
     }
-
   }
 
   std::optional<db::PrefetchFileModel> compiled_trace =