libbpf: Support riscv USDT argument parsing logic
authorPu Lehui <pulehui@huawei.com>
Tue, 19 Apr 2022 14:52:38 +0000 (22:52 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 20 Apr 2022 04:59:35 +0000 (21:59 -0700)
commit58ca8b0572cd3bbaac60d14d2b1b4f38b389ad93
tree7c9bebe6a96932794df0de5848e56d5031b14e05
parent5af25a410acb8d34acb11024d752f0ea3491decf
libbpf: Support riscv USDT argument parsing logic

Add riscv-specific USDT argument specification parsing logic.
riscv USDT argument format is shown below:
- Memory dereference case:
  "size@off(reg)", e.g. "-8@-88(s0)"
- Constant value case:
  "size@val", e.g. "4@5"
- Register read case:
  "size@reg", e.g. "-8@a1"

s8 will be marked as poison while it's a reg of riscv, we need
to alias it in advance. Both RV32 and RV64 have been tested.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220419145238.482134-3-pulehui@huawei.com
tools/lib/bpf/usdt.c