File: stat_insert.stp

package info (click to toggle)
systemtap 3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,860 kB
  • ctags: 12,513
  • sloc: cpp: 58,610; ansic: 58,189; exp: 37,322; sh: 10,633; xml: 7,771; perl: 2,252; python: 2,066; tcl: 1,305; makefile: 969; lisp: 105; java: 100; awk: 94; asm: 91; sed: 16
file content (64 lines) | stat: -rwxr-xr-x 844 bytes parent folder | download | duplicates (10)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! stap -p4

# test the translatability of the statistic insertion operator

global loggy
global logmap
global liney
global linemap

global numbers
global strings

global x, y

function wibble()
{
	i = 0
	logmap[i++, "stewed"] <<< 1
	logmap[i++, "boiled"] <<< 1 + 2
	logmap[i++, "baked"] <<< (x = 0)
	logmap[i++, "fried"] <<< (x * (y=2)) + 3
}

function wobble()
{
	foreach (i in numbers)
	{
		foreach (j in strings)
		{
			linemap[strings[j],2*numbers[i],numbers[2*i]] <<< x * (y + i)
		}
	}
}


probe end {

	numbers[1] = 2
	numbers[2] = 5
	numbers[3] = 98279
	numbers[4] = 8739287

	strings[1] = "sun"
	strings[2] = "moon"
	strings[3] = "saturn"
	strings[4] = "venus"

	p = 4
	q = 5

	liney <<< 1
	liney <<< 1 + 2
	liney <<< p
	liney <<< (p * q) + 3

	loggy <<< 1
	loggy <<< 1 + 2
	loggy <<< p
	loggy <<< (p * q) + 3

	wibble()
	wobble()

}