Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2013 23:36:36 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org, dtrace@FreeBSD.org
Subject:   Re: sdt "sname" removal
Message-ID:  <20131031033636.GC9355@raichu>
In-Reply-To: <5270246B.6070105@FreeBSD.org>
References:  <5270246B.6070105@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 29, 2013 at 11:11:07PM +0200, Andriy Gapon wrote:
> 
> I never understood why FreeBSD SDT as opposed to upstream SDT requires the same
> or almost the same probe name to be specified twice.  This seems to be silly and
> a little bit error-prone.
> In other words, I do not see any reason not to re-use the original upstream
> trick where double underscore in a providers name in the C code gets converted
> to a single dash in a DTrace provider name. [*]
> 
> So here is my take at that:
> http://people.freebsd.org/~avg/sdt-sname-removal.diff
> 
> An inline preview of the change:
> -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int");
> -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int");
> +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int");
> +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__err, "int");
> 
> It's possible that I missed some places where old style SDT_PROBE_DEFINE macros
> are used or where an old probe name is used with SDT_PROBE_ARGTYPE or SDT_PROBE.

A good way to test this is to compare the output of 'dtrace -lv' with and
without your change. If nothing changes, I'd be pretty confident that
the diff is correct.

> 
> Please test, review, comment, etc.

I don't think this diff will apply cleanly to head - I've made some changes
that will cause conflicts, and the diff doesn't touch netinet/in_kdtrace.c
or kern/subr_devstat.c. Could you also update the SDT(9) man page? Also
the "strlcpy(name, ..." immediately before the loop you added to sdt.c
becomes redundant.

Thanks,
-Mark



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131031033636.GC9355>