Module Name: src
Committed By: hannken
Date: Tue Jul 16 07:27:35 UTC 2019
Modified Files:
src/external/cddl/osnet/dist/tools/ctf/cvt: fixup_tdescs.c
Log Message:
XXX: A crude hack to bring down the number of types for a
GENRIC kernel below 2**15-1 (from ~34000 to ~29800).
Remove the type attributes "volatile", "const" and "restrict",
for DTRACE these attributes are of little value.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c
diff -u src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.4 src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.5
--- src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c:1.4 Tue Jul 16 07:26:41 2019
+++ src/external/cddl/osnet/dist/tools/ctf/cvt/fixup_tdescs.c Tue Jul 16 07:27:35 2019
@@ -41,6 +41,7 @@
#include "ctftools.h"
#include "hash.h"
#include "memory.h"
+#include "traverse.h"
/*
* Due to 4432619, the 6.1 compiler will sometimes incorrectly generate pointer
@@ -320,6 +321,55 @@ fix_kmutex_private(tdata_t *td, size_t p
}
}
+/*
+ * XXX: A crude hack to bring down the number of types for a
+ * GENRIC kernel below 2**15-1 (from ~34000 to ~29800).
+ *
+ * Remove the type attributes "volatile", "const" and "restrict",
+ * for DTRACE these attributes are of little value.
+ */
+
+static int
+fix_kill_attr_cb(tdesc_t *tdp, tdesc_t **tdpp, void *private __unused)
+{
+
+ while (tdp->t_type == VOLATILE ||
+ tdp->t_type == RESTRICT ||
+ tdp->t_type == CONST)
+ tdp = tdp->t_tdesc;
+
+ *tdpp = tdp;
+
+ return 1;
+}
+
+static tdtrav_cb_f fix_kill_attr_tab[] = {
+ NULL,
+ NULL, /* intrinsic */
+ NULL, /* pointer */
+ NULL, /* reference */
+ NULL, /* array */
+ NULL, /* function */
+ NULL, /* struct */
+ NULL, /* union */
+ NULL, /* class */
+ NULL, /* enum */
+ NULL , /* forward */
+ NULL, /* typedef */
+ NULL, /* typedef unres */
+ fix_kill_attr_cb, /* volatile */
+ fix_kill_attr_cb, /* const */
+ fix_kill_attr_cb, /* restrict */
+};
+
+static void
+fix_kill_attr(tdata_t *td, size_t ptrsize)
+{
+
+ (void) iitraverse_hash(td->td_iihash, &td->td_curvgen,
+ fix_kill_attr_tab, NULL, NULL, NULL);
+}
+
#endif /* __NetBSD__ */
void
@@ -328,5 +378,6 @@ cvt_fixups(tdata_t *td, size_t ptrsize)
fix_small_cpu_struct(td, ptrsize);
#ifdef __NetBSD__
fix_kmutex_private(td, ptrsize);
+ fix_kill_attr(td, ptrsize);
#endif
}