Module: XRay

Defined in:
lib/xray/signal_handler.rb,
lib/xray/dtrace/tracer.rb,
lib/xray/thread_aware_dispatcher.rb

Overview

Install a signal handler dumping current thread stack

Trigger it with: kill -QUIT <pid>

Defined Under Namespace

Modules: DTrace, ThreadAwareDispatcher

Class Method Summary collapse

Class Method Details

.dump_threadsObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/xray/signal_handler.rb', line 8

def self.dump_threads
  STDERR.puts "=============== XRay Inspector ==============="
  STDERR.puts "Current Thread\n    "
  STDERR.puts caller.join("\n    \_ ")
  STDERR.puts Thread.current.xray_backtrace.join("\n    \_ ")
  # STDERR.puts "----------------------------------------------"
  # Thread.list.each_with_index do |t,i| 
  #   STDERR.puts "Dumping Thread #{i}\n    "
  #   t.xray_backtrace.join("\n    \_ ")
  # end
  STDERR.puts "=============================================="
  STDERR.flush
end