diff options
author | markj <markj@FreeBSD.org> | 2013-08-17 22:02:26 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2013-08-17 22:02:26 +0000 |
commit | a7b2cd95aac0cdfa265d914e538385c6379b2f1b (patch) | |
tree | b31841bcb2737c2f65bfe1334fd43729c52823d7 /sys/cddl/dev/sdt | |
parent | 8e4bf18907d5b9b1bd23e80348a5703390ef2f32 (diff) | |
download | FreeBSD-src-a7b2cd95aac0cdfa265d914e538385c6379b2f1b.zip FreeBSD-src-a7b2cd95aac0cdfa265d914e538385c6379b2f1b.tar.gz |
Add a "translated type" argument to SDT_PROBE_ARGTYPE() and add some macros
which allow one to define SDT probes that specify translated types. The idea
is to make it easy to write SDT probe definitions that can work across
multiple operating systems. In particular, this makes it possible to port
illumos SDT probes to FreeBSD without changing their argument types, so long
as the appropriate translators are defined. Then DTrace scripts written for
Solaris/illumos will work on FreeBSD without any changes.
MFC after: 1 week
Diffstat (limited to 'sys/cddl/dev/sdt')
-rw-r--r-- | sys/cddl/dev/sdt/sdt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c index a1cd1e2..b65d1ad 100644 --- a/sys/cddl/dev/sdt/sdt.c +++ b/sys/cddl/dev/sdt/sdt.c @@ -201,11 +201,15 @@ sdt_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) if (desc->dtargd_ndx < probe->n_args) { TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { if (desc->dtargd_ndx == argtype->ndx) { - /* XXX */ desc->dtargd_mapping = desc->dtargd_ndx; strlcpy(desc->dtargd_native, argtype->type, sizeof(desc->dtargd_native)); - desc->dtargd_xlate[0] = '\0'; /* XXX */ + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, + argtype->xtype, + sizeof(desc->dtargd_xlate)); + else + desc->dtargd_xlate[0] = '\0'; } } } else |