Skip to content

Commit

Permalink
Suppress SIGPROF
Browse files Browse the repository at this point in the history
We don't handle it well -- the exact reason is unclear, but threading
seems to trigger it -- so just squelch it.

Building with -pg is necessary for getting call-graph information with
e.g. the Linux 'perf' profiler.  But -pg also causes the libc startup
routine to set a SIGPROF timer.  That doesn't serve any purpose with a
modern profiler like 'perf'; it was used by 'gprof'.
  • Loading branch information
gnprice committed Nov 20, 2012
1 parent 7e96fb2 commit 98fc9cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.c
Expand Up @@ -18,6 +18,7 @@
#ifdef RUBY_DEBUG_ENV #ifdef RUBY_DEBUG_ENV
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#include <sys/time.h>


int int
main(int argc, char **argv) main(int argc, char **argv)
Expand All @@ -29,6 +30,11 @@ main(int argc, char **argv)
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
#endif #endif


{
struct itimerval itimer = {{0, 0}, {0, 0}};
setitimer(ITIMER_PROF, &itimer, NULL);
}

ruby_sysinit(&argc, &argv); ruby_sysinit(&argc, &argv);
{ {
RUBY_INIT_STACK; RUBY_INIT_STACK;
Expand Down

0 comments on commit 98fc9cd

Please sign in to comment.