linux - 通过 ebpf begin 探测使用 systemtap 探测用户空间进程不起作用
问题描述
我正在尝试使用begin
似乎没有做任何事情的探测器来探测用户空间进程
开始.stp:
probe process("a.out").begin {
printf("%s %d\n", execname(), pid())
}
stp输出:
[root@RHEL8 ~]# stap --bpf -v ~/begin.stp
Pass 1: parsed user script and 56 library scripts using 203356virt/48420res/12256shr/36024data kb, in 100usr/10sys/114real ms.
Pass 2: analyzed script: 2 probes, 3 functions, 0 embeds, 1 global using 204676virt/50128res/12392shr/37344data kb, in 10usr/10sys/11real ms.
Pass 3: pass skipped for stapbpf runtime in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_30984.bo" in 0usr/0sys/2real ms.
Pass 5: starting run.
将探针更改为main()
功能时,它似乎可以工作:
函数.stp
probe process("a.out").function("main") {
printf("%s %d\n", execname(), pid())
}
阶段输出:
[root@RHEL8 ~]# stap --bpf -v ~/222.stp
Pass 1: parsed user script and 56 library scripts using 203356virt/48364res/12200shr/36024data kb, in 290usr/50sys/404real ms.
Pass 2: analyzed script: 2 probes, 3 functions, 0 embeds, 1 global using 204676virt/50996res/13068shr/37344data kb, in 20usr/0sys/25real ms.
Pass 3: pass skipped for stapbpf runtime in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_31782.bo" in 0usr/0sys/3real ms.
Pass 5: starting run.
a.out 31806
a.out 31821
a.out 31827
a.out 31831
版本
[root@RHEL8 ~]# stap --version
Systemtap translator/driver (version 4.2/0.178, rpm 4.2-6.el8)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.4-rc6
enabled features: AVAHI BOOST_STRING_REF DYNINST BPF JAVA PYTHON3 LIBRPM LIBSQLITE3 LIBVIRT LIBXML2 NLS NSS READLINE
解决方案
推荐阅读
- python - 张量流中的内存泄漏问题
- java - Apache Beam KinesisIO Java 处理管道 - 应用程序状态、错误处理和容错?
- javascript - 为什么它显示错误:CastError: Cast to ObjectId failed for value "$this.categoryId" at path "category" for model "Product"?
- python - 如何将邮递员的不记名令牌读入 Python 代码?
- java - Jar 文件不在目标文件夹中工作,但在项目文件夹中工作
- c# - 文本字段中的防御者成本未显示
- java - 有没有办法在横向模式下将片段内的布局固定为纵向?
- visual-studio-2019 - Uno 平台:设计不显示
- javascript - 角度路由混淆/奇怪的行为
- sql - 检查一列是否有 1-100 作为值的 case 语句