Skip to content

Commit

Permalink
Automatically fallback to kprobe backend if available_filter_function…
Browse files Browse the repository at this point in the history
…s not found

Signed-off-by: Zhichuan Liang <gray.liang@isovalent.com>
  • Loading branch information
jschwinger233 authored and tklauser committed Jan 11, 2024
1 parent 58ecef0 commit 860705a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/pwru/utils.go
Expand Up @@ -189,3 +189,8 @@ func HaveBPFLinkTracing() bool {

return true
}

func HaveAvailableFilterFunctions() bool {
_, err := getAvailableFilterFunctions()
return err == nil
}
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -85,7 +85,7 @@ func main() {
// has been backported to the stable, kprobe-multi cannot be used when attaching
// to kmods.
if flags.Backend == "" && len(flags.KMods) == 0 {
useKprobeMulti = pwru.HaveBPFLinkKprobeMulti()
useKprobeMulti = pwru.HaveBPFLinkKprobeMulti() && pwru.HaveAvailableFilterFunctions()
} else if flags.Backend == pwru.BackendKprobeMulti {
useKprobeMulti = true
}
Expand Down

0 comments on commit 860705a

Please sign in to comment.