libbpf: Refactor parse_usdt_arg() to re-use code
authorPuranjay Mohan <puranjay12@gmail.com>
Tue, 7 Mar 2023 12:04:39 +0000 (12:04 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 7 Mar 2023 23:35:05 +0000 (15:35 -0800)
commit98e678e9bc5859dec605794730ad37d26789bd30
tree4a03492368730d3f1fdd6a3027970981cebdaaf3
parent3ecde2182adbb12b52b777d8fb4a599b43faf4f1
libbpf: Refactor parse_usdt_arg() to re-use code

The parse_usdt_arg() function is defined differently for each
architecture but the last part of the function is repeated
verbatim for each architecture.

Refactor parse_usdt_arg() to fill the arg_sz and then do the repeated
post-processing in parse_usdt_spec().

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230307120440.25941-2-puranjay12@gmail.com
tools/lib/bpf/usdt.c