我有以下错误:如何修复启用的探针错误:无效地址(0x0)?
dtrace: error on enabled probe ID 3 (ID 7343: php15810:php:dtrace_execute_ex:function-return): invalid address (0x0) in action #2 at DIF offset 24
当我试图跟踪我的PHP脚本(sudo ./trace-php.d
)。
基本上我想实现的是通过PHP函数显示分配时间/计数。它似乎工作,但我很烦恼这个错误。我知道我可以发送到/dev/null
,但我想理解并修复它。
这里是我的DTrace代码:
#!/usr/sbin/dtrace -Zs
#pragma D option quiet
php*:::function-entry
{
self->vts = timestamp;
self->cmd = arg0
}
php*:::function-return
/self->vts/
{
@time[copyinstr(self->cmd)] = quantize(timestamp - self->vts);
@num = count();
self->vts = 0;
self->cmd = 0;
}
profile:::tick-2s
{
printf("\nPHP commands/second total: ");
printa("%@d; commands latency (ns) by pid & cmd:", @num);
printa(@time);
clear(@time);
clear(@num);
}
样本输出(在运行一些PHP脚本时)是:
dtrace: error on enabled probe ID 3 (ID 7343: php15810:php:dtrace_execute_ex:function-return): invalid address (0x0) in action #2 at DIF offset 24
dtrace: error on enabled probe ID 3 (ID 7343: php15810:php:dtrace_execute_ex:function-return): invalid address (0x0) in action #2 at DIF offset 24
dtrace: error on enabled probe ID 3 (ID 7343: php15810:php:dtrace_execute_ex:function-return): invalid address (0x0) in action #2 at DIF offset 24
dtrace: error on enabled probe ID 3 (ID 7343: php15810:php:dtrace_execute_ex:function-return): invalid address (0x0) in action #2 at DIF offset 24
PHP commands/second total: 1549; commands latency (ns) by pid & cmd:
variable_get
value ------------- Distribution ------------- count
1024 | 0
2048 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 4
4096 |@@@@@@@ 1
8192 |@@@@@@@ 1
16384 | 0
__construct
value ------------- Distribution ------------- count
1024 | 0
2048 |@@@@@@@@@@@@@@@@@@@@ 3
4096 |@@@@@@@@@@@@@ 2
8192 |@@@@@@@ 1
16384 | 0
features_array_diff_assoc_recursive
value ------------- Distribution ------------- count
16384 | 0
32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
65536 | 0
features_export_info
value ------------- Distribution ------------- count
2048 | 0
4096 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 122
8192 |@@@@@@ 23
16384 |@ 4
32768 | 0
'arg0'曾经'NULL'? –
这是[function_name](http://php.net/manual/en/features.dtrace.dtrace.php),所以我不确定。 – kenorb
它看起来*不应该*为'NULL' ...是否有可能,当你使'copyinstr()'调用它变得无效? –