tools: acrn-crashlog: Defer the vm events processing when failed

In the original design, acrnprobe marked all handled VMs'events as "synced"
in file vmrecordid(this patch changes the name to VM_eventsID.log).
Currently, the Android log events are not logged if the first attempt at
reading collecting them from the VM fails. This patch changes the logic
so that the acrn-crashlog tool will retry continuously.

This patch defines different tags for handled VMs'events, and only marks
VMs'events "synced" after it returns successfully.

Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: xiaojin2 <xiaojing.liu@intel.com>
Reviewed-by: Jin Zhi <zhi.jin@intel.com>
Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Acked-by: Chen gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2018-06-21 16:21:24 +08:00
committed by lijinxia
parent ccc222d193
commit 41b39c5e1f
11 changed files with 309 additions and 161 deletions

View File

@@ -81,7 +81,7 @@ int append_file(char *filename, char *text);
int mm_replace_str_line(struct mm_file_t *mfile, char *replace,
int line);
int replace_file_head(char *filename, char *text);
int overwrite_file(char *filename, char *value);
int overwrite_file(const char *filename, const char *value);
int readline(int fd, char buffer[MAXLINESIZE]);
int file_read_string(const char *file, char *string, int size);
void file_reset_init(const char *filename);
@@ -93,8 +93,10 @@ int space_available(char *path, int quota);
int count_lines_in_file(const char *filename);
int read_full_binary_file(const char *path, unsigned long *size,
void **data);
int file_read_key_value(char *path, char *key, char *value);
int file_read_key_value_r(char *path, char *key, char *value);
int file_read_key_value(const char *path, const char *key,
const size_t limit, char *value);
int file_read_key_value_r(const char *path, const char *key,
const size_t limit, char *value);
int dir_contains(const char *dir, const char *filename, int exact,
char *fullname);
int lsdir(const char *dir, char *fullname[], int limit);

View File

@@ -9,7 +9,7 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
int strlinelen(char *str);
char *strrstr(char *s, char *str);
char *strrstr(const char *s, const char *str);
char *next_line(char *buf);
char *strtrim(char *str);
int strcnt(char *str, char c);