Watson1978
11/18/2010 - 3:39 PM

mothod.rb

filename = ARGV[0]
unless(filename)
  puts "usage: #{$0} filename"
  exit
end

list = {}
File.open(filename) {|f|
  f.each_line do |line|
    line.strip!
    if (line =~ /^\[DTRACE\](.+)/)
      method = $1
      list[method] ||= 0
      list[method]  += 1
    end
  end
}

list.sort{|a, b| b[1] <=> a[1]}.each do |method, value|
  puts "\"#{method}\",#{value}"
end