1*8e648814SRui Paulo#! /usr/bin/ksh 2*8e648814SRui Paulo# 3*8e648814SRui Paulo# 4*8e648814SRui Paulo# This file and its contents are supplied under the terms of the 5*8e648814SRui Paulo# Common Development and Distribution License ("CDDL"), version 1.0. 6*8e648814SRui Paulo# You may only use this file in accordance with the terms of version 7*8e648814SRui Paulo# 1.0 of the CDDL. 8*8e648814SRui Paulo# 9*8e648814SRui Paulo# A full copy of the text of the CDDL should have accompanied this 10*8e648814SRui Paulo# source. A copy of the CDDL is also available via the Internet at 11*8e648814SRui Paulo# http://www.illumos.org/license/CDDL. 12*8e648814SRui Paulo# 13*8e648814SRui Paulo 14*8e648814SRui Paulo# 15*8e648814SRui Paulo# Copyright (c) 2013 Joyent, Inc. All rights reserved. 16*8e648814SRui Paulo# 17*8e648814SRui Paulo 18*8e648814SRui Paulo# 19*8e648814SRui Paulo# We should be able to see both strstr from libc and from ld on an 20*8e648814SRui Paulo# alternate linkmap. 21*8e648814SRui Paulo# 22*8e648814SRui Paulo 23*8e648814SRui Pauloif [ $# != 1 ]; then 24*8e648814SRui Paulo echo expected one argument: '<'dtrace-path'>' 25*8e648814SRui Paulo exit 2 26*8e648814SRui Paulofi 27*8e648814SRui Paulo 28*8e648814SRui Paulodtrace=$1 29*8e648814SRui Paulo 30*8e648814SRui Paulo$dtrace -q -p $$ -s /dev/stdin <<EOF 31*8e648814SRui Paulopid\$target:LM1\`ld.so.1:strstr:entry, 32*8e648814SRui Paulopid\$target:libc.so.1:strstr:entry 33*8e648814SRui Paulo{ 34*8e648814SRui Paulo exit (0); 35*8e648814SRui Paulo} 36*8e648814SRui Paulo 37*8e648814SRui PauloBEGIN 38*8e648814SRui Paulo{ 39*8e648814SRui Paulo exit (0); 40*8e648814SRui Paulo} 41*8e648814SRui PauloEOF 42*8e648814SRui Paulorc=$? 43*8e648814SRui Paulo 44*8e648814SRui Pauloexit $rc 45