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