Class: Stackprofiler::Filter::RebaseStack
- Inherits:
-
Object
- Object
- Stackprofiler::Filter::RebaseStack
- Defined in:
- lib/stackprofiler/filters/rebase_stack.rb
Instance Attribute Summary collapse
-
#manual ⇒ Object
Returns the value of attribute manual.
Instance Method Summary collapse
- #filter(root, run) ⇒ Object
-
#initialize(options = {}) ⇒ RebaseStack
constructor
A new instance of RebaseStack.
Constructor Details
#initialize(options = {}) ⇒ RebaseStack
Returns a new instance of RebaseStack.
6 7 8 |
# File 'lib/stackprofiler/filters/rebase_stack.rb', line 6 def initialize(={}) self.manual = [:name].presence end |
Instance Attribute Details
#manual ⇒ Object
Returns the value of attribute manual.
4 5 6 |
# File 'lib/stackprofiler/filters/rebase_stack.rb', line 4 def manual @manual end |
Instance Method Details
#filter(root, run) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/stackprofiler/filters/rebase_stack.rb', line 10 def filter root, run suggested = run.profile[:suggested_rebase] root.find do |node| next if node == root addr = node.content[:addrs].first.to_i frame = run.profile[:frames][addr] if manual frame[:name].include? manual elsif suggested.is_a? String suggested == frame[:name] else suggested == addr end end || root end |