Written by J. Moellenkamp
on
Reading time: 1 minute
on
Reading time: 1 minute
fileops provider in DTrace
Solaris 11.4 got a new fileops
provider. This provider is independent from the filesystem you are using. So you can easily trace filesystem accesses with it. For example so see all filenames of accesses on your system, you can just use such a short script
fileops:::read
{
@[args[0]->fi_name] =
quantize(args[1]);
}
I have saved this script into a file called writeops
. The script should show me write latencies for each file i’m writing to.
root@batou:~# dtrace -s writeops
dtrace: script 'writeops' matched 1 probe
In a second window i just started a echo "test" > narf
. After terminating the dtrace command, it yielded the following result:
^C
narf
value ------------- Distribution ------------- count
8192 | 0
16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
32768 | 0
Do you want to learn more?
docs.oracle.com - Oracle® Solaris 11.4 DTrace (Dynamic Tracing) Guide - fileops Provider