Re: Profiling timer not delivered during syscalls?

Andrea Arcangeli (andrea@suse.de)
Tue, 2 Nov 1999 13:58:58 +0100 (CET)


On 1 Nov 1999, Patrick J. LoPresti wrote:

>Yes there is. When "-pg" is passed to the linker it causes it to link

I never noticed the SIGPROF thing so far.

>against gcrt0.o instead of crt0.o. The former invokes "monstartup"

... because I never linked against gcrt0.o. I never used -pg with the
linker. I used it only with the compiler and I feed to the linker my own
mcount() btw.

>to do and then running it. You will observe that the SIGPROF handler
>is invoked, just not during the select().

Because the ITIMER_PROF is simply invoked by the timer interrupt when
happens while the current process is the profiled one.

In select() the profiled process sleeps so it will never be the current
process and it will never get the SIGPROF from the ITIMER_PROF.

>system call, so I never get the interrupts to forward. I hacked
>around this by calling setitimer() in the child threads to enable the

Yes, you can use the ITIMER_REAL which sends a SIGALARM. Inside the
SIGALARM callback raise(SIGPROF). I don't know if this is what you want
but doing this will interrupt select to run the signal handler for sure ;).

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/