File: func_definition.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 (60 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (4)
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
/*
 * func_definition.stp
 *
 * Check function definitions
 */
probe begin {
    println("systemtap starting probe")
}


function f1(arg:long)
{
    if (arg == 2015)
        println("systemtap test success")
    else
        printf("systemtap test failure - arg of f1:%d != 2015\n", arg)
}

function f2(arg)
{
    if (arg == 2015)
        println("systemtap test success")
    else
        printf("systemtap test failure - arg of f2:%d != 2015\n", arg)
}

function f3:long()
{
    return 2015
}

function f4()
{
    return 2015
}

function f5()
{
    println("systemtap test success")
}

probe end {
    println("systemtap ending probe")

    f1(2015)

    f2(2015)

    if (f3() == 2015)
        println("systemtap test success")
    else
        printf("systemtap test failure - return_value of f3:%d != 2015\n", f3())

    if (f4() == 2015)
        println("systemtap test success")
    else
        printf("systemtap test failure - return_value of f4:%d != 2015\n", f4())

    f5()
}