Project

General

Profile

Bug #4061 » leaks_rename.sh

Marcel Telka, 2013-08-20 02:51 PM

 
1
#!/bin/sh
2

    
3
DEVICE=`pwd`/testpool
4
POOL=testpool
5
OLD_NAME=$POOL/qqq
6
NEW_NAME=$POOL/www
7

    
8
gcc -g -o leaks_rename leaks_rename.c -lzfs
9

    
10
mkfile 100m $DEVICE
11
zpool create $POOL $DEVICE
12
zfs create $OLD_NAME
13

    
14

    
15
LD_LIBRARY_PATH=. LD_PRELOAD=libumem.so UMEM_DEBUG=default ./leaks_rename $OLD_NAME $NEW_NAME &
16
sleep 1
17
PID=$!
18
echo "started PID:"$PID
19
echo "find leaks in "$PID
20
echo "::findleaks -dv" | mdb -p $PID
21
echo "killing "$PID
22
kill $PID
23

    
24

    
25

    
26
zpool destroy $POOL
27
rm -f $DEVICE
(1-1/2)