diff options
author | Hangbin Liu <[email protected]> | 2020-10-06 10:13:44 +0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2020-10-06 11:10:20 -0700 |
commit | 2c193d32caee83322a8511a88ba0cd097bba73f1 (patch) | |
tree | 6243db9425658c32067a18f0c455947b7fbc7036 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | a0f2b7acb4b1d29127ff99c714233b973afd1411 (diff) |
libbpf: Check if pin_path was set even map fd exist
Say a user reuse map fd after creating a map manually and set the
pin_path, then load the object via libbpf.
In libbpf bpf_object__create_maps(), bpf_object__reuse_map() will
return 0 if there is no pinned map in map->pin_path. Then after
checking if map fd exist, we should also check if pin_path was set
and do bpf_map__pin() instead of continue the loop.
Fix it by creating map if fd not exist and continue checking pin_path
after that.
Suggested-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Hangbin Liu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions