1

我正在尝试按进程获取写入大小分布。我跑了:

sudo dtrace -n 'sysinfo:::writech { @dist[execname] = quantize(arg0); }' 

并得到以下错误:

dtrace: invalid probe specifier sysinfo:::writech...

这是Mac OSX。请帮忙。

4

1 回答 1

0

错误消息告诉您 Mac OS X 不支持该sysinfo:::提供程序。也许您打算使用其中之一?

# dtrace -ln sysinfo::writech:
   ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match sysinfo::writech:: No probe matches description
# dtrace -ln sysinfo:::
   ID   PROVIDER            MODULE                          FUNCTION NAME
dtrace: failed to match sysinfo:::: No probe matches description
# dtrace -ln 'syscall::write*:'
   ID   PROVIDER            MODULE                          FUNCTION NAME
  147    syscall                                               write entry
  148    syscall                                               write return
  381    syscall                                              writev entry
  382    syscall                                              writev return
  933    syscall                                      write_nocancel entry
  934    syscall                                      write_nocancel return
  963    syscall                                     writev_nocancel entry
  964    syscall                                     writev_nocancel return

以下脚本适用于我:

# dtrace -n 'syscall::write:entry {@dist[execname] = quantize(arg0)}' 
dtrace: description 'syscall::write:entry ' matched 1 probe
^C

  activitymonitor                                   
           value  ------------- Distribution ------------- count    
               2 |                                         0        
               4 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4        
               8 |                                         0        

  Activity Monito                                   
           value  ------------- Distribution ------------- count    
               2 |                                         0        
               4 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6        
               8 |                                         0        
... 
于 2013-05-21T22:25:08.017 回答