Questions tagged [trace]

60 questions
27
votes
5 answers

How to trace a java-program?

As a sysadmin I sometimes face situations, where a program behaves abnormally, while not creating errors at all or creating nonsense error-messages. In the past - before java came in - there were two counter-measures: If nothing else helps - RTFM…
Nils
  • 18,202
  • 11
  • 46
  • 82
21
votes
2 answers

How to find out what process is writing to STDOUT?

I have two instances of a process running. One of them is "frEAkIng oUT!" and printing errors non stop to STDOUT. I want to kill the broken process but I have to make sure I don't terminate the wrong one. They were both started about at the same…
TCZ8
  • 1,069
  • 4
  • 14
  • 24
16
votes
2 answers

strace for library calls

I know of strace, which is super handy for watching system calls. Is there an equivalent that can trace calls to external libraries? For example, I'm trying to debug some SSLeay misbehavior with a third-party binary that I cannot access the code for…
draeath
  • 558
  • 3
  • 10
13
votes
1 answer

Turn on xtrace with environment variable

Bash has a sometimes-useful feature whereby if you turn on the "-x" option (I believe the symbolic name is xtrace), Bash outputs each line of script as it executes it. I know of two ways to enable this behavior: In the script itself, say set -x On…
MathematicalOrchid
  • 5,664
  • 7
  • 35
  • 62
13
votes
2 answers

Observing a hard-disk write in kernel space (with drivers/modules)

Apologies in advance if this post is a bit dense/messy, but I'm having a hard time formulating it better... Basically, I would like to study what happens upon a hard disk write, and I'd like to know: Is my understanding below correct - and if not,…
sdaau
  • 6,668
  • 12
  • 57
  • 69
10
votes
2 answers

Which file in kernel specifies fork(), vfork()... to use sys_clone() system call

When ltrace is used for tracing the system calls, I could see that fork() uses sys_clone() rather than sys_fork(). But I couldn't find the linux source where it is defined. My program is: #include main() { int pid,i=0,j=0; …
user3539
  • 4,288
  • 9
  • 34
  • 44
10
votes
2 answers

FreeBSD 10 trace disk activity

Is there any way to find some process which is periodically writing to disk (according to hdd led) on FreeBSD 10 with ZFS (maybe turn ZFS into verbose logging mode)? lsof and other instantly aggregating statistics utilities seems not able to catch…
o_0
  • 113
  • 1
  • 6
8
votes
1 answer

Tool to trace library calls in Linux/ARM

I am searching for a tool that allows to trace calls to functions in shared libraries in Linux/ARM. Basically, I want to be able to specify a command line and let this tool produce a record of called library functions and the passed arguments. I…
j0ker
  • 201
  • 1
  • 4
6
votes
2 answers

Why does bash add single quotes to unquoted failed pathname expansions in a command before executing it?

I was exploring the tracing of commands using set -x (set +x to unset) in bash: Print a trace of simple commands, for commands, case commands, select commands, and arithmetic for commands and their arguments or associated word lists after they…
user44370
5
votes
3 answers

Can I recursively print all current remote shells?

Is there a way to print out all of the local and remote shells I am currently in, recursively? For example, on my local machine, I will ssh into another machine. From there, I may switch users (opening another shell). Then I ssh to my local machine…
Stephen S
  • 794
  • 1
  • 7
  • 14
5
votes
3 answers

Inspect IO operations on FreeBSD system

I would know is there any way to inspect/intercept IO operations on FreeBSD. Like ktrace but if I don't know the process (which takes some big time for example).
5
votes
2 answers

set verbose prints unrelated extra lines

Using set -x causes my shell to print unrelated stuff. For example: $ set -x ++ printf $'%157s\r' $ echo 'hello' + echo hello hello ++ printf $'%157s\r' The lines starting with '++' are extra. How can I remove those extra lines?
Mert Nuhoglu
  • 661
  • 2
  • 7
  • 11
4
votes
0 answers

Is there any solution to ltrace calls made by libs opened using dlopen()?

I wrote different two different types of queues. Bundled them in different .sos. I have a driver main.c which tests functions offered by those queues. main.c makes use dlfcn.h to load, unload required library at run-time. Both the implementations of…
4
votes
2 answers

What does "pollsys" mean? Solaris "truss" output

> truss -p 6482 /2: pollsys(0xE517AD88, 1, 0xE517AE30, 0x00000000) = 0 /2: pollsys(0xE517AD88, 1, 0xE517AE30, 0x00000000) = 0 /2: pollsys(0xE517AD88, 1, 0xE517AE30, 0x00000000) = 0 /2: pollsys(0xE517AD88, 1, 0xE517AE30,…
Sybil
  • 1,653
  • 5
  • 19
  • 37
4
votes
2 answers

Tool to print out functions being called during run time?

I am looking for such kind of a tool on either Unix/Linux platform which can achieve: I have the source files and I compiled the application myself (the source code is in C, although I don't really think it matters here) I want to run this…
Boyu Fang
  • 281
  • 2
  • 8
1
2 3 4