summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdtrace/common
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2016-07-19 01:24:42 +0000
committerRobert Mustacchi <rm@joyent.com>2016-08-25 16:32:27 -0700
commit0ddc0ebb74cedb0ac394818c6e166c47eb8e62e5 (patch)
tree14a88d436d6e97194e6fe92be0bc55e25a6740bc /usr/src/lib/libdtrace/common
parentff892b7ce7155120a08759aeabce0b4cd24bc867 (diff)
downloadillumos-gate-0ddc0ebb74cedb0ac394818c6e166c47eb8e62e5.tar.gz
7297 clear() on llquantize aggregation causes dtrace to exit
7298 printa() of multiple aggregations can fail for llquantize() Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Adam Leventhal <adam.leventhal@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libdtrace/common')
-rw-r--r--usr/src/lib/libdtrace/common/dt_aggregate.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/usr/src/lib/libdtrace/common/dt_aggregate.c b/usr/src/lib/libdtrace/common/dt_aggregate.c
index 64ea79fbcc..a0eebe5a75 100644
--- a/usr/src/lib/libdtrace/common/dt_aggregate.c
+++ b/usr/src/lib/libdtrace/common/dt_aggregate.c
@@ -25,7 +25,7 @@
*/
/*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2016, Joyent, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
*/
@@ -1145,7 +1145,13 @@ dt_aggwalk_rval(dtrace_hdl_t *dtp, dt_ahashent_t *h, int rval)
size = rec->dtrd_size;
data = &h->dtahe_data;
- if (rec->dtrd_action == DTRACEAGG_LQUANTIZE) {
+ if (rec->dtrd_action == DTRACEAGG_LQUANTIZE ||
+ rec->dtrd_action == DTRACEAGG_LLQUANTIZE) {
+ /*
+ * For lquantize() and llquantize(), we want to be
+ * sure to not zero the aggregation parameters; step
+ * over them and adjust our size accordingly.
+ */
offs = sizeof (uint64_t);
size -= sizeof (uint64_t);
}
@@ -1894,12 +1900,13 @@ dtrace_aggregate_walk_joined(dtrace_hdl_t *dtp, dtrace_aggvarid_t *aggvars,
rec = &aggdesc->dtagd_rec[aggdesc->dtagd_nrecs - 1];
/*
- * Now for the more complicated part. If (and only if) this
- * is an lquantize() aggregating action, zero-filled data is
- * not equivalent to an empty record: we must also get the
- * parameters for the lquantize().
+ * Now for the more complicated part. For the lquantize() and
+ * llquantize() aggregating actions, zero-filled data is not
+ * equivalent to an empty record: we must also get the
+ * parameters for the lquantize()/llquantize().
*/
- if (rec->dtrd_action == DTRACEAGG_LQUANTIZE) {
+ if (rec->dtrd_action == DTRACEAGG_LQUANTIZE ||
+ rec->dtrd_action == DTRACEAGG_LLQUANTIZE) {
if (aggdata->dtada_data != NULL) {
/*
* The easier case here is if we actually have
@@ -1920,7 +1927,7 @@ dtrace_aggregate_walk_joined(dtrace_hdl_t *dtp, dtrace_aggvarid_t *aggvars,
* -- either directly or indirectly.) So as
* gross as it is, we'll grovel around in the
* compiler-generated information to find the
- * lquantize() parameters.
+ * lquantize()/llquantize() parameters.
*/
dtrace_stmtdesc_t *sdp;
dt_ident_t *aid;