Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 8e87fca2f49595adc16d9aa519a6edad > files > 205

systemtap-1.6-1.fc14.x86_64.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()
}