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 tcp congestion status duration statistic tool #3899
Conversation
…tool add tcp congestion status duration statistic tool
The use case makes sense to me. The implementation is not straightforward though because of the kernel missing a tracepoint in tcp_set_ca_state(), so it has to resort to kprobe and kretprobe on all functions calling tcp_set_ca_state(). ".set_state" of "struct tcp_congestion_ops" is implemented for some popular cc like cubic, bbr, and dctcp. That will be a more stable kprobe points. If you are interested, a tracepoint in tcp_set_ca_state() may be a good add to the kernel considering it is not the hot path. This future kernel work does not need to derail the current bcc pull request. |
yes, currently the upstream kernel only has inline function tcp_set_ca_state(), which is optimized by compiler when building and can not be probed. So in my implementation i have to kprobe and kretprobe on all functions calling it. |
Thanks; Several comments:
I guess this is only really tracing 10 functions as it's doing both kprobe and kretprobe. Things like tcp_disconnect() I'm not too worried about as it's in tcp_prot, and isn't likely going to change, and tcp_enter_loss() is in tcp.h. But others like tcp_try_undo_loss() feel like gritty internals. I'm ok with one or two such functions in a tool, but if it ends up being several it's a pain to maintain. So my two questions are: How many of these are unstable internal functions, and does it need to trace them all or can you pop up a stack frame and trace some more-stable parent function to do the same job? I'm not saying this is a blocker, I just want to be thoughtful about the future maintenance.
|
@brendangregg , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of inlining COULD happen for the probe functions used in this tool. So I strongly suggest you to implement the tracepoint as Martin suggested. The tool can still proceed. But with tracepoint in the kernel, we can have an alternative better implementation for future kernels.
@yonghong-song , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of okay. A few minor comments.
The congestion status of a tcp flow may be updated since there is congestion between tcp sender and receiver. It makes sense for adding tracepoint for congestion status update function to evaluate the performance of network and congestion algorithm. Link: iovisor/bcc#3899 Signed-off-by: jackygam2001 <jacky_gam_2001@163.com>
The congestion status of a tcp flow may be updated since there is congestion between tcp sender and receiver. It makes sense to add tracepoint for congestion status set function to summate cc status duration and evaluate the performance of network and congestion algorithm. the backgound of this patch is below. Link: iovisor/bcc#3899 Signed-off-by: Ping Gan <jacky_gam_2001@163.com>
The congestion status of a tcp flow may be updated since there is congestion between tcp sender and receiver. It makes sense to add tracepoint for congestion status set function to summate cc status duration and evaluate the performance of network and congestion algorithm. the backgound of this patch is below. Link: iovisor/bcc#3899 Signed-off-by: Ping Gan <jacky_gam_2001@163.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20220406010956.19656-1-jacky_gam_2001@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
add tcp congestion contol status duration statistic tool, and it can be used to evalute the networking and congestion algorithm performace.