DTrace受Centos / Fedora限制


8

我想在Centos 6机器上解决问题。我运行了dtrace,但失败了。它不接受-n-l-P或任何命令行选项。它声称只接受-h-G-C-I-s,和-o。我认为这一定是Centos有点奇怪,所以我去Fedora 22盒子上进行验证。同样的问题。它仅接受数量非常有限的命令行选项。我去尝试了一个Oracle机器,它非常像Red Hat,像Centos和Fedora一样。工作正常。我仅能运行dtrace并获得所有命令行选项的长长列表。我回到了Centos和Fedora。当我输入时dtrace,输出为Usage /bin/dtrace [--help] [-h | -G] [-C [-I<Path>]] -s File.d [-o <File>]。因此,经过一个小时的谷歌搜索,我放弃了。如何使dtrace在Centos / Fedora上正常工作?我已经以root用户和用户身份尝试过。我搜索了软件包以增加功能。我试着删除并重新安装dtrace。剩下的唯一事情就是删除软件包并从源代码安装dtrace。


在Oracle计算机上,运行类似的东西dtrace -n BEGIN(显示跟踪)。在Centos / Fedora机器上,出现“使用错误”,因为不支持-n。几乎不支持任何命令行选项。
kainaw

Answers:



4

dtrace非Oracle Linux发行版中附带的脚本是该systemtap项目中的一个小工具。它仅提供<sys/sdt.h>solaris dtrace 的相关对象/头文件构建功能。它将其映射到systemtap数据结构,因此stap -L 'process("a.out").mark("*")探针将列出检测。


3

现在您可以使用BPFtrace!

https://github.com/iovisor/bpftrace

BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for interacting with the Linux BPF system, as well as existing Linux tracing capabilities: kernel dynamic tracing (kprobes), user-level dynamic tracing (uprobes), and tracepoints. The BPFtrace language is inspired by awk and C, and predecessor tracers such as DTrace and SystemTap. BPFtrace was created by Alastair Robertson.

bpftrace探针类型

旧答案:

You can install the Linux port of Sun/Oracle dtrace from source here: https://github.com/dtrace4linux/linux

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.