Skip to content
Browse files

contents -> body

  • Loading branch information...
1 parent c93db4f commit 8b3e59ec2ac4e11b4c0468b31cc021824e0bc1d5 @methodmissing committed Apr 26, 2009
View
2 lib/mri/instrumentation/runner/base.rb
@@ -82,7 +82,7 @@ def generate
Tempfile.open( 'mri_instrumentation' ) do |file|
file << d_stream()
file.flush
- %x[mate #{file.path}]
+ #%x[mate #{file.path}]
cmd = "sudo dtrace -s #{file.path} #{yield}"
@result = replace? ? exec( cmd ) : %x[#{cmd}]
end
View
28 lib/mri/instrumentation/strategy/base.rb
@@ -14,29 +14,29 @@ def initialize( probe, probes_collection = [] )
# Script header.
# Override for type declarations etc.
#
- def header( contents = '' )
+ def header( body = '' )
%[ #!/usr/sbin/dtrace -ZFs
#pragma D option quiet\n
#pragma D option dynvarsize=64m\n
- #{contents}\n ]
+ #{body}\n ]
end
# Any strategy specific setup eg. runtime variables
#
- def setup( contents = '')
- function_template( 'dtrace:::BEGIN', contents )
+ def setup( body = '')
+ function_template( 'dtrace:::BEGIN', body )
end
# Probe entry definition
#
- def entry( contents = '' )
- function_template( function_entry, contents )
+ def entry( body = '' )
+ function_template( function_entry, body )
end
# Probe function definition
#
- def function( contents = '' )
- function_template( @probe.function, contents )
+ def function( body = '' )
+ function_template( @probe.function, body )
end
# Any predicate conditions
@@ -47,14 +47,14 @@ def predicate
# Probe return definition
#
- def return( contents = '' )
- function_template( function_return, contents, predicate )
+ def return( body = '' )
+ function_template( function_return, body, predicate )
end
# Report results
#
- def report( contents = '' )
- function_template( 'dtrace:::END', contents, '' )
+ def report( body = '' )
+ function_template( 'dtrace:::END', body, '' )
end
# Build this strategy
@@ -87,11 +87,11 @@ def method_missing( method, *args, &block )
private
- def function_template( name, contents, predicate_clause = '' )
+ def function_template( name, body, predicate_clause = '' )
%[ #{name}
#{predicate_clause}
{
- #{contents}
+ #{body}
}\n ]
end
View
8 lib/mri/instrumentation/strategy/interval.rb
@@ -7,23 +7,23 @@ def header
super %[ inline int SCREEN = 21;\n ]
end
- def setup( contents = '' )
+ def setup( body = '' )
super %[ #{init_counters()}
lines = SCREEN + 1; ]
end
- def entry( contents = '' )
+ def entry( body = '' )
%[ #{function_entry}
{
#{probe.to_s}++;
}\n ]
end
- def return( contents = '' )
+ def return( body = '' )
''
end
- def report( contents = '' )
+ def report( body = '' )
%[ profile:::tick-1sec
{
printf("%20Y #{probes_collection.result_format}\\n", walltimestamp, #{probes_collection.to_s('', ', ')});
View
8 lib/mri/instrumentation/strategy/speculate.rb
@@ -27,19 +27,19 @@ def predicate_success
end
def return_success
- contents = %[ commit(self->spec);
+ body = %[ commit(self->spec);
self->spec = 0; ]
- function_template( function_return, contents, predicate_success )
+ function_template( function_return, body, predicate_success )
end
def predicate_failure
'/self->spec && errno != 0/'
end
def return_failure
- contents = %[ discard(self->spec);
+ body = %[ discard(self->spec);
self->spec = 0; ]
- function_template( function_return, contents, predicate_failure )
+ function_template( function_return, body, predicate_failure )
end
def functions

0 comments on commit 8b3e59e

Please sign in to comment.
Something went wrong with that request. Please try again.