From owner-svn-src-vendor@freebsd.org Fri Aug 26 20:51:11 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31993B74CE7; Fri, 26 Aug 2016 20:51:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C3FBFFC; Fri, 26 Aug 2016 20:51:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7QKpAlF091416; Fri, 26 Aug 2016 20:51:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7QKp9O8091410; Fri, 26 Aug 2016 20:51:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608262051.u7QKp9O8091410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Aug 2016 20:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304861 - in vendor/illumos/dist: cmd/dtrace/test/tst/common/llquantize lib/libdtrace/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 20:51:11 -0000 Author: markj Date: Fri Aug 26 20:51:09 2016 New Revision: 304861 URL: https://svnweb.freebsd.org/changeset/base/304861 Log: 7297 clear() on llquantize aggregation causes dtrace to exit 7298 printa() of multiple aggregations can fail for llquantize() illumos/illumos-gate@0ddc0ebb74cedb0ac394818c6e166c47eb8e62e5 Reviewed by: Patrick Mooney Reviewed by: Robert Mustacchi Reviewed by: Dan McDonald Reviewed by: Adam Leventhal Approved by: Richard Lowe Author: Bryan Cantrill Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out Modified: vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d Fri Aug 26 20:51:09 2016 (r304861) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.clear.d.out Fri Aug 26 20:51:09 2016 (r304861) @@ -0,0 +1,6 @@ + + + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 0 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d Fri Aug 26 20:51:09 2016 (r304861) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/llquantize/tst.multiaggs.d.out Fri Aug 26 20:51:09 2016 (r304861) @@ -0,0 +1,13 @@ + + spaces + value ------------- Distribution ------------- count + < 1 | 0 + 1 | 0 + 1 + tabs + value ------------- Distribution ------------- count + 9500 | 0 + 10000 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1 + 15000 | 0 + 0 + Modified: vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c ============================================================================== --- vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c Fri Aug 26 20:23:10 2016 (r304860) +++ vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c Fri Aug 26 20:51:09 2016 (r304861) @@ -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_ah 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_ 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_ * -- 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;