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

@@ -33,10 +33,12 @@
/* Logging severity levels */
#define LOG_FATAL 1
#define LOG_ERROR 2
#define LOG_WARNING 3
#define LOG_INFO 4
#define LOG_DEBUG 5
/* For msg should be write to console and sbuf meanwhile but not fatal error */
#define LOG_ACRN 2
#define LOG_ERROR 3
#define LOG_WARNING 4
#define LOG_INFO 5
#define LOG_DEBUG 6
/* Logging flags */
#define LOG_FLAG_STDOUT 0x00000001
@@ -77,6 +79,11 @@ static inline void print_logmsg_buffer(__unused uint32_t cpu_id)
do_logmsg(LOG_FATAL, pr_prefix __VA_ARGS__); \
} while (0)
#define pr_acrnlog(...) \
do { \
do_logmsg(LOG_ACRN, pr_prefix __VA_ARGS__); \
} while (0)
#define pr_err(...) \
do { \
do_logmsg(LOG_ERROR, pr_prefix __VA_ARGS__); \