eal: add some debug for unit test failures
PATCH 1/1 eal: add some debug for unit test failures
Dirty patch to try to catch more info about a unit test failure seen in ARM containers at UNH.
Signed-off-by David Marchand <[email protected]>
--- app/test/commands.c | 4 +++- app/test/process.c | 7 +++++++ lib/eal/common/malloc_heap.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-)
app/test/commands.c +3 -1
@@ -368,8 +368,10 @@ int commands_init(void) } commands = (char *)calloc (commands_len,sizeof (char )); -if (!commands) +if (!commands) { +printf ("commands_init: calloc(%d) failed %s\n" , commands_len,strerror (errno));return -1 ; + } TAILQ_FOREACH(t, &commands_list, next) {strlcat (commands, t->command, commands_len);
app/test/process.c +7 -0
@@ -200,6 +200,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value) }#endif #endif +if (WIFEXITED (status)) +printf ("Child process exited with status %d\n" ,WEXITSTATUS (status)); +else if (WIFSIGNALED (status)) +printf ("Child process killed by signal %d\n" ,WTERMSIG (status)); +else +printf ("Child process terminated with wait status %d\n" , status); +return status; }
lib/eal/common/malloc_heap.c +2 -0
@@ -657,6 +657,8 @@ malloc_heap_alloc_on_heap_id(size_t size, unsigned int heap_id, unsigned int fla/* for legacy mode, try once and with all flags */ if (internal_conf->legacy_mem) { ret =heap_alloc (heap, size, flags, align, bound, contig); +if (ret ==NULL ) +EAL_LOG (ERR ,"Error allocating from heap in legacy mode" ); goto alloc_unlock; }
Signature · 1 line
2.54.0