Filesystem Activity

DTrace and OpenSolaris have made it so easy to find out what the kernel is up. I wanted to know how much activity the filesystem was doing with afew different workloads. I spotted Joh's script and poked around opensolaris source browser to find the filesystem flush counters to understand what the counters mean and put together this script. The whole problem solved in 30 minutes :)

#!/usr/sbin/dtrace -s

#pragma D option quiet

BEGIN

{

printf("%10s %10s %10s %10s %10s %10s %10s\\n", "SCANNED", "EXAMINED",

"LOCKED", "MODIFIED", "COALESCE", "RELEASES", "TIME(ns)");

lexam = `fsf_total.fsf_examined;

lscan = `fsf_total.fsf_scan;

llock = `fsf_total.fsf_locked;

lmod = `fsf_total.fsf_modified;

lcoal = `fsf_total.fsf_coalesce;

ltime = `fsf_total.fsf_time;

lrel = `fsf_total.fsf_releases;

}

tick-1s

{

printf("%10d %10d %10d %10d %10d %10d %10d\\n", `fsf_total.fsf_scan - lscan,

`fsf_total.fsf_examined - lexam, `fsf_total.fsf_locked - llock,

`fsf_total.fsf_modified - lmod, `fsf_total.fsf_coalesce - lcoal,

`fsf_total.fsf_releases - lrel, `fsf_total.fsf_time - ltime);

lexam = `fsf_total.fsf_examined;

lscan = `fsf_total.fsf_scan;

llock = `fsf_total.fsf_locked;

lmod = `fsf_total.fsf_modified;

lcoal = `fsf_total.fsf_coalesce;

lrel = `fsf_total.fsf_releases;

ltime = `fsf_total.fsf_time;

}

Technorati Tag: OpenSolaris Solaris DTrace
Comments:

Post a Comment:
Comments are closed for this entry.
About

rmd

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today