Skip to content
Permalink
Browse files

Suppress SIGPROF

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 Oct 31, 2012
1 parent 7e96fb2 commit 98fc9cd0b28921dc02ee4c366c96e4caeb7d8475
Showing with 6 additions and 0 deletions.
  1. +6 −0 main.c
6 main.c
@@ -18,6 +18,7 @@
#ifdef RUBY_DEBUG_ENV
#include <stdlib.h>
#endif
#include <sys/time.h>

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

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

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

0 comments on commit 98fc9cd

Please sign in to comment.
You can’t perform that action at this time.