On Fri, 30 Sep 2005, Young Koh wrote:
> > > it seems that sigsetjmp() has
> > > relatively large overhead, we could reduce some overhead by not
> > > calling it.
> >
> > How do you measure it? I'm curious myself - I know there's the possibility 
> > to
> > use gprof, but I've never used that myself.
> 
> i usually use pentium rdtsc(read time stamp counter) to measure the
> timing and latency. (sometimes by instrumenting kernel or sometimes by
> measuring test programs) i ran a test program and measured the
> overhead of sigsetjmp() and setjmp(). it showed sigsetjmp() uses
> around 1350 cycles (which is around 0.45 us in 3.0GHz machine), and
> setjmp() only 21 cycles (< 0.01us). maybe while sigsetjmp() is
> implemented as a system call to cope with signal blocking/unblocking,
> setjmp() is not a system call? (getpid() itself takes more than 1000
> cycles)

Indeed, setjmp() is not a system call. It just saves the registers to the
passed env structure.

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to