Systemtap is tool to probe or trace a running linux system, supporting visibility into both kernel- (its initial focus) and user-space. It uses dynamically loaded probes to gather performance and tracing data about the whole system or just selected processes.
Questions tagged [systemtap]
142 questions
1
vote
1 answer
sock_sendmsg(): implicit function calls by Kernel
I tried to dump all data sent by a specific process on Linux by hooking a handler to the Kernel's function sock_sendmsg() defined in linux/socket.c.
I could do that by writing a systemtap probe handler for probe…
user2875834
1
vote
1 answer
Systemtap, printing target's local vars and ellipsis
I'm running systemtap 2.2.1 on ubuntu 13.10 with kernel 3.11.0-generic.
The following script
probe begin {
printf("Started...\n")
}
probe kernel.function("netif_receive_skb") {
printf("%s\n",$skb$$);
exit();
}
prints the following…

jliendo
- 390
- 6
- 7
1
vote
0 answers
systemtap failure to find trace events on Ubuntu 3.2
systemtap fails to find trace events, even though all of them are available in directory:/sys/kernel/debug/tracing/events. Running "perf record sched" finds all the sched trace events without any issue.
System is running:
Linux (none)…

user2464401
- 17
- 4
1
vote
3 answers
SystemTap failed with error "WARNING: kbuild exited with status: 2"
I built a custom kernel 3.2-41, required kernel-debuginfo-common and kernel-debuginfo packages. I installed these packages on CentOS System with kernel 2.6.32-358. System booted fine with new kernel. I ran stap to list system calls and kernel…

user2464401
- 17
- 4
1
vote
0 answers
How to use stapdev and stapusr groups for SystemTap?
I have tried to add myself to stapdev and stapusr in order to run stap without sudo. I'm trying to run a simple example but getting an error as such:
$ groups
gokce adm cdrom sudo dip plugdev lpadmin sambashare stapdev stapusr
$ cat hello.stp
probe…

none
- 11,793
- 9
- 51
- 87
1
vote
1 answer
How can a SystemTap script determine the current thread count?
I want to write a SystemTap script that can determine the actual number of threads for the current PID inside a probe call. The number should be the same as shown in the output of /proc/4711/status in this moment.
My first approach was to count…

Peter Tröger
- 313
- 3
- 13
1
vote
2 answers
Compiling erlang with systemtap but require dtrace
I'm compiling erlang otp from source like following:
./configure --with-dynamic-trace=systemtap
But it reports error:
checking for dtrace... no
configure: error: No dtrace utility found.
I think systemtap is for linux usage and it is different…

goofansu
- 2,277
- 3
- 30
- 48
1
vote
1 answer
Problems with systemtap script
I wanna write a small script that identifies which function is using the mmap syscall:
#! /usr/bin/env stap
probe syscall.mmap.return {
if ( execname()=="java")
printf ("%s mmap caller\n", caller())
}
But it…

Roger J
- 11
- 1
1
vote
1 answer
Systemtap script to C code conversion and compilation
My semester project is a Network Level Anti-Malware S/W. It main components are the Manager and the Agent.
The Agent provides the Manager with:
1. CPU usage, Memory usage and B/W usage information
2. Network related Information -
Network…

Ananth
- 9
- 4
0
votes
1 answer
how to install SystemTap on Ubuntu
I am new to Ubuntu.
I follow the instruction from http://sourceware.org/systemtap/wiki/SystemtapOnUbuntu that is necessary to install SystemTap on Ubuntu.
I lost in Step 4.
How can i run step 4: ?
Setp 4: sudo apt-get install elfutils, for…

jeevan thapa
- 1
- 2
0
votes
0 answers
systemtap parse error: unexpected end-of-file
I run command
sudo stap -ve 'probe begin { log("hello world") exit() }'
and the output is
parse error: unexpected end-of-file
saw: keyword at :1:1
source: probe
^
1 parse error.
Pass 1: parsed user script and 490…

yiC
- 19
- 6
0
votes
0 answers
Error in cross-compiling systemtap for embedded Linux devices
I'm having trouble cross-compiling systemtap under ubuntu 18.04
Here are the compile-time errors
➜ systemtap-master ./configure --prefix=$PWD/_install --host=aarch64-linux-gnu --with-elfutils=/home/zhongyi/tools/elfutils-0.188 CXXFLAGS=-static…

Carlos
- 1
- 3
0
votes
0 answers
systemtap fails to determine souce filenames and line numbers, although gdb finds them
I am running systemtap 4.7 on Centos 8 with a 4.18 kernel and using GCC 8.5.0
When I have systemtap produce a user-code backtrace, it never manages to find the filenames and line numbers for my source functions, despite there being a full .debuginfo…

swestrup
- 4,079
- 3
- 22
- 33
0
votes
1 answer
How to retrieve and print the value of local a struct field in Systemtap without specifying line number?
I modified the kernel introducing a new socket option, as well as a new field in the sock struct. As of now, this works:
probe kernel.statement("sock_setsockopt@sock.c:730")
{
printf("%ul\n", $sk->sk_foo)
}
But as soon as I use regex:
probe…

Eric Gumba
- 435
- 3
- 16
0
votes
0 answers
semantic error: unresolved target-symbol expression: identifier '$filename'
I'm trying to follow some simple examples like this one here:
probe syscall.open.return {
filename = user_string($filename)
if (execname() != "yakuake"){
printf("%s(%d) open (%s)\n", execname(),pid(),filename)
}
}
That I've found in the…

Fernando
- 1,477
- 2
- 14
- 33