-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Gotrace #1719
base: master
Are you sure you want to change the base?
Gotrace #1719
Conversation
Does this make sense, @brendangregg @goldshtn I'd like to make progress on this, but I'd like some sense of what y'all think about this direction. If it were to go back into |
Just a reminder on this PR - @goldshtn @brendangregg |
Renewing my request for review, @goldshtn & @brendangregg - I got totally distracted myself, but I'd like to make progress on this |
FYI: golang/go#27077 |
@bobrik I don't follow that issue completely. How does unwinding the stack relate? Is it peculiar to Go? |
I was playing with |
Do you understand the issue with unwinding the stack? Are uretprobes just fundamentally incompatible with Go programs - seems to me that they sometimes work, but I'm unclear on when or why. At the least, should we consider if BCC tools can determine if a particular probe will be incompatible? |
I don't have enough knowledge to understand the issue with stack unwinding, sorry. My hope is that Go developers can figure this out. |
@bobrik This comment seems to summarize the whole thing: #1320 (comment) I'm not entirely sure what to do about this for this PR, which is kind of languishing anyway. |
What about making BCC tools ABI-aware? |
@Julio-Guerra I'm not sure I understand what you mean? |
Since, I guess, |
The C conventions are pretty universal in Linux, though, as I understand it. Go's "everything goes on the stack directly" is a significant outlier, which also foils uretprobes, unfortunately. It's natural to want to say "report the 3rd argument when called", but that means something totally different to Go than it does to everything else. It's different enough that the Go trace version needs not only needs to handle it differently, but also present a different user interface. |
How much delta is there between gotrace and trace? If it's somewhat significant, then I'd go ahead with accepting gotrace into bcc. I was just rereading Gianluca Borello's experiments with using uprobes on the return points (#1320 (comment)), and that's something that could be added to gotrace. With such a change, it'd definitely be a significant divergence from trace. |
This may be of interest -- golang/go#40724 -- they are proposing to switch to register-based calling for go 1.16. |
This touches on #934 - it adds a rough
gotrace.py
tool (which still would require documentation etc), but handles Gogc
compiled code by using stack offsets, and manages Go's Pascal-style strings. I'm still not sure how to handle slices or concrete structs, but it seemed reasonable to present this for comment now that it will work for some cases.The appropriate comparison is to
trace.py
- reviewing what's changed, I think it would be possible to merge most of the changes back intotrace.py
with a few caveats -I think this all could be handled by a flag and conditionals within
trace.py