[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] Eliminating the sigprocmask system call
From: |
Arun Sharma |
Subject: |
[Libunwind-devel] Eliminating the sigprocmask system call |
Date: |
Wed, 4 Jun 2008 15:54:29 -0700 |
When we were analyzing the performance of stack unwinding (especially
compared to a much simpler unwinder based on frame pointers), one
thing that stood out is the cost of the sigprocmask(2) system call
which is invoked from the getcontext() in libc. It appears to me that
this is necessary only if the caller wants to unw_resume() at some
point.
However, for callers who just want to examine the stack, this could
potentially be eliminated. Currently there is no way for the caller to
express the intent at unw_getcontext() time. Looking at some of the
other archs which have a hand coded getcontext.S (ia64, arm etc) - I
don't see any calls to sigprocmask. Does this mean that
Ltest-resume-sig is failing on those archs?
If we must restore signals state on unw_resume(), I was thinking
something along the lines of:
/* For users who want to unw_resume */
unw_getcontext(&uc);
/* For users who want to just examine the stack */
unw_get_mcontext(&uc);
Comments?
-Arun
- [Libunwind-devel] Eliminating the sigprocmask system call,
Arun Sharma <=