qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target/mips: tests/tcg: Add optional printing of more detailed failure info

There is a need for printing input and output data for failure cases,
for debugging purpose. This is achieved by this patch, and only if a
preprocessor constant is manually set to 1. (Assumption is that the
need for such printout is relatively rare.)

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com>
Message-Id: <1566216496-17375-37-git-send-email-aleksandar.markovic@rt-rk.com>

+22 -1
+22 -1
tests/tcg/mips/include/test_utils_128.h
··· 27 27 #include <inttypes.h> 28 28 #include <string.h> 29 29 30 - #define PRINT_RESULTS 0 30 + #define PRINT_RESULTS 0 31 + #define PRINT_FAILURES 0 31 32 32 33 33 34 static inline int32_t check_results_128(const char *isa_ase_name, ··· 65 66 (b128_result[2 * i + 1] == b128_expect[2 * i + 1])) { 66 67 pass_count++; 67 68 } else { 69 + #if PRINT_FAILURES 70 + uint32_t ii; 71 + uint64_t a, b; 72 + 73 + printf("\n"); 74 + 75 + printf("FAILURE for test case %d!\n", i); 76 + 77 + memcpy(&a, (b128_expect + 2 * i), 8); 78 + memcpy(&b, (b128_expect + 2 * i + 1), 8); 79 + printf("Expected result : { 0x%016llxULL, 0x%016llxULL, },\n", 80 + a, b); 81 + 82 + memcpy(&a, (b128_result + 2 * i), 8); 83 + memcpy(&b, (b128_result + 2 * i + 1), 8); 84 + printf("Actual result : { 0x%016llxULL, 0x%016llxULL, },\n", 85 + a, b); 86 + 87 + printf("\n"); 88 + #endif 68 89 fail_count++; 69 90 } 70 91 }