- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试使用 systemtap 调试内核中的一些代码。我需要在该函数中打印局部变量的值,但看起来 systemtap 只能看到函数参数,而看不到该函数中定义的局部变量。这是我的探测脚本。
probe kernel.function("tcp_write_xmit") {
if( execname() == "bw_client"){
printf(
"tcp_write_xmit skb len %d\n",
$skb
);
}
}
当我运行它时,出现以下错误
semantic error: failed to retrieve location attribute for 'skb'
[man error::dwarf] (dieoffset: 0x5bd30b4): identifier
'$skb' at /home/cca-user/systaptest/txprobe.stp:37:6
source: $skb
^
Pass 2: analysis failed. [man error::pass2]
然而函数tcp_write_xmit
显然有skb
使用 -L
选项打印可用变量给我 5 个变量,它们是函数参数,但没有看到任何局部变量。
root@i-sahmed-node2: /mnt/linux-3.13.0 # stap -L
'kernel.function("tcp_write_xmit")'
kernel.function("tcp_write_xmit@/build/buildd/linux-3.13.0/net/ipv4
/tcp_output.c:1832") $sk:struct sock* $mss_now:unsigned int $nonagle:int
$push_one:int $gfp:gfp_t
这是我正在运行的内核和systemtap版本
root@i-sahmed-node2: /mnt/linux-3.13.0 # stap --version
Systemtap translator/driver (version 2.3/0.158, Debian version 2.3-1ubuntu1 (trusty))
Copyright (C) 2005-2013 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBSQLITE3 NSS TR1_UNORDERED_MAP NLS
root@i-sahmed-node2: /mnt/linux-3.13.0 # uname -a
Linux i-sahmed-node2 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
有什么想法吗?
最佳答案
您正在使用.function 探针。在此探测器中,只有传递给函数的参数是可见的。如果您需要检查局部变量,则需要使用 .statement 探针。
关于linux - Systemtap 不显示内核函数中的所有局部变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31031651/
好吧,我正尝试在 SDT 标记上探索我自己的应用程序。我写了一个 systemtap 脚本来探测它,但是 systemtap 在第 5 次之前没有显示任何错误,然后在第 5 次(开始运行)之后,它就什
我想访问从 glibc 的“打开”函数返回的数据,例如文件名或文件描述符 我试试 probe process("/lib*/libc.so.*").function("open") { fd =
我想访问从 glibc 的“打开”函数返回的数据,例如文件名或文件描述符 我试试 probe process("/lib*/libc.so.*").function("open") { fd =
以下 systemtap 脚本无法编译: probe process("myexe").function("myFun").return { print("hi mom\n") } 它说: seman
我正在尝试在我的 GT-i9300 上加载一个简单的 Systemtap 模块 我得到了错误 Error inserting module '/sdcard/systemtap/modules/mon
我想知道如何在 systemtap 中添加对用户空间应用程序的支持。当我尝试跟踪任何用户空间程序时,它显示 CONFIG_UTRACE 未设置。 最佳答案 也许您的内核中没有设置 utrace 工具。
我正在尝试执行一个 systemtap 脚本。但是在执行过程中我遇到了以下语义错误。 stap -v -g netfilter.stp Pass 1: parsed user script and 9
我正在尝试找出这些写入我的闪存驱动器的原因。 deathstar> while true > do > dmesg|grep sdc|grep WRITE > sleep 3 > done [1796
我正在考虑使用 SystemTap 来监控生产服务器上的文件系统事件。 如何将数据从 SystemTap 生成的内核模块传输到另一个应用程序?我只看到 printf 作为从 SystemTap 脚本输
我有一个简单的 ST 脚本,它计算每个文件的进程 io 大小: global fds, counts probe syscall.open.return { if ( ( pid()
我想使用 systemtap 来提取我的 linux 生产服务器的详细信息。我的 systemtap 脚本是 global bt; global quit = 0 probe begin {
我想编写一个 SystemTap 脚本,它可以确定探测调用中当前 PID 的实际线程数。此时该数字应与/proc/4711/status 输出中显示的数字相同。 我的第一个方法是计算 kprocess
我正在尝试使用 systemtap 调试内核中的一些代码。我需要在该函数中打印局部变量的值,但看起来 systemtap 只能看到函数参数,而看不到该函数中定义的局部变量。这是我的探测脚本。 prob
我正在尝试创建硬链接(hard link),直接从 Systemtap 嵌入式 C 代码调用 sys_link。基本上,代码如下所示: function sys_link:long(oldname,
我正在寻找一些关于 systemtap 对性能影响的真实信息。我知道静态内核探测记录在他们网站的某处(带有统计信息),但是用户空间探测呢? 我在他们的邮件列表 (http://sourceware.o
我的系统是 Ubuntu,uname -r = 4.15.0-23-generic。我已经为内核安装了调试符号。 我的问题是: I am trying to use socket(AF_PACKET,
我想使用 systemtap 从远程访问中提取我的 linux 生产服务器的详细信息。对此,我有一些疑问: linux生产服务器和linux开发服务器是否有必要使用相同的内核。如果没有,那么如何添加对
我正在尝试运行此脚本,但它显示没有 tcp 连接有什么想法吗?操作系统:centos 6.3 #! /usr/bin/env stap probe begin { printf("%6s %16s
我想用 SystemTap 分析内核模块的缓存行为(#cache 引用、#cache 未命中等)。有一个在线示例脚本,展示了如何使用 SystemTap 读取性能事件和计数器,包括与缓存相关的事件和计
我的目标是分析内核模块中每个函数的执行时间。使用我在网上看到的示例脚本,我想出了以下脚本来满足我的需要。但偶尔我会得到计算延迟的负值。虽然,它们很少发生,但我想这表明我的脚本有问题。谁能帮我解决这个问
我是一名优秀的程序员,十分优秀!