【发布时间】:2017-07-24 21:42:07
【问题描述】:
我在我的应用程序中列出了探针:
sudo dtrace -p "$(pgrep run)" -ln 'pid$target:QtCore:*sendPostedEvents*:entry {}'
ID PROVIDER MODULE FUNCTION NAME
8037 pid53854 QtCore QCoreApplication::sendPostedEvents(QObject*, int) entry
8038 pid53854 QtCore QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) entry
我想跟踪函数QCoreApplication::sendPostedEvents(QObject*, int) 的入口探测。但是函数名称中有我无法在 dtrace 探测说明符中表达的字符。
例如,我不能只输入它而不以某种方式转义它(因为冒号在 DTrace 探测说明符中是有意义的):
sudo dtrace -p "$(pgrep run)" -n 'pid$target:QtCore:QCoreApplication::sendPostedEvents(QObject*, int):entry { ustack(3); }'
dtrace: invalid probe specifier pid$target:QtCore:QCoreApplication::sendPostedEvents(QObject*, int):entry { ustack(3); }: invalid probe description "pid$target:QtCore:QCoreApplication::sendPostedEvents(QObject*": Overspecified probe description
我试过用反斜杠、单引号、双引号转义。是否可以通过名称指定这个探测函数?
我不能使用通配符; *sendPostedEvents* 匹配 QCoreApplicationPrivate::sendPostedEvents,这是我不想要的。
我也怀疑我是否可以依赖探测 ID,因为这是 PID 提供程序(我希望探测 ID 在代码的后续编译中发生变化)。
【问题讨论】:
标签: dtrace