[DTrace-devel] [PATCH 07/15] provider: Add support for attaching to raw tracepoints
Nick Alcock
nick.alcock at oracle.com
Thu Feb 23 12:51:41 UTC 2023
Also...
On 23 Feb 2023, Kris Van Hees via DTrace-devel told this:
> +/*
> + * Convenience function for raw tracepoint-based probe attach.
> + */
> +int
> +dt_tp_probe_attach_raw(dtrace_hdl_t *dtp, const dt_probe_t *prp, int bpf_fd)
> +{
> + tp_probe_t *tpp = prp->prv_data;
> +
> + if (tpp->event_id != -1)
> + tpp->event_id = INT_MAX;
dt_tp_attach says
if (tpp->event_id == -1)
return 0;
Why the difference?
(And surely this should be either checking against INT_MAX in the
conditional, or setting it to (int) -1? Or just avoiding it entirely and
saying, unconditionally
tpp->event_id = INT_MAX;
with no conditional at all, since it is more or less a NOP.)
--
NULL && (void)
More information about the DTrace-devel
mailing list