-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 path builtin function #1492
Merged
Merged
Commits on Oct 12, 2020
-
When processing pointer attach point arguments we also need to add pointer record to the BTF set, se we are able to dereference it later on. This will allow to resolve f_path member in dpath call (added in following patches): # bpftrace -e 'kfunc:filp_close { printf("%s\n", dpath(args->filp->f_path)); }' Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 026b67b - Browse repository at this point
Copy the full SHA 026b67bView commit details -
Add fail argument to check_arg
Adding fail argument to check_arg so we can have it failed, but still give a chance for other type. It will be used in following patch for d_path check, that allows both pointer and record types in the argument. Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 3dd63d4 - Browse repository at this point
Copy the full SHA 3dd63d4View commit details -
Adding BPFfeature::has_d_path function to test if dpath helper is available. Display it for --info option: # bpftrace --info ... Kernel helpers ... get_current_cgroup_id: yes send_signal: yes override_return: no dpath: yes Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 5905717 - Browse repository at this point
Copy the full SHA 5905717View commit details -
Adding path builtin function that returns full path referenced by struct path pointer in argument. path(struct path *path) Example: # bpftrace -e 'kfunc:filp_close { printf("%s\n", path(args->filp->f_path)); }' Attaching 1 probe... /proc/sys/net/ipv6/conf/eno2/disable_ipv6 /proc/sys/net/ipv6/conf/eno2/use_tempaddr socket:[23276] /proc/sys/net/ipv6/conf/eno2/disable_ipv6 socket:[17655] /sys/devices/pci0000:00/0000:00:1c.5/0000:04:00.1/net/eno2/type socket:[38745] /proc/sys/net/ipv6/conf/eno2/disable_ipv6 The path returns the string with the path or empty string on error. I don't think it's necessary to return error code at the moment, however it can be added later in the second optional argument. Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 2df6741 - Browse repository at this point
Copy the full SHA 2df6741View commit details -
Add changelog for path builtin
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 2948244 - Browse repository at this point
Copy the full SHA 2948244View commit details -
Add dpath semantic_analyser test
Adding semantic_analyser test. Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for c0d03d2 - Browse repository at this point
Copy the full SHA c0d03d2View commit details -
Adding path runtime test that checks on close being called on file within './testprogs/syscall read' test prog. Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 8f11951 - Browse repository at this point
Copy the full SHA 8f11951View commit details -
Check a return value of dpath helper
Signed-off-by: Masanori Misono <m.misono760@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9ee6139 - Browse repository at this point
Copy the full SHA 9ee6139View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.