-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore(eBPF) set the threshold for a blocking call individually per pid #110
Conversation
There is no urge to merge this until the demo but it also won't have any negative impact on existing code build upon sendmsg |
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.
Looks good, but please lets merge this after the other branches, because we have to change something in the daemon and config code as well.
Another question? Why do we convert things to microseconds? Why do we not just keep it as nanos? Sure we most likely do not need the precision, but also, nanoseconds are the default and we would not have to do any conversion. We use u64 anyway, and we also do not need larger durations than u64 in nanoseconds would offer.
As you said, there is no need for this kind of precision and regarding the minimal impact our product should have, I figured I would minimize just a little bit. |
I mean the overhead is exactly the same, as its a u64, we are just losing precision and the apis differ, e.g timestamp is in nanos and duration is in micros, or am I misunderstanding something? |
no, the duration, that has to be transmitted from the frontend to the backend map, only needs to be a u32. And the precision-loss really is irrelevant. |
I still think we should use u64, as the overhead is negligible and I see no need to lose precision. More precision might actually be useful for things like blocking calls. I think the lower bits of the duration is also way more important than the higher bits, as our system is most likely completely unresponsive if we get into minute durations for a single call. If we decide that we want to reduce overhead by 32 bits (which is not worth the effort in my opinion), it would be better to truncate the time to 32 bits than to loose the last 3 digits of precision. |
Ok then I will change that |
Signed-off-by: Tom Weisshuhn <[email protected]>
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.
The fd in the syscall is a C int and the rust doc states that it is an i32
And what happens with negative fd's now, when we only have an unsigned int?
Yeah, but the tracepoint defines it with
It lead to a crash on @ffranzgitHub machine as well. The format description also casts it to |
Signed-off-by: Tom Weisshuhn <[email protected]>
8aa5e98
to
e043509
Compare
…ly by pid and minor bugfix Signed-off-by: Tom Weisshuhn <[email protected]>
Signed-off-by: Tom Weisshuhn <[email protected]>
Signed-off-by: Felix Hilgers <[email protected]>
e043509
to
4e28a75
Compare
Signed-off-by: Felix Hilgers <[email protected]>
ed803dc
to
8cd794c
Compare
do this by inserting in the
PIDS_TO_TRACK
map with key:pid
and value:duration_in_microseconds
.This PR also fixes am small bug that could occur if you remove a pid from the hashmap.