Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defer functions to follow-calls tracing option #3743

Open
archanaravindar opened this issue Jun 7, 2024 · 0 comments
Open

Add defer functions to follow-calls tracing option #3743

archanaravindar opened this issue Jun 7, 2024 · 0 comments
Assignees

Comments

@archanaravindar
Copy link
Contributor

Currently there is a PR that adds a new option --follow-calls to trace the children of the function that matches the regular expression upto the desired depth being reviewed in here- #3594
As of now, it supports very limited tracing of defer calls such as deferreturns and if the function in which the defer closure is defined matches the regular expression it traces the deferred functions as well.
This is a follow up issue to the PR that adds complete support to trace defer calls.

The main challenge in here is that the defer call mechanics does not operate as the regular calls because the interplay between the registers and the stack comes into the picture in this case making it a more involved task to compute the function (address) that is deferred.
Some of the initial ideas are mentioned in #3594 (comment)
This involves pattern recognition to catch places in the assembly where the deferred function address is being computed and loaded into the stack. And from there we can get the name of the function and add it to the trace list.
Since the assembly looks different on different architectures we will need to likewise parse the information differently depending on the architecture and glean the function address from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants