diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2017-07-04 15:48:49 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-10 17:46:33 +0100 |
commit | b3a70837c2e939e6aab98247f18869d903077305 (patch) | |
tree | 6c9cbc2fab8bb210b071133fae62d36224cefedc | |
parent | 273dae30ef85746e78eb60b627ab1049bd0eab97 (diff) |
risu: make match status take tracing into account
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20170704144859.17644-2-alex.bennee@linaro.org
[PMM: fix spacing around : operator]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | reginfo.c | 14 | ||||
-rw-r--r-- | risu.c | 4 | ||||
-rw-r--r-- | risu.h | 2 |
3 files changed, 12 insertions, 8 deletions
@@ -138,7 +138,7 @@ int recv_and_compare_register_info(read_fn read_fn, * Should return 0 if it was a good match (ie end of test) * and 1 for a mismatch. */ -int report_match_status(void) +int report_match_status(int trace) { int resp = 0; fprintf(stderr, "match status...\n"); @@ -148,7 +148,7 @@ int report_match_status(void) /* We don't have valid reginfo from the apprentice side * so stop now rather than printing anything about it. */ - fprintf(stderr, "master reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "this" : "master"); reginfo_dump(&master_ri, stderr); return 1; } @@ -166,11 +166,15 @@ int report_match_status(void) return 0; } - fprintf(stderr, "master reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "this" : "master"); reginfo_dump(&master_ri, stderr); - fprintf(stderr, "apprentice reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "trace" : "apprentice"); reginfo_dump(&apprentice_ri, stderr); - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + if (trace) { + reginfo_dump_mismatch(&apprentice_ri, &master_ri, stderr); + } else { + reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + } return resp; } @@ -228,7 +228,7 @@ int master(void) signal_count); return 0; } else { - return report_match_status(); + return report_match_status(0); } } set_sigill_handler(&master_sigill); @@ -250,7 +250,7 @@ int apprentice(void) #endif close(apprentice_fd); fprintf(stderr, "finished early after %zd checkpoints\n", signal_count); - return report_match_status(); + return report_match_status(1); } set_sigill_handler(&apprentice_sigill); fprintf(stderr, "starting apprentice image at 0x%"PRIxPTR"\n", @@ -91,7 +91,7 @@ int recv_and_compare_register_info(read_fn read_fn, * Should return 0 if it was a good match (ie end of test) * and 1 for a mismatch. */ -int report_match_status(void); +int report_match_status(int trace); /* Interface provided by CPU-specific code: */ |