HV: Replace printf with pr_acrnlog after logmsg init

There are some massages which is not fatal error but should to print
to serial and sbuf(hvlog) at the same time. pr_fatal is for fatal error
massages and it is not good choice for the situation above.

Introduce a new API pr_acrnlog to deal with the situation. And replace the
following printf with pr_acrnlog for massages should be print to sbuf and
serial. Then developers can get those massages on serial and BTM(Boot Time
Measurement) can use acrnlog to get those massages from sbuf.

BTM refers to Boot Time Measurement which will read acrnlog file to get
timestamps of steps we want.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
Kaige Fu
2018-05-23 11:34:08 +08:00
committed by lijinxia
parent 9af38e16e5
commit 80a79fed39
4 changed files with 20 additions and 13 deletions

View File

@@ -239,7 +239,7 @@ static int hardware_detect_support(void)
if (ret)
return ret;
printf("hardware support HV\n");
pr_acrnlog("hardware support HV");
return 0;
}
@@ -484,20 +484,20 @@ void bsp_boot_init(void)
LOG_DESTINATION);
if (HV_RC_VERSION)
printf("HV version %d.%d-rc%d-%s-%s %s build by %s, start time %lluus\r\n",
pr_acrnlog("HV version %d.%d-rc%d-%s-%s %s build by %s, start time %lluus",
HV_MAJOR_VERSION, HV_MINOR_VERSION, HV_RC_VERSION,
HV_BUILD_TIME, HV_BUILD_VERSION, HV_BUILD_TYPE,
HV_BUILD_USER, TICKS_TO_US(start_tsc));
else
printf("HV version %d.%d-%s-%s %s build by %s, start time %lluus\r\n",
pr_acrnlog("HV version %d.%d-%s-%s %s build by %s, start time %lluus",
HV_MAJOR_VERSION, HV_MINOR_VERSION,
HV_BUILD_TIME, HV_BUILD_VERSION, HV_BUILD_TYPE,
HV_BUILD_USER, TICKS_TO_US(start_tsc));
printf("API version %d.%d\r\n",
pr_acrnlog("API version %d.%d",
HV_API_MAJOR_VERSION, HV_API_MINOR_VERSION);
printf("Detect processor: %s\n", boot_cpu_data.model_name);
pr_acrnlog("Detect processor: %s", boot_cpu_data.model_name);
pr_dbg("Core %d is up", CPU_BOOT_ID);