class DTracer::Builder
Public Class Methods
new()
click to toggle source
# File lib/dtracer/builder.rb, line 3 def initialize @content = [] end
Public Instance Methods
add_begin_probe()
click to toggle source
# File lib/dtracer/builder.rb, line 13 def add_begin_probe @content << 'BEGIN {' @content << ' printf("Tracing started\n");' @content << '}' @content << '' end
add_custom_probe()
click to toggle source
# File lib/dtracer/builder.rb, line 28 def add_custom_probe add_probe("custom") end
add_options(is_quite, string_size = 102400)
click to toggle source
# File lib/dtracer/builder.rb, line 7 def add_options(is_quite, string_size = 102400) @content << "#pragma D option quiet" if is_quite @content << "#pragma D option strsize=#{string_size}" @content << '' end
add_probe(probe_type)
click to toggle source
# File lib/dtracer/builder.rb, line 36 def add_probe(probe_type) @content << "oadprobe*:::#{probe_type} {" @content << ' printf("%s\n\n", copyinstr(arg0));' @content << '}' @content << '' end
add_request_probe()
click to toggle source
# File lib/dtracer/builder.rb, line 20 def add_request_probe add_probe("request") end
add_response_probe()
click to toggle source
# File lib/dtracer/builder.rb, line 24 def add_response_probe add_probe("response") end
build()
click to toggle source
# File lib/dtracer/builder.rb, line 32 def build @content.join("\n") end