]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Extract and generalize CPU mask parsing logic
authorAndrii Nakryiko <andriin@fb.com>
Thu, 12 Dec 2019 01:35:48 +0000 (17:35 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 13 Dec 2019 20:58:51 +0000 (12:58 -0800)
commitaac518a7de89f8eabdffec4e8f72ff3e14004301
treeb2e7b3306d10c300d91b150867eeb0d57877ae08
parent061a461c9ee8711b09b24c47853d4b3d95bc81f2
libbpf: Extract and generalize CPU mask parsing logic

This logic is re-used for parsing a set of online CPUs. Having it as an
isolated piece of code working with input string makes it conveninent to test
this logic as well. While refactoring, also improve the robustness of original
implementation.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191212013548.1690564-1-andriin@fb.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_internal.h