Created
November 6, 2014 10:51
-
-
Save yorickpeterse/0436c876695c0efca980 to your computer and use it in GitHub Desktop.
Allocation tracking in Rubinius using dtrace/Systemtap. This is still an experiment and might never actually make it into a release.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global allocations | |
probe process("rbx").mark("object__allocate") | |
{ | |
klass = user_string($arg1) | |
allocations[klass] <<< 1 | |
} | |
probe end | |
{ | |
printf("%-40s %s\n", "Class", "Amount"); | |
foreach ( [klass] in allocations- ) | |
{ | |
printf("%-40s %d\n", klass, @count(allocations[klass])) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo -E stap /tmp/alloc.stp -c 'rbx /tmp/test.rb' | |
WARNING: Kernel function symbol table missing [man warning::symbols] | |
Class Amount | |
File::Stat 7889 | |
Hash::Bucket 7611 | |
CodeTools::Generator::BasicBlock 5047 | |
Rubinius::Mirror::Array 2094 | |
CodeTools::Generator::Label 1922 | |
CodeTools::AST::ArrayLiteral 1626 | |
CodeTools::Compiler::LocalReference 1575 | |
Hash::State 1477 | |
Hash 1461 | |
CodeTools::AST::Arguments 1453 | |
CodeTools::AST::LocalVariableAccess 1349 | |
Array 1296 | |
CodeTools::AST::Send 1170 | |
CodeTools::AST::StringLiteral 1080 | |
CodeTools::AST::SendWithArguments 1079 | |
CodeTools::AST::ConstantAccess 933 | |
CodeTools::AST::Self 858 | |
CodeTools::AST::Block 758 | |
Rubinius::InstructionSequence 658 | |
CodeTools::AST::State 658 | |
CodeTools::Generator 658 | |
CodeTools::Compiler::LocalVariable 634 | |
CodeTools::AST::Parameters 583 | |
CodeTools::AST::NilLiteral 425 | |
CodeTools::AST::SymbolLiteral 362 | |
CodeTools::AST::ScopedConstant 362 | |
CodeTools::AST::If 327 | |
CodeTools::AST::InstanceVariableAccess 310 | |
CodeTools::AST::LocalVariableAssignment 307 | |
CodeTools::AST::Define 272 | |
CodeTools::AST::ToString 266 | |
CodeTools::AST::ElementAssignment 249 | |
CodeTools::AST::InstanceVariableAssignment 230 | |
Rubinius::Mirror::String 212 | |
CodeTools::AST::DynamicString 172 | |
CodeTools::AST::Iter 169 | |
String 167 | |
CodeTools::AST::DefineSingletonScope 142 | |
CodeTools::AST::DefineSingleton 142 | |
CodeTools::AST::FixnumLiteral 117 | |
Rubinius::InstructionSet::OpCode 105 | |
Rubinius::FFI::DynamicLibrary::Symbol 105 | |
CodeTools::Compiler::NestedLocalReference 92 | |
CodeTools::AST::Return 81 | |
CodeTools::AST::And 73 | |
Rubinius::CodeLoader 73 | |
CodeTools::AST::OpAssignOr 69 | |
CodeTools::AST::SendFastNew 68 | |
CodeTools::AST::RegexLiteral 68 | |
CodeTools::AST::When 64 | |
Rubinius::LoadedFeatures 64 | |
Rubinius::ConstantScope 63 | |
Rubinius::CompiledCode::Script 62 | |
Rubinius::CodeLoader::RequireRequest 62 | |
CodeTools::AST::EmptyArray 57 | |
CodeTools::AST::Class 46 | |
CodeTools::AST::TrueLiteral 44 | |
CodeTools::AST::ConstantAssignment 43 | |
CodeTools::AST::Begin 43 | |
CodeTools::AST::FalseLiteral 39 | |
CodeTools::AST::Or 37 | |
CodeTools::AST::NthRef 37 | |
Range 37 | |
CodeTools::AST::ScopedClassName 33 | |
Enumerable::SortedElement 30 | |
CodeTools::AST::AttributeAssignment 29 | |
CodeTools::AST::Defined 29 | |
CodeTools::AST::ClassScope 28 | |
CodeTools::AST::ClassVariableAccess 28 | |
CodeTools::Compiler::FileParser 27 | |
CodeTools::Compiler::Bytecode 27 | |
CodeTools::Melbourne 27 | |
CodeTools::Compiler::Packager 27 | |
CodeTools::AST::Script 27 | |
CodeTools::Compiler::Writer 27 | |
CodeTools::Compiler::Encoder 27 | |
CodeTools::Compiler 27 | |
Method 27 | |
CodeTools::AST::Alias 25 | |
Rubinius::Options::Option 25 | |
CodeTools::AST::DefaultArguments 24 | |
CodeTools::AST::HashLiteral 24 | |
UnboundMethod 21 | |
CodeTools::AST::ClassVariableAssignment 18 | |
CodeTools::AST::EmptyBody 18 | |
CodeTools::AST::RescueCondition 18 | |
CodeTools::AST::MultipleAssignment 17 | |
CodeTools::AST::Module 17 | |
CodeTools::AST::ModuleScope 17 | |
CodeTools::AST::Rescue 17 | |
CodeTools::AST::ReceiverCase 16 | |
CodeTools::AST::ModuleName 16 | |
CodeTools::AST::Match3 15 | |
CodeTools::AST::Next 15 | |
CodeTools::AST::ZSuper 13 | |
CodeTools::AST::ClassName 13 | |
CodeTools::AST::Yield 13 | |
CodeTools::AST::Super 12 | |
CodeTools::AST::BlockPass19 11 | |
CodeTools::AST::BlockArgument 11 | |
CodeTools::AST::Ensure 10 | |
CodeTools::AST::SplatValue 10 | |
CodeTools::AST::GlobalVariableAccess 10 | |
CodeTools::AST::ConcatArgs 9 | |
CodeTools::AST::While 9 | |
Rubinius::LRUCache::Entry 7 | |
Rubinius::IdentityMap 7 | |
CodeTools::AST::ToplevelConstant 6 | |
CodeTools::AST::CurrentException 5 | |
CodeTools::AST::DynamicRegex 5 | |
Dir::Glob::ConstantEntry 4 | |
Dir::Glob::Environment 3 | |
Mutex 3 | |
CodeTools::AST::Match2 3 | |
CodeTools::AST::BlockGiven 3 | |
CodeTools::AST::Range 3 | |
CodeTools::AST::OpAssignElement 3 | |
Dir::Glob::ConstantDirectory 3 | |
Dir::Glob::RootDirectory 3 | |
CodeTools::AST::SClass 3 | |
CodeTools::AST::SClassScope 3 | |
Rubinius::Hook 3 | |
Object 2 | |
Gem::Requirement 2 | |
Gem::Platform 2 | |
CodeTools::AST::Until 2 | |
CodeTools::AST::BackRef 2 | |
Dir::Glob::RecursiveDirectories 2 | |
Rubinius::FFI::DynamicLibrary 2 | |
CodeTools::Compiler::LRUCache::Entry 2 | |
CodeTools::AST::File 2 | |
Rubinius::LRUCache 2 | |
Monitor 1 | |
LoadError 1 | |
Gem::Version 1 | |
CodeTools::AST::DynamicSymbol 1 | |
Dir::Glob::EntryMatch 1 | |
Rubinius::Options 1 | |
CodeTools::AST::OpAssignAttribute 1 | |
Rubinius::Console::Server 1 | |
CodeTools::Compiler::LRUCache 1 | |
Rubinius::EnvironmentVariables 1 | |
Binding 1 | |
CodeTools::AST::ScopedModuleName 1 | |
Complex 1 | |
Rubinius::FFI::Pointer 1 | |
Rubinius::Loader 1 | |
Rubinius::ARGFClass 1 | |
CodeTools::AST::Break 1 | |
Rubinius::GlobalVariables 1 | |
Rubinius::Configuration 1 | |
ThreadGroup 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = 'Foo' | |
number = 10 | |
list = [] | |
hash = {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment