summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/guest-diag/run_cycle.sh2
-rw-r--r--tools/test/cuda_drv_test.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/tools/guest-diag/run_cycle.sh b/tools/guest-diag/run_cycle.sh
index 0944dcb..3f5289a 100755
--- a/tools/guest-diag/run_cycle.sh
+++ b/tools/guest-diag/run_cycle.sh
@@ -59,7 +59,7 @@ sleep 2
echo "[*] launching cdt (HOLD=$HOLD, $TRACE)"
if [ "$TRACE" = "strace" ]; then
timeout 30 "$VMEXEC" exec \
- "rm -f /tmp/cdt.out /tmp/strace.log; echo '=== CDT RUN START (strace) ===' > /dev/ttyS0; CDT_HOLD=$HOLD nohup sh -c 'strace -f -tt -e trace=ioctl -o /tmp/strace.log /tmp/cdt 2>&1 | tee /tmp/cdt.out | stdbuf -oL tee /dev/ttyS0 >/dev/null' >/dev/null 2>&1 & echo STARTED" \
+ "rm -f /tmp/cdt.out /tmp/strace.log; echo '=== CDT RUN START (strace) ===' > /dev/ttyS0; CDT_HOLD=$HOLD CDT_WAIT=${CDT_WAIT:-0} nohup sh -c 'strace -f -tt -e trace=ioctl -o /tmp/strace.log /tmp/cdt 2>&1 | tee /tmp/cdt.out | stdbuf -oL tee /dev/ttyS0 >/dev/null' >/dev/null 2>&1 & echo STARTED" \
>/dev/null 2>&1
elif [ "$TRACE" = "gdb" ]; then
timeout 30 "$VMEXEC" exec "rm -f /tmp/cdt.out /tmp/bpwait.out; sync; echo CLEARED" >/dev/null 2>&1
diff --git a/tools/test/cuda_drv_test.c b/tools/test/cuda_drv_test.c
index ba8c20c..9501cb3 100644
--- a/tools/test/cuda_drv_test.c
+++ b/tools/test/cuda_drv_test.c
@@ -135,5 +135,14 @@ int main(void)
MARK("cuCtxDestroy");
CHECK(cuCtxDestroy(ctx));
printf("ALL OK\n");
+ {
+ const char *wait = getenv("CDT_WAIT");
+ if (wait && atoi(wait) > 0) {
+ printf("CDT_WAIT: parked %d s (buf=%p back=%p)\n",
+ atoi(wait), (void *)buf, (void *)back);
+ fflush(stdout);
+ sleep((unsigned)atoi(wait));
+ }
+ }
return 0;
}