Module: Procview

Defined in:
lib/procview.rb,
lib/procview/stats.rb,
lib/procview/runner.rb,
lib/procview/options.rb,
lib/procview/version.rb,
lib/procview/analyzer.rb,
lib/procview/straceargs.rb

Overview

Parse the arguments of an Strace call Calls with ! affect their arguments They parse the input string removing the matching items from the front The return the items and modify the input string for easy chaining.

Defined Under Namespace

Modules: StraceArgs Classes: Analyzer, Options, Runner, Stats

Constant Summary collapse

STRACE =
%w{ /usr/bin/env strace -Tfq -e desc,network,file,process }
LSOF =
%w{ /usr/bin/env lsof }
VERSION =
'0.9.2'

Class Method Summary collapse

Class Method Details

.checklsof(quiet = false) ⇒ Object



8
9
10
11
12
13
# File 'lib/procview.rb', line 8

def self.checklsof quiet = false
  lsof = `#{(Procview::LSOF+%w{ -v 2>&1 }).join(' ')}`
  /\s+revision:\s+(?<rev>[.\d]+)\s+/ =~ lsof
  raise "'lsof' not found! Check that it is installed and on your PATH" if rev.nil?
  STDERR.puts "Using lsof #{rev}" unless quiet
end

.checkstrace(quiet = false) ⇒ Object



15
16
17
18
19
20
# File 'lib/procview.rb', line 15

def self.checkstrace quiet = false
  strace = `#{(Procview::STRACE+%w{ -V 2>&1 }).join(' ')}`
  /^strace\s+--\s+version\s+(?<rev>[.\d]+)$/ =~ strace
  raise "'strace' not found! Check that it is installed and on your PATH" if rev.nil?
  STDERR.puts "Using strace #{rev}" unless quiet
end