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

@@ -37,16 +37,16 @@ int strlinelen(char *str)
* @return a pointer to the beginning of the substring,
* or NULL if the substring is not found.
*/
char *strrstr(char *s, char *substr)
char *strrstr(const char *s, const char *substr)
{
char *found;
char *p = s;
const char *found;
const char *p = s;
while ((found = strstr(p, substr)))
p = found + 1;
if (p != s)
return p - 1;
return (char *)(p - 1);
return NULL;
}