2.7.2 Example: Counting the Number of read() and write() System Calls

The following example counts the number of both read() and write() system calls.

# dtrace -n 'syscall::write:entry,syscall::read:entry { @[strjoin(probefunc,"() calls")] = count(); }' 
dtrace: description 'syscall::write:entry,syscall::read:entry' matched 2 probes
^C

  write() calls                                            150
  read() calls                                            1555