Skip to content

[feat] Include class name for ruby method calls #714

@dalehamel

Description

@dalehamel

Currently without the class name, many ruby stacks aren't especially useful:

Image

For example, the above chain of "call" repeated is a common pattern for middlewares. They all implement a "call" method, but we don't get to see what the actual middleware name is.

I filed a similar issue for rbspy some time ago:

rbspy/rbspy#379

I think that it may be possible to update the ruby bpf unwinder, but it would be a fairly major overhaul. We currently only push the iseq body to userspace, but i think we'd need to push instead the rb_callable_method_entry_t.

I think that should let us get a handle to both the class and the actual method definition, though it will require some indirection. This is how ruby's own unwinder seems to work:

https://github.com/ruby/ruby/blob/f2a7e48deadb9101d49c9b613abf5a83c9e1dd49/vm_backtrace.c#L1997-L2002

We should still be able to get the line numbers and filename, as it seems the iseq is also accessible from rb_method_definition_struct, via the "iseq" entry.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions