Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Dtrace已修补,但仍然得到;无效的探测说明符";运行测试脚本_Python_Osx Mountain Lion_Cpython_Dtrace_Probe - Fatal编程技术网

Python Dtrace已修补,但仍然得到;无效的探测说明符";运行测试脚本

Python Dtrace已修补,但仍然得到;无效的探测说明符";运行测试脚本,python,osx-mountain-lion,cpython,dtrace,probe,Python,Osx Mountain Lion,Cpython,Dtrace,Probe,我用补丁修补了Python 2.7.3,然后用dtrace配置选项编译了Python 当我运行test\u dtrace脚本时,测试失败,出现以下错误: 无效的探测说明符 如下图所示: ====================================================================== FAIL: test_function_entry_return (test_dtrace.DTraceTestsNormal) ---------------------

我用补丁修补了Python 2.7.3,然后用dtrace配置选项编译了Python

当我运行test\u dtrace脚本时,测试失败,出现以下错误:

无效的探测说明符

如下图所示:

======================================================================
FAIL: test_function_entry_return (test_dtrace.DTraceTestsNormal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_dtrace.py", line 99, in test_function_entry_return
    self.assertEqual(actual_result, expected_result)
AssertionError: 'dtrace: invalid probe specifier python*$target:::function-entry{    printf("Function entry %d ", timestamp);}python*$target:::function-entry,python*$target:::function-return{    printf("%d\t**%s*%s*%s*%d\\n", timestamp,        probename, copyinstr(arg0),        copyinstr(arg1), arg2);}python*$target:::function-return/(copyinstr(arg0)=="/Users/ramandeep/src/src/Python-2.7.3/dtrace_sample.py") &&(copyinstr(arg1)=="test_entry_return_and_stack")/{    self->trace = 0;}: probe description python*36447:::function-entry does not match any probes' !=  ...

探头需要一些变通方法:

dtrace不支持PATH变量,这相当令人恼火,当您在/usr/lib/libdtrace.dylib上运行strings命令时,您将看到它对gcc的使用进行了硬编码(甚至不是cpp或clang)

应用修补程序后是否运行了autoconf或autoreconf?如果没有,, @DTRACEOBJS@将不是可替换的字符串。这是相当普遍的 至少在Python社区中是这样),从这些脚本中省略修改过的configure脚本 由于对生成的配置脚本所做的更改 不同版本的autoconf如此庞大,以至于使实际应用相形见绌 斑块的功能变化,通常是几个数量级

将这一节添加到phelper.d的顶部将获得通过 标题中的问题:

#苹果__ #定义系统时间_ #定义系统选择_ #定义数学__ #定义操作系统操作字节顺序 #定义_FD_集 #定义GNUC VA列表 #endif/*.\uu苹果公司*/ 还有一个项目需要添加,这可能会有所帮助

参考资料

#ifdef __APPLE__ #define _SYS_TIME_H_ #define _SYS_SELECT_H_ #define __MATH_H__ #define _OS__OSBYTEORDER_H #define _FD_SET #define __GNUC_VA_LIST #endif /* __APPLE__ */