diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2014-07-12 22:56:41 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2014-07-12 22:56:41 +0000 |
commit | 0cff4b03ddab4866935fdab21800c42ee8c1c6b2 (patch) | |
tree | 2f675ec37e93f585d83885a3063b6f30cdb74531 /cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh | |
parent | 196ba30fc44615a6eee4374b37450a4841abe010 (diff) | |
download | FreeBSD-src-0cff4b03ddab4866935fdab21800c42ee8c1c6b2.zip FreeBSD-src-0cff4b03ddab4866935fdab21800c42ee8c1c6b2.tar.gz |
MFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006:
2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access
4477 DTrace should speak JSON
Add stubs for CTF functions which are not yet implemented.
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation is missing checks
4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh new file mode 100644 index 0000000..d987c8d --- /dev/null +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/err.user64mode.ksh @@ -0,0 +1,90 @@ +#! /usr/bin/ksh +# +# +# 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) 2013 Joyent, Inc. All rights reserved. +# + +# +# This test is purposefully using a 64-bit DTrace and thus 64-bit types +# when compared with a 32-bit process. This test uses the userland +# keyword and so the implicit copyin should access illegal memory and +# thus exit. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +t="zelda_info_t" +exe="tst.chasestrings.exe" + +elfdump "./$exe" | grep -q '.SUNW_ctf' +if [[ $? -ne 0 ]]; then + echo "CTF does not exist in $exe, that's a bug" >&2 + exit 1 +fi + +./$exe & +pid=$! + +$dtrace -64 -qs /dev/stdin <<EOF +typedef struct info { + char *zi_gamename; + int zi_ndungeons; + char *zi_villain; + int zi_haszelda; +} info_t; + +pid$pid::has_princess:entry +/next == 0/ +{ + this->t = (userland info_t *)arg0; + printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", + stringof(this->t->zi_gamename), this->t->zi_ndungeons, + stringof(this->t->zi_villain), this->t->zi_haszelda); + next = 1; +} + +pid$pid::has_dungeons:entry +/next == 1/ +{ + this->t = (userland info_t *)arg0; + printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", + stringof(this->t->zi_gamename), this->t->zi_ndungeons, + stringof(this->t->zi_villain), this->t->zi_haszelda); + next = 2; +} + +pid$pid::has_villain:entry +/next == 2/ +{ + this->t = (userland info_t *)arg0; + printf("game: %s, dungeon: %d, villain: %s, zelda: %d\n", + stringof(this->t->zi_gamename), this->t->zi_ndungeons, + stringof(this->t->zi_villain), this->t->zi_haszelda); + exit(0); +} + +ERROR +{ + exit(1); +} +EOF +rc=$? + +kill -9 $pid + +exit $rc |