Commit ca75690
committed
Fix attach_uprobe_multi_with_opts opts
Currently `func_pattern` is mandatory in `attach_uprobe_multi_with_opts`
Although in the C api it is optional, and mutually exclusive with some
other options. The rust api didn't allow passing null pointer, which
made it impossible to use `syms`/`offsets`/`ref_ctr_offsets`/`cookies`
from `opts` because of the following check -
https://github.com/libbpf/libbpf/blob/3b4f0ef5a6fa247ce1958d909c0e85e760249840/src/libbpf.c#L12172
Change was intentionally made in a way that doesn't break the existing
interface - interpret empty `func_pattern` string as non-existant
pattern. A more correct fix would probably be using an `Option` as this
is truely optional value, or structuring the api in a way that won't
allow passing mutually exclusive parameters.
Signed-off-by: Omer Kattan <omer.kattan@wiz.io>1 parent 5453917 commit ca75690
File tree
3 files changed
+75
-1
lines changed- libbpf-rs
- src
- tests
- bin/src
3 files changed
+75
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1111 | 1115 | | |
1112 | 1116 | | |
1113 | 1117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1987 | 1987 | | |
1988 | 1988 | | |
1989 | 1989 | | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
1990 | 2004 | | |
1991 | 2005 | | |
1992 | 2006 | | |
| |||
2021 | 2035 | | |
2022 | 2036 | | |
2023 | 2037 | | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2024 | 2078 | | |
2025 | 2079 | | |
2026 | 2080 | | |
| |||
0 commit comments