summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.samples/system_func.stp
blob: 60d9a7239e17f057a929a3ab52d24dea5c92856b (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
#! stap

# test the system() function

probe kernel.function("sys_open") {
  # very inefficient. Testing only. DO NOT DO THIS
  msg="echo sys_open"
  system(msg)
}

probe begin {
  # should succeed
  system("whoami")

  # should fail
  system("cat __xyzzy123ABC__")

  exit()
}

probe end {
  # should succeed
  system("echo DONE")
}