-
Notifications
You must be signed in to change notification settings - Fork 382
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
kprobes: matchArgs improvements (for fd/file) #235
Conversation
e59e5d3
to
b1cd11b
Compare
I'm getting tests fails (I ran on latest upstream, then I tried on 5.4 with similar results) 5.4:
5.19:
|
@olsajiri I haven't tested them on 5.19. On 5.4.182 both with:
and
I cannot see any issues. Even in the case of these that run successfully in your case i.e.
(on a gcloud VM with 4 vCPUs and 16GB DRAM). Maybe a race? I will check further... |
I used 4 CPUs with 8GB, after adding another 8GB it's much faster, but still failing, I'll try to debug that |
Always the same tests are failing? |
yes |
e68748c
to
fb21d4a
Compare
fb21d4a
to
7374d18
Compare
ff187f3
to
d0c0ed1
Compare
d0c0ed1
to
2073fff
Compare
2f81c86
to
9a55b0e
Compare
Currently, we support up to 2 values under matchArgs with "file" type. This commit introduces 3 new tests: TestKprobeMatchArgsFileEqual TestKprobeMatchArgsFilePostfix TestKprobeMatchArgsFilePrefix that checks the 3 different operators ("Equal", "Prefix", and "Postfix") with 2 values. These tests does not use any other than matchArgs selectors in order to do a targeted testing. Signed-off-by: Anastasios Papagiannis <[email protected]>
The previous commit (c0a16b3) shows that there is a bug in TestKprobeMatchArgsFilePrefix unit test and more specifically in the case of Prefix operator. Most possibly this bug was introduced in #90. This commit fixes this issue. Signed-off-by: Anastasios Papagiannis <[email protected]>
Now we have cmpbytes_small and cmpbytes. The difference is the number of iterations in these 2 cases. We choose the small variant in the case where __LARGE_BPF_PROG is not defined. This commit removes cmpbytes_small and changed the number of iterations based on __LARGE_BPF_PROG. Signed-off-by: Anastasios Papagiannis <[email protected]>
A previous commit introduces tests for "file" type. Internally, "fd" and "file" use the same low-level mechanism but there are small differences in several code paths. This commit introduces 3 new tests: TestKprobeMatchArgsFdEqual TestKprobeMatchArgsFdPostfix TestKprobeMatchArgsFdPrefix that checks the 3 different operators ("Equal", "Prefix", and "Postfix") with 2 values. These tests does not use any other than matchArgs selectors in order to do a targeted testing. Signed-off-by: Anastasios Papagiannis <[email protected]>
…le") Currently, matchArgs for "fd" and "file" types supports up to 2 values in all kernel versions. This commit increases this value to 8 for kernels >= 5.3 (i.e. when __LARGE_BPF_PROG is defined). We still support 2 values for kernels < 5.3. Signed-off-by: Anastasios Papagiannis <[email protected]>
The previous commit introduces increased number of values in matchArgs for "file" and "fd" types. This commit updates TestKprobeMatchArgs* unit tests to use 4 values (instead of 2) in newer kernels. Signed-off-by: Anastasios Papagiannis <[email protected]>
This never changes Signed-off-by: Anastasios Papagiannis <[email protected]>
Signed-off-by: Anastasios Papagiannis <[email protected]>
c5fe304
to
9cb1d03
Compare
In a similar way to when we start listening for events. Useful when we debug issues in the CI. Signed-off-by: Anastasios Papagiannis <[email protected]>
Now the timeout is 20 seconds. In the case where we load a large number of kprobe hooks (i.e. > 3) in a loaded machine, this can be exceeded easily. In that case, we stopped watching for events when we run the actual test and for this reason we are not seeing any kprobe events. FIXES: #247 Signed-off-by: Anastasios Papagiannis <[email protected]>
9cb1d03
to
d6cdbaa
Compare
In kprobes, we support
matchArgs
selector forfd
andfile
types withEqual
,Prefix
, andPostfix
operators.This PR first introduces unit-tests for all of these cases. These tests show an issue in the case of
Postfix
operator and we also fix this issue.Currently,
matchArgs
forfd/file
types support up to 2 values. This PR also increases this number for newer kernels (5.3+) to 8. It keeps that to 2 for older kernels.Finally, we also update unit-tests to check these.
ps. Tested locally on 4.19, 5.4, 5.10, and 5.13.
Signed-off-by: Anastasios Papagiannis [email protected]