Skip to content

Instantly share code, notes, and snippets.

@bcantrill
Created June 1, 2012 23:36
Show Gist options
  • Save bcantrill/625838686e8dacb0f15c to your computer and use it in GitHub Desktop.
Save bcantrill/625838686e8dacb0f15c to your computer and use it in GitHub Desktop.
Using fds[] in the non-global zone
[root@d267a0e1-1a9c-4d2e-97ab-ec7683c1504d (coal:0) ~]# zoneadm list
d267a0e1-1a9c-4d2e-97ab-ec7683c1504d
[root@d267a0e1-1a9c-4d2e-97ab-ec7683c1504d (coal:0) ~]# dtrace -n syscall::read\*:entry'{@[fds[arg0].fi_pathname] = count()}'
dtrace: description 'syscall::read*:entry' matched 4 probes
^C
/.dcinfo 1
/dev/pts/4 1
/etc/default/init 1
/etc/passwd 1
/etc/profile 1
/etc/ttysrch 1
/proc/10497/psinfo 1
/proc/10498/psinfo 1
/proc/10499/psinfo 1
/proc/10501/psinfo 1
/root/.bash_profile 1
/root/.bashrc 1
/root/.profile 1
/usr/share/lib/zoneinfo/UTC 1
/etc/default/nss 2
/etc/group 2
/etc/logindevperm 2
/etc/nsswitch.conf 2
/etc/shadow 2
/usr/share/lib/terminfo/x/xterm-color 2
/var/adm/lastlog 2
/var/run/initpipe 2
<unknown> 2
/var/adm/utmpx 3
/etc/inittab 4
/etc/security/audit_class 4
/etc/security/policy.conf 8
/etc/default/login 28
[root@d267a0e1-1a9c-4d2e-97ab-ec7683c1504d (coal:0) ~]#
@brendangregg
Copy link

Awesome. I can't wait to run dtrace -n 'syscall::read*:entry { @[fds[arg0].fi_pathname] = count(); }' inside a zone.

@bcantrill
Copy link
Author

FWIW, "dtrace -n 'BEGIN'" has always worked inside a zone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment