summaryrefslogtreecommitdiffstats
path: root/examples/small_demos/fileopen.stp
blob: 5d59ee55718e1162e198f9ca46ac42ce074ed3ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# fileopen.stp
#
# This is based on dtrace script from 
# http://www.gnome.org/~gman/blog/2006/Jan
#
#stap  fileopen.stp  -c "zenity --about"

global opens

probe syscall.open {
  if (target() == pid()) opens[filename] ++
}

probe end {
  foreach([name] in opens+) {
    printf("%-70s%5d\n", name, opens[name])
  }
}