diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-07-26 19:38:24 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-07-27 10:22:23 +0200 |
| commit | b25fc7b83119e8dca728a199fd92e24dd4c33fa4 (patch) | |
| tree | 15e95c4062be3f23ab8f66c05e33465d40c1d870 /executor/common.h | |
| parent | 9d92841b4e4d0ac0f97f983cd90087323f27c26c (diff) | |
pkg/csource: add option to trace syscall results
This will be needed for testing of generated programs.
Diffstat (limited to 'executor/common.h')
| -rw-r--r-- | executor/common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/executor/common.h b/executor/common.h index 9e6545926..1b9afd074 100644 --- a/executor/common.h +++ b/executor/common.h @@ -21,6 +21,10 @@ #include <stdlib.h> #include <string.h> +#if SYZ_TRACE +#include <errno.h> +#endif + #if SYZ_EXECUTOR && !GOOS_linux #include <unistd.h> NORETURN void doexit(int status) @@ -396,6 +400,9 @@ static void loop() if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } #endif +#if SYZ_TRACE + printf("### start\n"); +#endif int call, thread; #if SYZ_COLLIDE int collide = 0; @@ -470,7 +477,11 @@ static void loop() fail("pipe failed"); #endif int iter; +#if SYZ_REPEAT_TIMES + for (iter = 0; iter < [[REPEAT_TIMES]]; iter++) { +#else for (iter = 0;; iter++) { +#endif #if SYZ_EXECUTOR || SYZ_USE_TMP_DIR // Create a new private work dir for this test (removed at the end of the loop). char cwdbuf[32]; |
