e227b8
/* SystemTap tapset to make it easier to trace Ruby 2.0
e227b8
 *
e227b8
 * All probes provided by Ruby can be listed using following command
e227b8
 * (the path to the library must be adjuste appropriately):
e227b8
 *
e227b8
 * stap -L 'process("@LIBRARY_PATH@").mark("*")'
e227b8
 */
e227b8
e227b8
/**
e227b8
 * probe ruby.array.create - Allocation of new array.
e227b8
 *
e227b8
 * @size: Number of elements (an int)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.array.create =
e227b8
      process("@LIBRARY_PATH@").mark("array__create")
e227b8
{
e227b8
	size = $arg1
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.cmethod.entry - Fired just before a method implemented in C is entered.
e227b8
 *
e227b8
 * @classname: Name of the class (string)
e227b8
 * @methodname: The method about bo be executed (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.cmethod.entry =
e227b8
      process("@LIBRARY_PATH@").mark("cmethod__entry")
e227b8
{
e227b8
	classname  = user_string($arg1)
e227b8
	methodname = user_string($arg2)
e227b8
	file = user_string($arg3)
e227b8
	line = $arg4
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.cmethod.return - Fired just after a method implemented in C has returned.
e227b8
 *
e227b8
 * @classname: Name of the class (string)
e227b8
 * @methodname: The executed method (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.cmethod.return =
e227b8
      process("@LIBRARY_PATH@").mark("cmethod__return")
e227b8
{
e227b8
	classname  = user_string($arg1)
e227b8
	methodname = user_string($arg2)
e227b8
	file = user_string($arg3)
e227b8
	line = $arg4
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.find.require.entry - Fired when require starts to search load
e227b8
 * path for suitable file to require.
e227b8
 *
e227b8
 * @requiredfile: The name of the file to be required (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.find.require.entry =
e227b8
      process("@LIBRARY_PATH@").mark("find__require__entry")
e227b8
{
e227b8
	requiredfile = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.find.require.return - Fired just after require has finished
e227b8
 * search of load path for suitable file to require.
e227b8
 *
e227b8
 * @requiredfile: The name of the file to be required (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.find.require.return =
e227b8
      process("@LIBRARY_PATH@").mark("find__require__return")
e227b8
{
e227b8
	requiredfile = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.gc.mark.begin - Fired when a GC mark phase is about to start.
e227b8
 *
e227b8
 * It takes no arguments.
e227b8
 */
e227b8
probe ruby.gc.mark.begin =
e227b8
      process("@LIBRARY_PATH@").mark("gc__mark__begin")
e227b8
{
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.gc.mark.end - Fired when a GC mark phase has ended.
e227b8
 *
e227b8
 * It takes no arguments.
e227b8
 */
e227b8
probe ruby.gc.mark.end =
e227b8
      process("@LIBRARY_PATH@").mark("gc__mark__end")
e227b8
{
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.gc.sweep.begin - Fired when a GC sweep phase is about to start.
e227b8
 *
e227b8
 * It takes no arguments.
e227b8
 */
e227b8
probe ruby.gc.sweep.begin =
e227b8
      process("@LIBRARY_PATH@").mark("gc__sweep__begin")
e227b8
{
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.gc.sweep.end - Fired when a GC sweep phase has ended.
e227b8
 *
e227b8
 * It takes no arguments.
e227b8
 */
e227b8
probe ruby.gc.sweep.end =
e227b8
      process("@LIBRARY_PATH@").mark("gc__sweep__end")
e227b8
{
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.hash.create - Allocation of new hash.
e227b8
 *
e227b8
 * @size: Number of elements (int)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.hash.create =
e227b8
      process("@LIBRARY_PATH@").mark("hash__create")
e227b8
{
e227b8
	size = $arg1
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.load.entry - Fired when calls to "load" are made.
e227b8
 *
e227b8
 * @loadedfile: The name of the file to be loaded (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.load.entry =
e227b8
      process("@LIBRARY_PATH@").mark("load__entry")
e227b8
{
e227b8
	loadedfile = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.load.return - Fired just after require has finished
e227b8
 * search of load path for suitable file to require.
e227b8
 *
e227b8
 * @loadedfile: The name of the file that was loaded (string)
e227b8
 */
e227b8
probe ruby.load.return =
e227b8
      process("@LIBRARY_PATH@").mark("load__return")
e227b8
{
e227b8
	loadedfile = user_string($arg1)
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.method.entry - Fired just before a method implemented in Ruby is entered.
e227b8
 *
e227b8
 * @classname: Name of the class (string)
e227b8
 * @methodname: The method about bo be executed (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.method.entry =
e227b8
      process("@LIBRARY_PATH@").mark("method__entry")
e227b8
{
e227b8
	classname  = user_string($arg1)
e227b8
	methodname = user_string($arg2)
e227b8
	file = user_string($arg3)
e227b8
	line = $arg4
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.method.return - Fired just after a method implemented in Ruby has returned.
e227b8
 *
e227b8
 * @classname: Name of the class (string)
e227b8
 * @methodname: The executed method (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.method.return =
e227b8
      process("@LIBRARY_PATH@").mark("method__return")
e227b8
{
e227b8
	classname  = user_string($arg1)
e227b8
	methodname = user_string($arg2)
e227b8
	file = user_string($arg3)
e227b8
	line = $arg4
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.object.create - Allocation of new object.
e227b8
 *
e227b8
 * @classname: Name of the class (string)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.object.create =
e227b8
      process("@LIBRARY_PATH@").mark("object__create")
e227b8
{
e227b8
	classname = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.parse.begin - Fired just before a Ruby source file is parsed.
e227b8
 *
e227b8
 * @parsedfile: The name of the file to be parsed (string)
e227b8
 * @parsedline: The line number of beginning of parsing (int)
e227b8
 */
e227b8
probe ruby.parse.begin =
e227b8
      process("@LIBRARY_PATH@").mark("parse__begin")
e227b8
{
e227b8
	parsedfile = user_string($arg1)
e227b8
	parsedline = $arg2
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.parse.end - Fired just after a Ruby source file was parsed.
e227b8
 *
e227b8
 * @parsedfile: The name of parsed the file (string)
e227b8
 * @parsedline: The line number of beginning of parsing (int)
e227b8
 */
e227b8
probe ruby.parse.end =
e227b8
      process("@LIBRARY_PATH@").mark("parse__end")
e227b8
{
e227b8
	parsedfile = user_string($arg1)
e227b8
	parsedline = $arg2
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.raise - Fired when an exception is raised.
e227b8
 *
e227b8
 * @classname: The class name of the raised exception (string)
e227b8
 * @file: The name of the file where the exception was raised (string)
e227b8
 * @line: The line number in the file where the exception was raised (int)
e227b8
 */
e227b8
probe ruby.raise =
e227b8
      process("@LIBRARY_PATH@").mark("raise")
e227b8
{
e227b8
	classname  = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.require.entry - Fired on calls to rb_require_safe (when a file
e227b8
 * is required).
e227b8
 *
e227b8
 * @requiredfile: The name of the file to be required (string)
e227b8
 * @file: The file that called "require" (string)
e227b8
 * @line: The line number where the call to require was made(int)
e227b8
 */
e227b8
probe ruby.require.entry =
e227b8
      process("@LIBRARY_PATH@").mark("require__entry")
e227b8
{
e227b8
	requiredfile = user_string($arg1)
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.require.return - Fired just after require has finished
e227b8
 * search of load path for suitable file to require.
e227b8
 *
e227b8
 * @requiredfile: The file that was required (string)
e227b8
 */
e227b8
probe ruby.require.return =
e227b8
      process("@LIBRARY_PATH@").mark("require__return")
e227b8
{
e227b8
	requiredfile = user_string($arg1)
e227b8
}
e227b8
e227b8
/**
e227b8
 * probe ruby.string.create - Allocation of new string.
e227b8
 *
e227b8
 * @size: Number of elements (an int)
e227b8
 * @file: The file name where the method is being called (string)
e227b8
 * @line: The line number where the method is being called (int)
e227b8
 */
e227b8
probe ruby.string.create =
e227b8
      process("@LIBRARY_PATH@").mark("string__create")
e227b8
{
e227b8
	size = $arg1
e227b8
	file = user_string($arg2)
e227b8
	line = $arg3
e227b8
}