Sophie

Sophie

distrib > Fedora > 17 > i386 > by-pkgid > e2ec330d3ecf5110b4aa890342e53d96 > files > 1004

systemtap-client-2.1-2.fc17.i686.rpm

#!/usr/bin/stap
# The following line command will probe all the functions
# in kernel's memory management code:
#
# stap  functioncallcount.stp "*@mm/*.c"

probe kernel.function(@1).call {  # probe functions listed on commandline
  called[probefunc()] <<< 1  # add a count efficiently
}

global called

probe end {
  foreach (fn in called-)  # Sort by call count (in decreasing order)
  #       (fn+ in called)  # Sort by function name
    printf("%s %d\n", fn, @count(called[fn]))
  exit()
}