szaydel
5/16/2018 - 12:40 PM

Dtrace ARC access type snippets

Snippets used for identifying type of requests into the ARC, i.e. Demand v. Prefetch accesses.

dtrace -qn '
  BEGIN {
    printf("timestamp,pool,type,count\n");
    ts = walltimestamp - (walltimestamp % 1000000000) ;
  }
  ::arc_read:entry {
    this->checkPref = (*args[7] & (1<<5));
    this->pd = this->checkPref == 0x20 ? "Prefetch" : "Demand";
    this->spa = args[1];
    @c[ ts, this->spa->spa_name != NULL ? 
            this->spa->spa_name : "NA", this->pd ] = count();
}
  tick-5sec {
    printa("%d,%s,%s,%@d\n", @c); trunc(@c);
    ts = walltimestamp - (walltimestamp % 1000000000) ;
  }'