Reputation: 5696
I want to trace the execution of a java process. For that I am using strace to analyse it.
I have written two basic programs.
Prog1 : Simple hello world
Prog2 : Prime number calculation with lots of Sysout's. By lots I really mean lots !!
I am taking strace using : strace java classfile
Both the program work correctly. However, when I compare their straces, their outputs were same i.e. the system calls and their order.
My queries are :
Upvotes: 1
Views: 528
Reputation: 50104
By default, the program strace does not trace child processes. However, the Java VM creates early in the process a child process for the actual work. That's the reason, why the two different programs generate the same result when invoked with strace.
To also trace child processes, use the option -f
to strace, i.e.:
strace -f java Hello
Upvotes: 3