summaryrefslogtreecommitdiffstats
path: root/testsuite/semok/thirteen.stp
blob: 91d767fb0ffd228e42c0aff0ed7bf531502d48d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! stap -p2

function trace (s) { return 0 }

# define some aliases which resolve to kernel functions

probe pipe_read = kernel.function("pipe_read")
{
	fname = "pipe_read"
	reading_from_pipe = 1
}

probe pipe_write = kernel.function("pipe_write")
{
	fname = "pipe_write"
	reading_from_pipe = 0
}

# use the aliases, including variables defined in them

probe pipe_read, pipe_write
{
	if (reading_from_pipe)
		trace("reading from pipe in " . fname)
	else
		trace("writing to pipe in " . fname)
}