#! 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")->tgid) println(@cast(0, "timeval", "")->tv_sec) // sometimes multiple headers are needed in tandem println(@cast(0, "task_struct", "kernel")->fs->umask) // 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 }