summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/print.stp
blob: 161be4b4cca673c7ccb5e6e9af6cb0ac37eb58ba (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
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * print.stp
 *
 * Test that all the print statements work
 */

global s1, s2, s3

probe begin
{
	println("systemtap starting probe")
	s1 = "systemtap"
	s2 = "test"
	s3 = "success"
}

probe end
{
	println("systemtap ending probe")

	print(s1, " ", s2, " ", s3, "\n")
	print(sprint(s1, " ", s2, " ", s3, "\n"))

	println(s1, " ", s2, " ", s3)
	print(sprintln(s1, " ", s2, " ", s3))

	printd(" ", s1, s2, s3 . "\n")
	print(sprintd(" ", s1, s2, s3 . "\n"))

	printdln(" ", s1, s2, s3)
	print(sprintdln(" ", s1, s2, s3))

	// Check that formatting characters get escaped correctly 
	// in the delimiter.
	s = sprintd("%% % \\ \"", 1, 2, 3)
	if (s == "1%% % \\ \"2%% % \\ \"3")
		println("systemtap test success")
	else
		println("systemtap test failure")
}