public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 4/4] options: discontinue -xversion=V as a valid option
@ 2025-12-17  5:10 Kris Van Hees
  2025-12-18 17:16 ` [DTrace-devel] " Alan Maguire
  2025-12-18 20:22 ` Eugene Loh
  0 siblings, 2 replies; 4+ messages in thread
From: Kris Van Hees @ 2025-12-17  5:10 UTC (permalink / raw)
  To: dtrace, dtrace-devel

DTrace allowed setting a previous version to operate in compatibility
mode.  Unfortunately, it was not fully implemented.  Translators are
not really versioned, and if a translator uses an identifier that does
not exist in the version specified in -xversion=V, data structures end
up corrupted.

Since the usefulness of -xversion=V seems to be less than the effort
needed to rectify the implementation, we are no longer supporting this
option.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 libdtrace/dt_options.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/libdtrace/dt_options.c b/libdtrace/dt_options.c
index 97516517..0a35e852 100644
--- a/libdtrace/dt_options.c
+++ b/libdtrace/dt_options.c
@@ -24,6 +24,7 @@
 #include <dt_pcap.h>
 #include <dt_string.h>
 #include <libproc.h>
+#include <port.h>
 
 static int
 dt_opt_agg(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
@@ -676,18 +677,7 @@ dt_opt_invcflags(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
 static int
 dt_opt_version(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
 {
-	dt_version_t v;
-
-	if (arg == NULL)
-		return dt_set_errno(dtp, EDT_BADOPTVAL);
-
-	if (dt_version_str2num(arg, &v) == -1)
-		return dt_set_errno(dtp, EDT_VERSINVAL);
-
-	if (!dt_version_defined(v))
-		return dt_set_errno(dtp, EDT_VERSUNDEF);
-
-	return dt_reduce(dtp, v);
+	return dt_set_errno(dtp, ENOTSUPP);
 }
 
 static int
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [DTrace-devel] [PATCH 4/4] options: discontinue -xversion=V as a valid option
  2025-12-17  5:10 [PATCH 4/4] options: discontinue -xversion=V as a valid option Kris Van Hees
@ 2025-12-18 17:16 ` Alan Maguire
  2025-12-18 20:22 ` Eugene Loh
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Maguire @ 2025-12-18 17:16 UTC (permalink / raw)
  To: Kris Van Hees, dtrace, dtrace-devel

On 17/12/2025 05:10, Kris Van Hees via DTrace-devel wrote:
> DTrace allowed setting a previous version to operate in compatibility
> mode.  Unfortunately, it was not fully implemented.  Translators are
> not really versioned, and if a translator uses an identifier that does
> not exist in the version specified in -xversion=V, data structures end
> up corrupted.
> 
> Since the usefulness of -xversion=V seems to be less than the effort
> needed to rectify the implementation, we are no longer supporting this
> option.
> 
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>

wow, never even noticed this existed!

Reviewed-by: Alan Maguire <alan.maguire@oracle.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] options: discontinue -xversion=V as a valid option
  2025-12-17  5:10 [PATCH 4/4] options: discontinue -xversion=V as a valid option Kris Van Hees
  2025-12-18 17:16 ` [DTrace-devel] " Alan Maguire
@ 2025-12-18 20:22 ` Eugene Loh
  2025-12-18 20:24   ` Kris Van Hees
  1 sibling, 1 reply; 4+ messages in thread
From: Eugene Loh @ 2025-12-18 20:22 UTC (permalink / raw)
  To: Kris Van Hees, dtrace, dtrace-devel

Okay, but there must surely be test-suite changes.  At the very least:

* test/unittest/version/err.1.1.d  The err.* tests should not simply 
fail;  they should fail for the correct reason.

* test/unittest/version/tst.1.0.d

Maybe nothing else???

On 12/17/25 00:10, Kris Van Hees wrote:
> DTrace allowed setting a previous version to operate in compatibility
> mode.  Unfortunately, it was not fully implemented.  Translators are
> not really versioned, and if a translator uses an identifier that does
> not exist in the version specified in -xversion=V, data structures end
> up corrupted.
>
> Since the usefulness of -xversion=V seems to be less than the effort
> needed to rectify the implementation, we are no longer supporting this
> option.
>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>   libdtrace/dt_options.c | 14 ++------------
>   1 file changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/libdtrace/dt_options.c b/libdtrace/dt_options.c
> index 97516517..0a35e852 100644
> --- a/libdtrace/dt_options.c
> +++ b/libdtrace/dt_options.c
> @@ -24,6 +24,7 @@
>   #include <dt_pcap.h>
>   #include <dt_string.h>
>   #include <libproc.h>
> +#include <port.h>
>   
>   static int
>   dt_opt_agg(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
> @@ -676,18 +677,7 @@ dt_opt_invcflags(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
>   static int
>   dt_opt_version(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
>   {
> -	dt_version_t v;
> -
> -	if (arg == NULL)
> -		return dt_set_errno(dtp, EDT_BADOPTVAL);
> -
> -	if (dt_version_str2num(arg, &v) == -1)
> -		return dt_set_errno(dtp, EDT_VERSINVAL);
> -
> -	if (!dt_version_defined(v))
> -		return dt_set_errno(dtp, EDT_VERSUNDEF);
> -
> -	return dt_reduce(dtp, v);
> +	return dt_set_errno(dtp, ENOTSUPP);
>   }
>   
>   static int

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4/4] options: discontinue -xversion=V as a valid option
  2025-12-18 20:22 ` Eugene Loh
@ 2025-12-18 20:24   ` Kris Van Hees
  0 siblings, 0 replies; 4+ messages in thread
From: Kris Van Hees @ 2025-12-18 20:24 UTC (permalink / raw)
  To: Eugene Loh; +Cc: Kris Van Hees, dtrace, dtrace-devel

On Thu, Dec 18, 2025 at 03:22:47PM -0500, Eugene Loh wrote:
> Okay, but there must surely be test-suite changes.  At the very least:
> 
> * test/unittest/version/err.1.1.d  The err.* tests should not simply fail; 
> they should fail for the correct reason.
> 
> * test/unittest/version/tst.1.0.d
> 
> Maybe nothing else???

Right.  Making those changes now, and will post v2.

> On 12/17/25 00:10, Kris Van Hees wrote:
> > DTrace allowed setting a previous version to operate in compatibility
> > mode.  Unfortunately, it was not fully implemented.  Translators are
> > not really versioned, and if a translator uses an identifier that does
> > not exist in the version specified in -xversion=V, data structures end
> > up corrupted.
> > 
> > Since the usefulness of -xversion=V seems to be less than the effort
> > needed to rectify the implementation, we are no longer supporting this
> > option.
> > 
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> > ---
> >   libdtrace/dt_options.c | 14 ++------------
> >   1 file changed, 2 insertions(+), 12 deletions(-)
> > 
> > diff --git a/libdtrace/dt_options.c b/libdtrace/dt_options.c
> > index 97516517..0a35e852 100644
> > --- a/libdtrace/dt_options.c
> > +++ b/libdtrace/dt_options.c
> > @@ -24,6 +24,7 @@
> >   #include <dt_pcap.h>
> >   #include <dt_string.h>
> >   #include <libproc.h>
> > +#include <port.h>
> >   static int
> >   dt_opt_agg(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
> > @@ -676,18 +677,7 @@ dt_opt_invcflags(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
> >   static int
> >   dt_opt_version(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
> >   {
> > -	dt_version_t v;
> > -
> > -	if (arg == NULL)
> > -		return dt_set_errno(dtp, EDT_BADOPTVAL);
> > -
> > -	if (dt_version_str2num(arg, &v) == -1)
> > -		return dt_set_errno(dtp, EDT_VERSINVAL);
> > -
> > -	if (!dt_version_defined(v))
> > -		return dt_set_errno(dtp, EDT_VERSUNDEF);
> > -
> > -	return dt_reduce(dtp, v);
> > +	return dt_set_errno(dtp, ENOTSUPP);
> >   }
> >   static int

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-18 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17  5:10 [PATCH 4/4] options: discontinue -xversion=V as a valid option Kris Van Hees
2025-12-18 17:16 ` [DTrace-devel] " Alan Maguire
2025-12-18 20:22 ` Eugene Loh
2025-12-18 20:24   ` Kris Van Hees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox