cloudius-systems / mgmt

20 stars 11 forks source link

add strace operation #44

Closed tzach closed 10 years ago

tzach commented 10 years ago

strace is a Linux command for tracing system calls and signals. It is desirable to have similar functionality on OSv

Out of linux options, the following seems to be more useful: -c Count time, calls, and errors for each system call and report a summary on program exit -i Print the instruction pointer at the time of the system call. -t Prefix each line of the trace with the time of day. -T Show the time spent in system calls. This records the time difference between the beginning and the end of each system call.

tgrabiec commented 10 years ago

Currently we have only one process in OSv so perhaps we should drop -p form the list?

tzach commented 10 years ago

@tgrabiec good point done

nyh commented 10 years ago

Since we don't have the concept of "system calls" we'll need to define what to trace.

One thing we can do is to trace any function calls from the application (shared object) to the OSv (library OS), but this will be more like "ltrace" than "strace", as it will also include functions such as memcpy(), etc., which aren't normally shown by "strace".

Another thing we can do is to manually add tracepoints to each of the "system calls" (as defined on Linux) so we can enable tracing only these and not other functions.

tzach commented 10 years ago

@nyh I agree we should not limit ourselves to system calls The functionality is covered by the trace REST API so I'm closing this issue. @lightpriest it would be good to provide compatibility to linux ltrace in the Lua CLI.