fs_list *headptr_list;
tar_Data_t *tar_cfg_data = NULL;
-#ifdef MEM_PROFILING
-/*
- Description:
- Create script file , set it executable, execute script in child process
- Only works if valid delta.tar is present for upgrade
- Summary:
- If MEM_PROFILING is activated,
- we can see the result of memory profiling after delta upgrade
- in file defined by macro - SS_MEMORY_PROFILING_SCRIPT
-*/
-int mem_profiling_start = 0;
-int SS_Do_Memory_Profiling()
-{
- int ret = -1;
- pid_t pid;
- char memory_usage_script[1024] = "#!/bin/bash\nlog_file=$1\npid=$2\nmaxmem=0\nwhile [[ -d \"/proc/${pid}\" ]]; do\n\
- mem=`cat /proc/${pid}/smaps | grep Pss | grep -v Swap|awk '{print $2}'|awk '{s+=$1} END {print s}'`\n\
- if [[ ${mem} -gt ${maxmem} ]]; then\nmaxmem=${mem}\n\
- echo -e \"Memory usage till now is: ${maxmem} KB.\" >> $log_file\n fi\n sleep 0.01\ndone\n\
- echo -e \"Max was : ${maxmem} KB.\" >> $log_file\n";
- char cmd[1024] = { 0, };
-
- //Open a file and write the script contents in it
- FILE *fp = fopen(SS_MEMORY_PROFILING_SCRIPT, "w+");
- fwrite(memory_usage_script, strlen(memory_usage_script), 1, fp);
- fclose(fp);
- //make the file executable - Octal 495 is 757 decimal
- if (chmod(SS_MEMORY_PROFILING_SCRIPT, 495) < 0) {
- LOGE("Error in chmod(%s, 495) - %d (%s)\n", SS_MEMORY_PROFILING_SCRIPT, errno, strerror(errno));
- return E_SS_FAILURE;
- }
- //calling mem_use.sh
- //Usage : <location of script> <location of log file to be created> <pid of the calling process>
- pid = getpid();
- snprintf(cmd, sizeof(cmd) - 1, "%s %s %d", SS_MEMORY_PROFILING_SCRIPT, SS_MEMORY_USAGE_LOG, pid);
- ret = _system_cmd_nowait(cmd);
- sleep(1);
- LOG("ret for memory profiling cmd is %d\n", ret);
- if (ret == 0) {
- mem_profiling_start = 1;
- return S_SS_SUCCESS;
- } else {
- LOGE("Could not start Memory Profiling\n");
- return E_SS_FAILURE;
- }
-}
-#endif
-#ifdef TIME_PROFILING
-static char ts1[256];
-static double ts2;
-double t1;
-double t2;
-double fast_tar_get_item_size_time = 0.0;
-double SS_LoadFile_time = 0.0;
-double SS_FSBuildNodes_time = 0.0;
-
-static void get_time_stamp1(void)
-{
- struct timeval tv;
- int sec, msec;
-
- gettimeofday(&tv, NULL);
- sec = (int)tv.tv_sec;
- msec = (int)(tv.tv_usec / 1000);
- snprintf(ts1, 256, "%06d.%03d", sec % 100000, msec);
-}
-#endif
-
//Check SS function if available
int file_exist(char *filename)
{
return (ret >= 0) ? (1) : (0);
}
-#ifdef POWER_FAIL_TEST
-
-static int SS_Get_power_fail_flag(void)
-{
- int fd;
- char buf[256];
- char *ptr = NULL;
- int result = 0;
- int ret_val = 0;
-
- if (file_exist(SS_POWER_FAIL_TEST_FLAG) == 0) {
- LOGE("No exist file!!\n");
- return -1;
- }
-
- fd = open(SS_POWER_FAIL_TEST_FLAG, O_RDWR, S_IRWXU);
- if (fd == -1) {
- LOGE("Could not open status file!!\n");
- return -1;
- }
-
- result = SS_ReadFile(fd, 0, buf, sizeof(buf));
- if (result != 0) {
- LOGE("SS_ReadFile failed!!\n");
- return -1;
- }
-
- ret_val = atoi(buf);
-
- result = SS_CloseFile(fd);
- if (result != 0)
- LOGE("SS_CloseFile failed!!\n");
-
- return ret_val;
-}
-
-static void SS_Set_power_fail_flag(int del_type)
-{
- int fd;
- int result = 0;
- char num_str[16];
- LOG("del_type:[%d]\n", del_type);
-
- fd = open(SS_POWER_FAIL_TEST_FLAG, O_RDWR | O_CREAT, S_IRWXU);
- if (fd == -1) {
- LOGE("Could not open status file!!\n");
- return;
- }
-
- sprintf(num_str, "%d", del_type);
- result = SS_WriteFile(fd, 0, num_str, strlen(num_str));
- if (result != 0)
- LOGE("SS_WriteFile failed!!\n");
-
- result = SS_CloseFile(fd);
- if (result != 0)
- LOGE("SS_CloseFile failed!!\n");
-
- sync();
-
-}
-
-int SS_Do_Power_fail_test(int del_type)
-{
- int ret = -1;
- char cmd[1024] = { 0, };
-
- SS_Set_power_fail_flag(del_type);
-
- snprintf(cmd, sizeof(cmd) - 1, "%s", "/usr/sbin/reboot fota");
- ret = _system_cmd_nowait(cmd);
- sleep(1);
- LOG("ret for SS_Do_Power_fail_test cmd is %d\n", ret);
- if (ret == 0) {
- return S_SS_SUCCESS;
- } else {
- LOGE("Could not start Memory Profiling\n");
- return E_SS_FAILURE;
- }
-}
-#endif
-
int SS_GetProgressResolution(int ultotalFSCnt)
{
if (ultotalFSCnt < DISPLAYRESOLUTION_SIZE)
return FS_UpgradeState;
}
-int SS_Get_last_update_status(int* last_update_status, int* del_type, char* status_path)
-{
- int fd;
- unsigned char buf[257];
- char *ptr = NULL;
- char *saveptr = NULL;
- int result = 0;
-
- if (file_exist(status_path) == 0) {
- LOG("No exist file!! - File_path:[%s]\n", status_path);
- return -1;
- }
-
- fd = open(status_path, O_RDWR, S_IRWXU);
- if (fd == -1) {
- LOGE("Could not open status file!!, File_path:[%s]\n", status_path);
- return -1;
- }
-
- result = SS_ReadFile(fd, 0, buf, sizeof(buf)-1);
- if (result != 0) {
- LOGE("SS_ReadFile failed!!\n");
- result = SS_CloseFile(fd);
- if (result != 0)
- LOGE("SS_CloseFile failed!!\n");
- return -1;
- }
-
- ptr = strtok_r((char *)buf, " ", &saveptr);
-
- if (ptr != NULL) {
- *last_update_status = atoi(ptr);
- ptr = strtok_r(NULL, " ", &saveptr);
- }
-
- if (ptr != NULL) {
- *del_type = atoi(ptr);
- }
-
- result = SS_CloseFile(fd);
- if (result != 0)
- LOGE("SS_CloseFile failed!!\n");
-
- return 0;
-}
-
-void SS_Set_last_update_status(int last_update_status, int del_type, char *status_path)
-{
- int fd;
- int result = 0;
- char num_str[16];
- LOG("last_update_status:[%d], del_type:[%d]\n", last_update_status, del_type);
-
- fd = open(status_path, O_RDWR | O_CREAT, S_IRWXU);
- if (fd == -1) {
- LOGE("Could not open status file!!, File_path:[%s]\n", status_path);
- return;
- }
-
- snprintf(num_str, sizeof(num_str), "%d %d", last_update_status, del_type);
- result = SS_WriteFile(fd, 0, (unsigned char *)num_str, strlen(num_str));
- if (result != 0)
- LOGE("SS_WriteFile failed!!\n");
-
- result = SS_CloseFile(fd);
- if (result != 0)
- LOGE("SS_CloseFile failed!!\n");
-
- sync();
-
-}
-
int SS_rename1(const char *old_file_name, const char *new_file_name)
{
int result = E_SS_FAILURE;
case DIFFS:
{
LOGL(LOG_SSENGINE, "DIFFS mode start\n");
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "DIFFS mode start time = [%lf]\n",
- t1);
-#endif
tar_open(ua_dataSS->update_data->ua_delta_path);
while (pFsNode) {
//LOGL(LOG_SSENGINE, "DIFFS update Index: [%d] \n", ulFileIndex++);
}
LOGL(LOG_SSENGINE, "DIFFS : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "DIFFS mode end time = [%lf], diff = [%lf]\n", t2,
- (t2 - t1));
-#endif
tar_close();
LOGL(LOG_SSENGINE, "DIFFS mode end\n");
}
case MOVES:
{
LOGL(LOG_SSENGINE, "MOVES mode start\n");
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "MOVES mode start time = [%lf]\n",
- t1);
-#endif
while (pFsNode) {
//LOGL(LOG_SSENGINE, "MOVES update Index: [%d] \n", ulFileIndex++);
int skip_flag = 0;
}
LOGL(LOG_SSENGINE, "MOVES : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "MOVES mode end time = [%lf], diff = [%lf]\n", t2,
- (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "MOVES mode end\n");
}
break;
LOGL(LOG_SSENGINE, "DELETES mode start\n");
int ulFiletype = 0;
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "DELETES mode start time = [%lf]\n",
- t1);
-#endif
while (pFsNode) {
if (pFsNode->type == DELETES) {
//LOGL(LOG_SSENGINE, "DELETES update Index: [%d] \n", ulFileIndex++);
}
LOGL(LOG_SSENGINE, "DELETES : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "DELETES mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "DELETES mode end\n");
}
break;
LOGL(LOG_SSENGINE, "DELETE_END mode start\n");
int ulFiletype = 0;
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "DELETE_END mode start time = [%lf]\n", t1);
-#endif
while (pFsNode) {
if (pFsNode->type == DELETE_END) {
LOGL(LOG_SSENGINE, "DELETE_END update Index: [%d] \n", ulFileIndex++);
}
LOGL(LOG_SSENGINE, "DELETE_END : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "DELETE_END mode start time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "DELETE_END mode end\n");
}
break;
case NEWFILES:
{
LOGL(LOG_SSENGINE, "NEWFILES mode start\n");
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "NEWFILES mode start time = [%lf]\n",
- t1);
-#endif
LOGL(LOG_SSENGINE, "Starting New file upgrade for [%s]\n", patch_path);
if (tar_extract_file(ua_dataSS->update_data->ua_delta_path, (char *)patch_path, new_compressed_path) >=
0)
else
LOGL(LOG_SSENGINE, "tar extraction error for %s\n", ua_dataSS->parti_info->ua_parti_name);
SS_DeleteFile(new_compressed_path);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "NEWFILES mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "NEWFILES mode end\n");
}
break;
case SYMDIFFS:
{
LOGL(LOG_SSENGINE, "SYMDIFFS mode start\n");
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "SYMDIFFS mode start time = [%lf]\n",
- t1);
-#endif
while (pFsNode) {
//LOGL(LOG_SSENGINE, "SYMDIFFS update Index: [%d] \n", ulFileIndex++);
//LOG("Sym Diff file paths: [Linkname - %s] [reference file name- %s][]\n", pFsNode->file_path,pFsNode->patch_name);
}
LOGL(LOG_SSENGINE, "SYMDIFFS : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "SYMDIFFS mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "SYMDIFFS mode end\n");
}
break;
fs_params *head_node;
int retry_count = 0, do_retry = 0;
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "SYMNEWFILES mode start time = [%lf]\n", t1);
-#endif
+
SYMLINK_CREATE:
head_node = pFsNode;
while (head_node) {
//SS_SetUpgradeState(E_SS_FSUPDATEFAILED);
break;
}
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "SYMNEWFILES mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "SYMNEWFILES mode end\n");
}
break;
case HARDDIFFS:
{
LOGL(LOG_SSENGINE, "HARDDIFFS mode start\n");
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE, "HARDDIFFS mode start time = [%lf]\n",
- t1);
-#endif
while (pFsNode) {
//LOGL(LOG_SSENGINE, "SYMDIFFS update Index: [%d] \n", ulFileIndex++);
//LOG("Sym Diff file paths: [Linkname - %s] [reference file name- %s][]\n", pFsNode->file_path,pFsNode->patch_name);
}
LOGL(LOG_SSENGINE, "HARDDIFFS : Total index = [%d]\n",
ulFileIndex - 1);
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "HARDDIFFS mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "HARDDIFFS mode end\n");
}
break;
case HARDNEWFILES:
{
LOGL(LOG_SSENGINE, "HARDNEWFILES mode start\n");
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t1 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "HARDNEWFILES mode start time = [%lf]\n", t1);
-#endif
fs_params *head_node = pFsNode;
while (head_node) {
//LOGL(LOG_SSENGINE, "SYMNEWS update Index: [%d] \n", ulFileIndex++);
}
LOGL(LOG_SSENGINE, "HARDNEWFILES : Total index = [%d]\n",
ulFileIndex - 1);
-
-#ifdef TIME_PROFILING
- get_time_stamp1(); //total time capturing
- t2 = atof(ts1);
- LOGL(LOG_SSENGINE,
- "HARDNEWFILES mode end time = [%lf], diff = [%lf]\n",
- t2, (t2 - t1));
-#endif
LOGL(LOG_SSENGINE, "HARDNEWFILES mode end\n");
}
return ulResult;
}
-#ifdef MEM_PROFILING
-extern int max_mem;
-extern int cur_mem;
-#endif
/*!
*********************************************************************************
* SS_FSUpdatemain
int SS_FSUpdatemain(ua_dataSS_t * ua_dataSS)
{
int ulResult = S_SS_SUCCESS;
- int last_update_status = 0;
- int del_type = 0;
+
fs_list *head_ptr_node = NULL;
- char new_patch_path[SS_MAX_FILE_PATH] = {
- 0
- };
- char status_path[MAX_FILE_PATH];
- snprintf(status_path, MAX_FILE_PATH, "%s/%s",ua_dataSS->update_data->ua_delta_folder, SS_UPDATE_STATUS_PATH);
+ char new_patch_path[SS_MAX_FILE_PATH] = {0};
if (!ua_dataSS)
return E_SS_BAD_PARAMS; // Set error ??
LOGL(LOG_SSENGINE, "FS Update Entry\n");
-#ifdef POWER_FAIL_TEST
- int fail_test_flag = 0;
- fail_test_flag = SS_Get_power_fail_flag();
- LOGL(LOG_SSENGINE, "fail_test_flag: [%d]\n", fail_test_flag);
-#endif
-
- if(SS_Get_last_update_status(&last_update_status, &del_type, status_path) == -1)
- LOGE("SS_Get_last_update_status failed!!\n");
-
- LOGL(LOG_SSENGINE, "last_update_status: [%d], del_type: [%d]\n", last_update_status, del_type);
-
- // for now, we don't want to read last del_type as the logic doesn't work
- del_type = 0;
-
if (head_ptr_node->del_ref == NULL) {
LOGL(LOG_SSENGINE, "No DEL header\n");
} else if (ulResult == S_SS_SUCCESS) {
- if (del_type < DELETES) {
- ulResult = SS_FSUpdateFile(DELETES, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->del_ref,
- ua_dataSS->update_delta->ua_patch_path);
- if (ulResult == S_SS_SUCCESS) {
- LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETES success!!\n");
+ ulResult = SS_FSUpdateFile(DELETES, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->del_ref,
+ ua_dataSS->update_delta->ua_patch_path);
+ if (ulResult == S_SS_SUCCESS) {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETES success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < DELETES) {
- if (SS_Do_Power_fail_test(DELETES) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
- SS_Set_last_update_status(0, DELETES, status_path);
- }
} else {
- LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETES already applied!!\n");
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETES fail!!\n");
}
}
if (head_ptr_node->dif_ref == NULL) {
LOGL(LOG_SSENGINE, "No DIFF header\n");
} else if (ulResult == S_SS_SUCCESS) {
- ulResult =
- SS_FSUpdateFile(DIFFS, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->dif_ref,
- ua_dataSS->update_delta->ua_patch_path);
+ ulResult = SS_FSUpdateFile(DIFFS, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->dif_ref,
+ ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DIFFS success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < DIFFS) {
- if (SS_Do_Power_fail_test(DIFFS) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DIFFS fail!!\n");
}
}
if (head_ptr_node->move_ref == NULL) {
LOGL(LOG_SSENGINE, "No MOVE header\n");
} else if (ulResult == S_SS_SUCCESS) {
- if (del_type < MOVES) {
- ulResult =
- SS_FSUpdateFile(MOVES, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->move_ref,
- ua_dataSS->update_delta->ua_patch_path);
- if (ulResult == S_SS_SUCCESS) {
+ ulResult = SS_FSUpdateFile(MOVES, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->move_ref,
+ ua_dataSS->update_delta->ua_patch_path);
+ if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - MOVES success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < MOVES) {
- if (SS_Do_Power_fail_test(MOVES) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
- SS_Set_last_update_status(0, MOVES, status_path);
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - MOVES fail!!\n");
}
- } else {
- LOGL(LOG_SSENGINE, "SS_FSUpdateFile - MOVES already applied!!\n");
- }
}
if (head_ptr_node->del_ref == NULL) {
LOGL(LOG_SSENGINE, "No DEL header\n");
} else if (ulResult == S_SS_SUCCESS) {
- if (del_type < DELETE_END) {
ulResult = SS_FSUpdateFile(DELETE_END, ua_dataSS, head_ptr_node->ulPatchCount, head_ptr_node->del_ref,
ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETE_END success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < DELETE_END) {
- if (SS_Do_Power_fail_test(DELETE_END) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
- SS_Set_last_update_status(0, DELETE_END, status_path);
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETE_END fail!!\n");
}
- } else {
- LOGL(LOG_SSENGINE, "SS_FSUpdateFile - DELETE_END already applied!!\n");
- }
}
if (ulResult == S_SS_SUCCESS) {
//new file extraction end
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - NEWFILES success!!\n");
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - NEWFILES fail!!\n");
}
}
ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - SYMDIFFS success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < SYMDIFFS) {
- if (SS_Do_Power_fail_test(SYMDIFFS) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - SYMDIFFS fail!!\n");
}
}
ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - SYMNEWFILES success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < SYMNEWFILES) {
- if (SS_Do_Power_fail_test(SYMNEWFILES) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - SYMNEWFILES fail!!\n");
}
}
ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - HARDNEWFILES success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < HARDNEWFILES) {
- if (SS_Do_Power_fail_test(HARDNEWFILES) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - HARDNEWFILES fail!!\n");
}
}
ua_dataSS->update_delta->ua_patch_path);
if (ulResult == S_SS_SUCCESS) {
LOGL(LOG_SSENGINE, "SS_FSUpdateFile - HARDDIFFs success!!\n");
-#ifdef POWER_FAIL_TEST
- if (fail_test_flag < HARDDIFFS) {
- if (SS_Do_Power_fail_test(HARDDIFFS) == E_SS_FAILURE) {
- LOGE("SS_Do_Power_fail_test failed!!\n");
- }
- }
-#endif
+
+ } else {
+ LOGL(LOG_SSENGINE, "SS_FSUpdateFile - HARDDIFFs fail!!\n");
}
}
if (ulResult == S_SS_SUCCESS) {
SS_UpdateUIProgress(ua_dataSS, 0, 1); //fix WGID : 51963, When all updates are done to FS , patchcount is not needed, passing 1 to 3rd arg is enough
- SS_Set_last_update_status(0, DEL_TYPE_MAX, status_path);
}
LOGL(LOG_SSENGINE, "FS update Complete\n");
-#ifdef MEM_PROFILING
- LOGL(LOG_SSENGINE, "Stats are : Cur Max : [%d] Global Max : [%d]\n", cur_mem, max_mem);
-#endif
-#ifdef POWER_FAIL_TEST
- unlink(SS_POWER_FAIL_TEST_FLAG);
-#endif
+
if (ulResult == S_SS_SUCCESS)
return ulResult;
else
return E_SS_FAILURE;
}
-#ifdef MEM_PROFILING
- if (!mem_profiling_start)
- if (!(S_SS_SUCCESS == SS_Do_Memory_Profiling()))
- return E_SS_FAILURE;
-#endif
SS_GetPartition_LocDetails(ua_dataSS);
LOGL(LOG_SSENGINE, "FS Verification Start\n");
if (ua_dataSS->ua_operation == UI_OP_SCOUT)
gvalid_session = 1; // (shd b true if called during verification)
headptr_list = SS_FSBuildNodes(ua_dataSS);
-#ifdef TIME_PROFILING
- LOGL(LOG_SSENGINE, "fast_tar_get_item_size_time :[%lf]\n", fast_tar_get_item_size_time);
- LOGL(LOG_SSENGINE, "SS_LoadFile_time :[%lf]\n", SS_LoadFile_time);
- LOGL(LOG_SSENGINE, "SS_FSBuildNodes_time :[%lf]\n", SS_FSBuildNodes_time);
-#endif
+
if (!headptr_list) {
LOGE("FS Verification Failed\n");
SS_FSClearNodes();
{
if (ver_str) {
strncpy((char *)ver_str, SS_TOTA_VERSION, MAX_PATH);
-#ifdef MEM_PROFILING
- if (!mem_profiling_start)
- if (!(S_SS_SUCCESS == SS_Do_Memory_Profiling()))
- LOGE("Unable to start Memory_Profiling\n");
-#endif
return S_SS_SUCCESS;//wgid: 2456
} else
return E_SS_FAILURE;