summaryrefslogtreecommitdiffstats
path: root/examples/pf2.stp
blob: fbac4e50a0b1477c340e93d2c4c1f870fd899a9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/stap

global profile, pcount
probe timer.profile {
  pcount <<< 1
  fn = probefunc ()
  if (fn != "") profile[fn] <<< 1
}
probe timer.ms(4000) {
  printf ("\n--- %d samples recorded:\n", @count(pcount))
  foreach (f in profile- limit 10) {
    printf ("%s\t%d\n", f, @count(profile[f]))
  }
  delete profile
  delete pcount
}