Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

CPUPROFILE_REALTIME=1 disables profiling #41

Closed
betelgeuse opened this Issue Mar 8, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

betelgeuse commented Mar 8, 2012

#33 (comment)

As asked in #33 when when I don't have CPUPROFILE_REALTIME set current master (1742f97) works fine but when I set it then profiling gets disabled:

$ CPUPROFILE_REALTIME=1 PERFTOOLS=true bin/cucumber
Using the default profile...
Disabling profiler because SIGALRM handler is already in use.

Here's how perftools.rb is integrated to cucumber

features/support/perftools.rb

if ENV['PERFTOOLS']
  require 'perftools'

  PerfTools::CpuProfiler.start('tmp/cucumber.perf')
  at_exit do
    PerfTools::CpuProfiler.stop
  end
end
Owner

tmm1 commented Mar 9, 2012

Are you using the system timer gem by any chance?

Owner

tmm1 commented Mar 9, 2012

Never mind, I can recreate with:

$ CPUPROFILE_REALTIME=1 ruby -r perftools.bundle -e' PerfTools::CpuProfiler.start("/tmp/test.prof"); 100.times{ sleep 0.1 } '
Disabling profiler because SIGALRM handler is already in use.
^C-e:1:in `sleep': Interrupt
    from -e:1
    from -e:1:in `times'
    from -e:1

tmm1 added a commit that referenced this issue Mar 9, 2012

Owner

tmm1 commented Mar 9, 2012

Please verify this is fixed on master.

Contributor

bearded commented Mar 9, 2012

@tmm1, it works

@tmm1 tmm1 closed this Mar 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment