1 Reply Latest reply: Jun 2, 2010 11:32 AM by 807559 RSS

    Dtrace script to capture time spent executing shell commands

    807559
      Hi all,

      My 1st dtrace script to capture time spent by oracle executing various commands, is this correct? It seems to work...

      #!/usr/bin/sh

      /usr/sbin/dtrace -n '

      #pragma D option quiet
      #pragma D option switchrate=10

      syscall::exec:entry, syscall::exece:entry
      /uid == 900/
      {
      self->t = timestamp;
      }

      syscall::exec:return, syscall::exece:return
      /uid == 900/
      {
      printf("%-20d %s\n", (timestamp - self->t), curpsinfo->pr_psargs);
      }
      '
      thanks for any feedback.

      Regards

      Stuart