diff options
author | Bryan Cantrill <bryan@joyent.com> | 2016-07-19 01:24:42 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2016-08-25 16:32:27 -0700 |
commit | 0ddc0ebb74cedb0ac394818c6e166c47eb8e62e5 (patch) | |
tree | 14a88d436d6e97194e6fe92be0bc55e25a6740bc /usr/src | |
parent | ff892b7ce7155120a08759aeabce0b4cd24bc867 (diff) | |
download | illumos-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')
6 files changed, 85 insertions, 8 deletions
diff --git a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d new file mode 100644 index 0000000000..6149546f61 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d @@ -0,0 +1,23 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +BEGIN +{ + @ = llquantize(0, 10, 0, 6, 20); + clear(@); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out new file mode 100644 index 0000000000..34cfadafa5 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out @@ -0,0 +1,6 @@ + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 0 + diff --git a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d new file mode 100644 index 0000000000..bf2875d1f9 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d @@ -0,0 +1,24 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +BEGIN +{ + @sfo["tabs"] = llquantize(10000, 10, 0, 6, 20); + @yvr["spaces"] = count(); + printa(@sfo, @yvr); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out new file mode 100644 index 0000000000..139e0082ab --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out @@ -0,0 +1,13 @@ + + spaces + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 0 + 1 + tabs + value ------------- Distribution ------------- count + 9500 | 0 + 10000 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1 + 15000 | 0 + 0 + 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; diff --git a/usr/src/pkg/manifests/system-dtrace-tests.mf b/usr/src/pkg/manifests/system-dtrace-tests.mf index 991cc4e9ab..1dc1a5649d 100644 --- a/usr/src/pkg/manifests/system-dtrace-tests.mf +++ b/usr/src/pkg/manifests/system-dtrace-tests.mf @@ -1039,6 +1039,10 @@ file path=opt/SUNWdtrt/tst/common/llquantize/tst.bases.d mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.bases.d.out mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.basic.d mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.basic.d.out mode=0444 +file path=opt/SUNWdtrt/tst/common/llquantize/tst.clear.d mode=0444 +file path=opt/SUNWdtrt/tst/common/llquantize/tst.clear.d.out mode=0444 +file path=opt/SUNWdtrt/tst/common/llquantize/tst.multiaggs.d mode=0444 +file path=opt/SUNWdtrt/tst/common/llquantize/tst.multiaggs.d.out mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.negorder.d mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.negorder.d.out mode=0444 file path=opt/SUNWdtrt/tst/common/llquantize/tst.negvalue.d mode=0444 |