Questions tagged [strace]

strace is a Linux/UNIX tool for logging and analysing the system calls made by a user-side process.

strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as .

Use this tag to ask programming questions related to the strace command and the strace() system call.

Source: Wikipedia

485 questions
0
votes
1 answer

Unix strace command

I found the following bash script in order to monitor cp progress. #!/bin/sh cp_p() { strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | awk '{ count += $NF if (count % 10 == 0) { percent = count / total_size…
Albinoswordfish
  • 1,949
  • 7
  • 34
  • 50
0
votes
1 answer

Uid issues between two applications for the 'strace' command

I'm going to use the strace -p command between two applications. However, strace command does not work with other applications (it works well for itself). This is the error message: attach: ptrace(PTRACE_ATTACH, ...): Operation not…
김진헌
  • 51
  • 7
0
votes
0 answers

Getting unexpected results applying strace to a multithreaded Java process

I need to strace a multithreaded Java process that seems to have frozen. Following this advice, I ran ps -efL|grep to get all the threads. However, when I then ran strace -fp -s 2000 I again got a bunch of lines like…
I Z
  • 5,719
  • 19
  • 53
  • 100
0
votes
1 answer

Setbuf function in C

Program 1: #include void main() { printf("Hello\n"); } Output: $strace ./a.out ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 fstat64(0, {st_mode=S_IFCHR|0620,…
mohangraj
  • 9,842
  • 19
  • 59
  • 94
0
votes
1 answer

Is there any solution to distinguish read or write in Ubuntu mmap?

I'm studying Linux programming, and I have a question about mmap. I'd like to look more detail at a process, by using strace. i've done with it, and I saw a system call called mmap. But I couldn't see any flag or other clue whether it was mapped…
youngsun
  • 63
  • 7
0
votes
0 answers

How do I prevent task/process name from being trimmed in Systrace or atrace kernel log output?

How do I ensure the task name/process name in kernel log outputs from Systrace/atrace don't get trimmed or cut off? I want to see the whole name of the task/process name without it get shortened. Below is an example of Systrace output without the…
Zythyr
  • 1,142
  • 4
  • 20
  • 33
0
votes
1 answer

Why does open() fails every time with EAGAIN?

Why would a program like Apache fail to open a plain file? Running it under strace shows: open("access.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = 11 11 stands for either EAGAIN or EWOULDBLOCK Where: $ ls -l access.log -rw-rw-rw- 1 root root…
sanmai
  • 29,083
  • 12
  • 64
  • 76
0
votes
2 answers

using strace with mpiexec

How do I strace all processes of MPI parallel job, started with mpiexec (MPICH2, linux)? -o will mess outputs from different processes PS To some editors: who may think that MPICH is the name of the library. MPICH2 is a particular version.. MPICH2…
osgx
  • 90,338
  • 53
  • 357
  • 513
0
votes
2 answers

Stracing by pid, child processes included

I'm new to strace and I want to strace a forked child. Because I want to do this as a regular user, the process I want to strace by its pid needs to be a child of the tracing process (strace), so I need to fork twice. In bash: ( ( sleep 1; echo "I'm…
Petr Skocik
  • 58,047
  • 6
  • 95
  • 142
0
votes
1 answer

Pipe system calls

How can you see from the strace output that a pipeline of commands has been set up that links the processes together? Also, can all the process talk to eachother execve("./mypipes", ["./mypipes"], [/* 57 vars */]) = 0 arch_prctl(ARCH_SET_FS,…
user4437757
0
votes
1 answer

KUbuntu, Python and libtcod - console_is_window_closed not working...?

I've done a reasonable amount of coding with the libtcod library, both the C# and python wrappers. My current setup is KUbuntu 14.10, python 2.7.8, and libtcod 1.5.2. I've made a few programs that work fine, but the latest I've just started doesn't…
v4nz
  • 115
  • 7
0
votes
1 answer

Running Strace on Real Android Device gives SIGSEGV

I am trying to create a monitoring application for Android as part of a project. For this, I want to use strace, but I was unable to make Strace work on a Real Device. To test Strace, initially I tried to start Strace using Adb with the following…
merterpam
  • 765
  • 6
  • 14
0
votes
3 answers

bash wrap a piped command with a python script

Is there a way to create a python script which wraps an entire bash command including the pipes. For example, if I have the following simple script import sys print sys.argv and call it like so (from bash or ipython), I get the expected…
juniper-
  • 6,262
  • 10
  • 37
  • 65
0
votes
1 answer

Strace with writev() function in Linux, what does the '@', '2w', and '240K' represent in the data?

I have an strace of my program that interacts with USB, and I am wondering what the following write command tells me. I understand the writev iovec structure consists of the data array pointer followed by the length, but what does the "@\10\335…
ryeager
  • 873
  • 1
  • 10
  • 24
0
votes
1 answer

What should be a simple render takes almost a minute

I'm using passenger start in my development environment, yet thin, webbrick and puma have the same results. This problem also seems to be consistent across development machines running Ubuntu 14.04. In production, I do not have this issue at all.…
kobaltz
  • 6,980
  • 1
  • 35
  • 52