Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 935aec4bcb8b81ba3e515daef9c46f5d820d8f71 (plain) (blame)
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
31
32
<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>

<h2>
Example Graphing Scripts
</h2>

Provided below are a few scripts that you can use with the Graphing Perspective.<br><br>

<b>readwrite.stp</b><br><br>

<i>Counts the reads and writes that occur and provide this information once per second.</i><br><br>

<pre>
global read, write, startasdfasdf

probe begin {
   start = gettimeofday_s()
}
probe syscall.write {
   write += count
}

probe syscall.read {
   read += count
}

probe timer.ms(1000) {
   printf("%d\t%d\t%d\n", (gettimeofday_s()-start), read, write)
   read=0
   write=0
}
</pre>

Back to the top