Project

General

Profile

Bug #4545 » test.d

Marcel Telka, 2015-02-10 11:45 PM

 
1
#pragma D option destructive
2

    
3
#include <xti.h>
4
#include <sys/tihdr.h>
5
#include <thread.h>
6
#include <synch.h>
7

    
8
/*
9
 * Change the tiap->CURRENT_state in the _t_create() so it later fails and the
10
 * _t_delete_tilink() is called.
11
 */
12
pid$target::_t_alloc_bufs:entry
13
/arg2/
14
{
15
	this->tiap = (struct T_info_ack *)copyin(arg2, sizeof (struct T_info_ack));
16
	this->tiap->CURRENT_state = TS_WACK_BREQ;
17
	copyout(this->tiap, arg2, sizeof (struct T_info_ack));
18
}
19

    
20
pid$target::_t_delete_tilink:entry
21
{
22
}
23

    
24
pid$target::_t_create:entry
25
{
26
	self->t = 1;
27
}
28

    
29
pid$target::_t_create:return
30
{
31
	self->t = 0;
32
}
33

    
34
/*
35
 * Dump the freed mutex
36
 */
37
pid$target::sig_mutex_unlock:entry
38
/self->t/
39
{
40
	mp = (userland mutex_t *)arg0;
41
	print(*mp);
42
}
(2-2/2)