libbpf: Improve library identification for uprobe binary path resolution
authorAlan Maguire <alan.maguire@oracle.com>
Wed, 6 Apr 2022 11:43:49 +0000 (12:43 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 7 Apr 2022 18:42:50 +0000 (11:42 -0700)
commita1c9d61b19cbc0b9618c0a0400c304ecb63221d5
tree7fec36eb34417328a9f5d9ea564c3ba07f504ecf
parent9fc4476a08b6dc61e406c2c0c4e0690512f60e82
libbpf: Improve library identification for uprobe binary path resolution

In the process of doing path resolution for uprobe attach, libraries are
identified by matching a ".so" substring in the binary_path.
This matches a lot of patterns that do not conform to library.so[.version]
format, so instead match a ".so" _suffix_, and if that fails match a
".so." substring for the versioned library case.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1649245431-29956-2-git-send-email-alan.maguire@oracle.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_internal.h