[DTrace-devel] [PATCH] sdt: support min and max kernel versions for probe dependencies

Eugene Loh eugene.loh at oracle.com
Thu Nov 30 20:21:59 UTC 2023


Another one that missed my inbox.

Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

And a few things...

Wed Nov 22 20:58:52 UTC 2023 patch:
> THe underlying probes that are used to trigger SDT probes may be kernel

s/THe/The/

> version dependent.  Adding optional minimum and maximum specifications
> (using DT_VERSION_NUMBER(x, y, z)) allows us to specify what kernels a
> certain dependency can be expected to work on.
>
> diff --git a/libdtrace/dt_provider_sdt.c b/libdtrace/dt_provider_sdt.c
> @@ -87,6 +87,16 @@ dt_sdt_enable(dtrace_hdl_t *dtp, dt_probe_t *prp)
>   if (strcmp(prp->desc->prb, dep->name) != 0)
>   continue;
>
> + /*
> + * If the dependency specifies a minimum and/or maximum kernel
> + * version, skip this dependency if the runtime kernel version
> + * does not fall in the specified range.
> + */

Could be more direct and clearer.  E.g., "Check kernel min and max 
versions, if specified."

> + if (dep->kver_min && dtp->dt_kernver < dep->kver_min)
> + continue;
> + if (dep->kver_max && dtp->dt_kernver > dep->kver_max)
> + continue;
> +
>   if (dtrace_str2desc(dtp, dep->spec, dep->str, &pd) == -1)
>   return;
>
> diff --git a/libdtrace/dt_provider_sdt.h b/libdtrace/dt_provider_sdt.h
> @@ -19,14 +19,16 @@ extern "C" {
>   * Probe dependencies
>   *
>   * SDT probes are implemented using probes made available by other 
> providers.
> - * THe probe dependency table associates each SDT probe with one or 
> more probe
> - * specifications (possibly containing wildcards).  Each matching 
> probe will
> - * have SDT lockstat probe added as a dependent probe.
> + * The probe dependency table associates each SDT probe with one or 
> more probe
> + * specifications (possibly containing wildcards).  On optional 
> minimum kernel
> + * version can also be specified (assigned using DT_VERSION_NUMBER(x, 
> y, z)).

s/On/An/???

And maximum as well?

> */
>  typedef struct probe_dep {
>   const char *name; /* probe name */
>   dtrace_probespec_t spec; /* spec type */
>   const char *str; /* spec string */
> + dt_version_t kver_min; /* minimum kernver */
> + dt_version_t kver_max; /* maximum kernver */
>  } probe_dep_t;
>



More information about the DTrace-devel mailing list