summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdtrace/common/dt_program.c
diff options
context:
space:
mode:
authorahl <none@none>2006-03-30 01:12:03 -0800
committerahl <none@none>2006-03-30 01:12:03 -0800
commitac448965596bc1c42f7accb3023f48d5fa9b8180 (patch)
tree2fec65de48a83b92568802081a1e3981d2aab1f7 /usr/src/lib/libdtrace/common/dt_program.c
parent507c32411f3f101e90ca2120f042b5ee698ba1d5 (diff)
downloadillumos-joyent-ac448965596bc1c42f7accb3023f48d5fa9b8180.tar.gz
6405927 USDT is-enabled probes
6405929 USDT DOF with zero probes results in an unsatisfiable memory allocation 6405932 dead variables in usr/src/uts/common/dtrace/dtrace.c 6405939 ::dofdump doesn't use section sizes correctly
Diffstat (limited to 'usr/src/lib/libdtrace/common/dt_program.c')
-rw-r--r--usr/src/lib/libdtrace/common/dt_program.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr/src/lib/libdtrace/common/dt_program.c b/usr/src/lib/libdtrace/common/dt_program.c
index e0d3ada107..d751c4817b 100644
--- a/usr/src/lib/libdtrace/common/dt_program.c
+++ b/usr/src/lib/libdtrace/common/dt_program.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -50,6 +49,13 @@ dt_program_create(dtrace_hdl_t *dtp)
else
(void) dt_set_errno(dtp, EDT_NOMEM);
+ /*
+ * By default, programs start with DOF version 1 so that output files
+ * containing DOF are backward compatible. If a program requires new
+ * DOF features, the version is increased as needed.
+ */
+ pgp->dp_dofversion = DOF_VERSION_1;
+
return (pgp);
}
@@ -425,6 +431,10 @@ dt_header_decl(dt_idhash_t *dhp, dt_ident_t *idp, void *data)
if (fprintf(infop->dthi_out, ");\n") < 0)
return (dt_set_errno(dtp, errno));
+ if (fprintf(infop->dthi_out, "extern int "
+ "__dtraceenabled_%s___%s(void);\n", infop->dthi_pfname, fname) < 0)
+ return (dt_set_errno(dtp, errno));
+
return (0);
}
@@ -481,6 +491,14 @@ dt_header_probe(dt_idhash_t *dhp, dt_ident_t *idp, void *data)
if (fprintf(infop->dthi_out, ")\n") < 0)
return (dt_set_errno(dtp, errno));
+ if (fprintf(infop->dthi_out, "#define\t%s_%s_ENABLED() \\\n",
+ infop->dthi_pmname, mname) < 0)
+ return (dt_set_errno(dtp, errno));
+
+ if (fprintf(infop->dthi_out, "\t__dtraceenabled_%s___%s()\n",
+ infop->dthi_pfname, fname) < 0)
+ return (dt_set_errno(dtp, errno));
+
return (0);
}