Questions tagged [systemtap]

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.

142 questions
2
votes
1 answer

Systemtap - Calling a syscall from kernel space

I'm trying to create a hard link, calling sys_link directly from a Systemtap Embedded C code. Basically, the code looks like: function sys_link:long(oldname, newname) %{ /* pure */ int error; mm_segment_t old_fs; old_fs = get_fs(); …
Tavo
  • 181
  • 1
  • 7
2
votes
1 answer

Printing arguments to a kernel function in dtrace

I need to debug my Solaris kernel module particularly extract the data in a structure passed by reference to my kernel function. msg_recv(sk_buff *skbp, uint_t link, uchar_t* src) { pkt_hdr_t *pkt; pkt = (pkt_hdr_t *)skbp->data; port =…
Haswell
  • 1,573
  • 1
  • 18
  • 45
2
votes
0 answers

Calculating CPU utilization with SystemTap

I'd like to obtain CPU utilization (%us, %sy, %id, %wa) using SystemTap. I wrote a script that uses timer.profile probe and counts processor ticks: #! /usr/bin/env stap probe timer.profile { # probe perf.sw.cpu_clock { if (!user_mode()) { if…
adgud
  • 21
  • 4
2
votes
1 answer

Get new pid from nd_syscall.vfork.return in systemtap

I'm trying to extract things from a weird makefile, and I found that systemtap is a potential good solution so here I am: I can get correct pid() ppid() called from the new process when probing with nd_syscall.clone.return, however this doesn't…
tdihp
  • 2,329
  • 2
  • 23
  • 40
2
votes
2 answers

How to monitor which files consumes iops?

I need to understand which files consumes iops of my hard disc. Just using "strace" will not solve my problem. I want to know, which files are really written to disc, not to page cache. I tried to use "systemtap", but I cannot understand how to find…
BHYCHIK
  • 108
  • 9
2
votes
1 answer

How to avoid a "probe overhead exceeded threshold" error when using system tap?

I'm trying to using stap to just print out all the functions that a program calls. I did some research online and found this script (called para-callgraph.stp): #! /usr/bin/env stap function trace(entry_p, extra) { printf("%s%s%s %s\n", …
Others
  • 2,876
  • 2
  • 30
  • 52
2
votes
1 answer

SystemTap Inter process communication

I am considering using SystemTap for monitoring FileSystem activities on a production server. How can I transfer data from the kernel module that SystemTap generates to another application? I only saw printf as a way of outputting data from…
yoni
  • 96
  • 1
  • 6
2
votes
1 answer

systemtap userspace function tracing

I have a simple c++ program main.cpp #include using namespace std; int addition (int a, int b) { int r; r=a+b; return r; } int main () { int z; z = addition (5,3); cout << "The result is " << z; } I want to generate the…
Step
  • 307
  • 3
  • 11
2
votes
1 answer

How to access return value from user-space probing with systemtap

I want to access data that return from "open" function of glibc such as filename or file descriptor I try probe process("/lib*/libc.so.*").function("open") { fd = $fd filename = user_string($filename) printf("%d %d %s…
SilverIce
  • 75
  • 1
  • 13
2
votes
1 answer

SystemTap script to analyze the cache behavior of functions

I would like to profile the cache behavior of a kernel module with SystemTap (#cache references, #cache misses, etc). There is an example script online which shows how SystemTap can be used to read the perf events and counters, including…
soofyaan
  • 299
  • 3
  • 12
2
votes
1 answer

SystemTap script to profile latency of functions

My goal is to profile the execution time of each function in a kernel module. Using the sample scripts I saw online, I came up with the following script to fulfill my need. But occasionally I get negative values for calculated latencies. Although,…
2
votes
1 answer

linux systemtap register error

I use systematap to probe slab memory allocation activity. #! /usr/bin/env stap global slabs probe vm.kmem_cache_alloc { slabs [execname(), bytes_req]<<<1 } probe timer.ms(10000) { dummy = ""; foreach ([name, bytes] in slabs) { …
Chinaxing
  • 8,054
  • 4
  • 28
  • 36
2
votes
2 answers

get size of target array in systemtap

In an answer on a sister site, I'm trying to dump information from the Linux kernel array unix_socket_table@net/unix/af_unix.c which is defined as: struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE]; For the moment, I'm hard-coding the size of…
Stephane Chazelas
  • 5,859
  • 2
  • 34
  • 31
2
votes
1 answer

Android Systemtap can not load module

I am trying to load a simple Systemtap module on my GT-i9300 I get the error Error inserting module '/sdcard/systemtap/modules/monitor_fopen.ko': Unknown symbol in module Steps that I took: 1. Get root on the device I did this by installing…
JoachimR
  • 5,150
  • 7
  • 45
  • 50
2
votes
2 answers

Systemtap for java on ubuntu

I'd like, not only to trace the java process, but use the new support for openjdk tracing in systemtap, both the hotspot tracing and the method tracing. Accordingly i installed the ddebs.ubuntu.com repository to install the kernel debuging symbols -…
i30817
  • 1,356
  • 2
  • 13
  • 26
1 2
3
9 10