[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: stopping a problematic process.



peter@easthope.ca wrote:
> Suppose 
>   strace LooseCannon 
> produces 100 k lines of output but the user is primarily 
> interested to see the first 1 k lines.  
>   strace LooseCannon | head --lines=1000
> might work but waste time and resources.  How can the 
> process be stopped without losing the strace output and 
> before excessive waste?

Personally I almost never run "strace foo" unless it is a very simple
thing and I just want a quick look.  Instead I almost always log to a
file with "strace -o foo.strace.out foo" instead.  Then I browse the
log file.

Actually I almost always run strace with -e such as this way.  I am
often only concerned about file operations and so strace=file.  There
are other options too depending upon what I am trying to understand.
Reducing the output to only what I care about makes understanding it
much easier.

  strace -v -e strace=file -o foo.strace.out foo fooargs

And also with -v to avoid abbreviated output so that all of the
details are seen.

Then afterward or concurrently in another window I can browse the
output file.

  less foo.strace.out

Another advantage is that it runs without interfering with the
display.  And mostly runs full speed since the output is to a file.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: