(originally published on 01.04.2019, reviewed/rewritten on 30.03.2025, tested on Oracle Solaris 11.4 SRU 79)
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:::write
{
@[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@testbed:~# dtrace -s writeops
dtrace: script 'writeops' matched 1 probe
In a second terminal window I 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