[Ffmpeg-devel] [PATCH] FFserver signal handler
Alex Beregszaszi
alex
Wed Feb 21 13:00:21 CET 2007
Hi,
> > If using gprof, the profiling data will be written only if the
> > application quits with exit(). In my setup, I was debuggging FFserver
> > when it felt into an infinite loop, thus killing was the most
> > appropriate thing to do. In this case I had no profiling data.
> >
> > Attached is a patch which adds a primitive signal handler to FFserver.
> > The patch may not apply cleanly, I plan to commit it, just asking if
> > anyone is against it.
>
> Isnt it possible to force the dumping of profiling data at regular
> intervals? Would have the additional benefit that one could have the
> info without terminating the server!
I didnt found a way, altought didnt searched extensively. Originally I
wanted to call the profile dump on SIGHUP.
[...]
> > int main(int argc, char **argv)
> > {
> > const char *config_filename;
> > int c;
> > struct sigaction sigact;
> >
> > + signal(SIGSEGV, signal_handler);
>
> Very risky.
>
> > + signal(SIGINT, signal_handler);
> > + signal(SIGKILL, signal_handler);
>
> Useless, you cant override the default hanlder for SIGKILL (fortunately!).
>
> > + signal(SIGTERM, signal_handler);
I understand the best would be adding only SIGINT and SIGTERM.
--
Alex Beregszaszi
More information about the ffmpeg-devel
mailing list