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

probe begin {
    // basic @cast test, with and without specifying kernel
    println(@cast(0, "task_struct")->tgid)
    println(@cast(0, "task_struct", "kernel")->tgid)

    // check module-search paths
    println(@cast(0, "task_struct", "foo:kernel:bar")->tgid)

    // would be nice to test usermode @cast too,
    // but who knows what debuginfo is installed...

    // check modules generated from headers
    println(@cast(0, "task_struct", "kernel<linux/sched.h>")->tgid)
    println(@cast(0, "timeval", "<sys/time.h>")->tv_sec)

    // make sure that bogus @casts can get optimized away
    @cast(0, "task_struct")->no_such_field
    @cast(0, "task_struct")->parent->no_such_field
    @cast(0, "no_such_type")->tgid
    @cast(0, "task_struct", "no_such_module")->tgid
}