[DTrace-devel] [PATCH] Interrupting tracing should not yield an error (unless we failed)

Kris Van Hees kris.van.hees at oracle.com
Thu Mar 19 15:16:15 PDT 2020


Interrupting tracing (e.g. using Ctrl-C) would yield an error that
tracing couldn't be stopped.  This was caused by a remnant of the
old dtrace code using an ioctl() to signal the kernel that tracing
should be stopped.

This error condition no longer occurs because we no longer use the
ioxtl().  Additional processing when tracing should be stopped is
yet to be implemented.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 libdtrace/dt_work.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libdtrace/dt_work.c b/libdtrace/dt_work.c
index afe37946..b85ad607 100644
--- a/libdtrace/dt_work.c
+++ b/libdtrace/dt_work.c
@@ -243,16 +243,20 @@ dtrace_stop(dtrace_hdl_t *dtp)
 	if (dtp->dt_stopped)
 		return (0);
 
+#if 0
 	if (dt_ioctl(dtp, DTRACEIOC_STOP, &dtp->dt_endedon) == -1)
 		return (dt_set_errno(dtp, errno));
+#endif
 
 	dtp->dt_stopped = 1;
 
+#if 0
 	/*
 	 * Now that we're stopped, we're going to get status one final time.
 	 */
 	if (dt_ioctl(dtp, DTRACEIOC_STATUS, &dtp->dt_status[gen]) == -1)
 		return (dt_set_errno(dtp, errno));
+#endif
 
 	if (dt_handle_status(dtp, &dtp->dt_status[gen ^ 1],
 	    &dtp->dt_status[gen]) == -1)
-- 
2.25.0




More information about the DTrace-devel mailing list