Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/func_definition.stp

raw
1 /*
2 * func_definition.stp
3 *
4 * Check function definitions
5 */
6 probe begin {
7 println("systemtap starting probe")
8 }
9
10
11 function f1(arg:long)
12 {
13 if (arg == 2015)
14 println("systemtap test success")
15 else
16 printf("systemtap test failure - arg of f1:%d != 2015\n", arg)
17 }
18
19 function f2(arg)
20 {
21 if (arg == 2015)
22 println("systemtap test success")
23 else
24 printf("systemtap test failure - arg of f2:%d != 2015\n", arg)
25 }
26
27 function f3:long()
28 {
29 return 2015
30 }
31
32 function f4()
33 {
34 return 2015
35 }
36
37 function f5()
38 {
39 println("systemtap test success")
40 }
41
42 function function_names_over_128_characters_exceed_MAX_NAME_LEN_in_linux_objtool_which_is_invoked_by_kbuild_and_are_therefore_shortened()
43 {
44 return 2021
45 }
46
47 probe end {
48 println("systemtap ending probe")
49
50 f1(2015)
51
52 f2(2015)
53
54 if (f3() == 2015)
55 println("systemtap test success")
56 else
57 printf("systemtap test failure - return_value of f3:%d != 2015\n", f3())
58
59 if (f4() == 2015)
60 println("systemtap test success")
61 else
62 printf("systemtap test failure - return_value of f4:%d != 2015\n", f4())
63
64 f5()
65
66 if (function_names_over_128_characters_exceed_MAX_NAME_LEN_in_linux_objtool_which_is_invoked_by_kbuild_and_are_therefore_shortened() == 2021)
67 println("systemtap test success")
68 }