问题标签 [systemtap]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
197 浏览

semantics - Linux 上的 Systemtap libdwfl 错误

我正在尝试在虚拟 Linux 上工作/设置用于分析操作系统进程的 Systemtap 工具。我正在使用 VirtualBox 来运行图像。通过

得到的版本是:

我已经正确下载并安装了该工具并编写了一个简单的程序(.stp)。但是我一直收到同样的错误,我在很多地方搜索了信息但没有成功:

执行后:

我得到:

根据https://sourceware.org/systemtap/SystemTap_Beginners_Guide/errors.html

⁠语义错误:libdwfl failure 处理调试信息时出现问题。在大多数情况下,此错误是由于安装了内核调试信息包,其版本与所探测的内核不完全匹配。安装的 kernel-debuginfo 包本身可能存在一些一致性或正确性问题。

我没有找到关于“kernel-debuginfo”包的相关信息。我也尝试过没有好处的详细选项。我什至尝试使用 VM 的旧快照。有任何想法吗?

我运行的 .stp 程序的代码:

0 投票
1 回答
252 浏览

linux - 如何为用户空间应用程序交叉编译系统点击脚本

我面临的挑战是在脚本中识别进程名称/库名称。在交叉编译期间,进程名称和库名称与主机中进程/库的真实路径(我在查看生成的 . ko)。

由于主机和目标的真实路径不同,交叉编译的检测不起作用。

0 投票
1 回答
717 浏览

linux - 如何使用 SystemTap 探测在 VFS 上打开和关闭的文件

我看到了使用 SystemTap 脚本的示例probe syscall.open.return { } 但是有一些应用程序没有调用 systemcall 那么我如何探测在 VFS 上打开的文件

0 投票
1 回答
260 浏览

rhel5 - 为什么 systemtap 不生成创建火焰图所需的输出?

在为生成火焰图数据而执行 stap 时,为什么我的 out.stap-stacks 缺少过程数据?

  • 操作系统:RHEL 5.10.0.2
  • 内核:2.6.18-371.11.1.el5
  • SystemTap:1.8-6.el5

安装的软件包:

systemtap-sdt-devel-1.8-6.el5

systemtap-devel-1.8-6.el5

systemtap-devel-1.8-6.el5

systemtap-runtime-1.8-6.el5

systemtap-sdt-devel-1.8-6.el5

systemtap-1.8-6.el5

systemtap-initscript-1.8-6.el5

systemtap-client-1.8-6.el5

systemtap-server-1.8-6.el5

systemtap-testsuite-1.8-6.el5

内核开发-2.6.18-371.11.1.el5

内核调试开发-2.6.18-371.11.1.el5

使用的命令:

示例 out.stap-stacks 文件:

0xffffffff8000e81a 0x0 1 0xffffffff8004ab87 0x0 1 0xffffffff8025d15d 0x0 1 0xffffffff80239356 0x0 1 0xffffffff8004219a 0x0 1 0xffffffff8000ca32 0x0 1 0xffffffff8003214e 0x0 1 0xffffffff80013bc8 0x0 1 0xffffffff80232d41 0x0 1 0xffffffff8001a4ca 0x0 1 0xffffffff80011db5 0x0 1 0xffffffff8004aad2 0x0 1 0xffffffff800ec8bb 0x0 1 0xffffffff8003ead5 0x0 1 0xffffffff80234c43 0x0

0 投票
1 回答
575 浏览

linux - systemtap:如何确定探测事件和参数

我试图找出这些写入我的闪存驱动器的原因。

我跑了:

性能记录 -g -a

接着

性能报告 -s comm

要得到

我现在如何使用:systemtap中的ext4_bio_write_page打印各种参数。我什至如何确定可能的参数是什么?我想做类似的事情:

并提取一些有趣的东西,比如 buffer_size 或 file_name - 我不知道具体是什么(我想一一浏览这些函数并查看它们的签名)。

[请注意我对此完全陌生,所以我可能犯了一些非常愚蠢的错误]

0 投票
1 回答
840 浏览

systemtap - 如何使用 systemtap 访问用户空间探测的返回值

我想访问从 glibc 的“打开”函数返回的数据,例如文件名或文件描述符

我试试

但它错误

语义错误:未解析的目标符号表达式:malloc.stp:3:10 处的标识符 '$fd' 源:fd = $fd ^

Pass 2:分析失败。[人错误::pass2]

0 投票
1 回答
91 浏览

linux - 如何理解 pid() 和 new_pid 在执行 forktracker.stp 时的值相同?

我正在使用forktracker.stp来跟踪fork流程。脚本是这样的:

执行脚本,我发现它输出以下结果:

我不明白为什么pid()并且new_pid具有相同的价值。我怀疑它是否与“fork调用一次,返回两次”有关。所以我写了一个简单的程序来测试:

跟踪这个程序,脚本输出:

所以它似乎与“fork调用一次,返回两次”无关。

我如何理解pid()andnew_pid是相同的值?

0 投票
1 回答
1143 浏览

function - systemtap 用户空间函数跟踪

我有一个简单的 C++ 程序

主文件

我想为此生成函数跟踪 - 打印函数名称及其输入输出和返回类型

我的 systemtap 脚本:para-callgraph.stp

我的 C++ Exec 被称为:a(编译为 g++ -g main.cpp)

这里 ->addition a=0x0 b=0x400895 :它的地址而不是实际值,即我想要的 5、3。

0 投票
1 回答
605 浏览

systemtap - systemtap : 能够访问局部变量但不能访问局部指针

我有一个愚蠢的问题,我想在 system tap 的帮助下理解源代码流,为此我试图使用 kernel.statement 探测函数访问局部变量,它显示除指针之外的所有其他变量。

当我执行上面的 stap 代码时,它返回,

本地=pid=0xf98 ret=0x0 task_local=? 我=?

任何有助于理解为什么不打印 task_local 和 i 值的帮助都会有所帮助。

问候,亚什。

0 投票
1 回答
378 浏览

systemtap - How to do user-space probing using debug info in systemtap

I am new to systemtap and would like to understand how to attach instrumentation dynamically to a production application using debug information in the application.

For a target application (example apache webserver). I would like to find the amount of time spent in the execution of a given function. i.e. i'd like to find time spent from beginning to end of a function, using the function's symbolic information. How can I do this using systemtap- Can you please give the instructions on:

  1. A tapset script for user-space probing using debug information
  2. How to execute this tapset script with a target application.

In particular I would like to find out how I can use the - Debuginfo-based instrumentation for user space tracing.

Here is the reference for "Debuginfo-based information" - https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps