View Single Post

   
  #9 (permalink)  
Old 01-05-2008, 10:48 AM
jbjr
 
Posts: n/a
Default Re: How to find out if process is in a loop?


Jurjen Oskam wrote:
> On 2006-11-12, Hemant Shah <shah@typhoon.xnet.com> wrote:
>
> > I have the source code, and the problem occurs when programmer
> > makes change to the application and runs it. The programmer may not monitor
> > the program so as sys admin I want to be able to catch it before it affects
> > other users.

>
> My point was: you can't tell whether a program is in an infinite loop from the
> outside. With knowledge about how the program *should* behave, you can try to
> determine whether the program still functions correctly. For example, if the program
> was designed to write a line to a file every 5 seconds, you know there's something
> wrong when this doesn't happen. But even then, the problem might not be in the
> program itself: the machine it's running on may be overloaded.
>
> Your best solution is to think of a way to monitor the program from a script.
> You need to find criteria to determine if the program is still correctly running,
> and this depends greatly on the particular program.
>
> --
> Jurjen Oskam


The "preferred" way to do this sort of thing if you have the source is
by using tprof, which can tell you in which subroutines the program
spent the most time. It is in the bos.perf.tools fileset on 5.3.

Reply With Quote