summaryrefslogtreecommitdiffstats
path: root/testsuite/provok/one.stp
blob: e51ee28a2ed69c612f903259788c229a3671d8c2 (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
25
26
#! stap

global ar1, ar2

function string (v) { return "" } # to become built-in

function search (key) 
{
  if (key in ar1)
    { ar1[key] ++; return ar2[ar1[key]] }
  else
    return "no can do"
}

probe syscall("zamboni")
{
  thread->ar2 = $tgid;
  search ($pid)
}

probe end
{
  for (key in ar2)
  # if (key in ar2)
    printk ("this: " . string (key) . " was " . string (ar2[key]))
}