From 8d13832d314c5d1db415a7ecf5fdf4ccaa6259cf Mon Sep 17 00:00:00 2001 From: Richael Zhuang Date: Wed, 21 Sep 2022 14:19:23 +0800 Subject: [PATCH] bpf: avoid "BEGIN {" being commented out Make "BEGIN {" start from a new line, or if there is some annotation at the end of bpftrace script file, "BEGIN {" will be commented out, like "//end of fileBEGIN {", then it reports "syntax error, unexpected map, expecting {". Change-Id: I1495e555834c1b3c28df011dcdbaa1420c14a5df Signed-off-by: Richael Zhuang Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14641 Reviewed-by: Konrad Sztyber Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins --- scripts/bpf/gen_enums.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/bpf/gen_enums.sh b/scripts/bpf/gen_enums.sh index b2c75df5e..df382142f 100755 --- a/scripts/bpf/gen_enums.sh +++ b/scripts/bpf/gen_enums.sh @@ -42,7 +42,10 @@ state_prefix["subsystem"]=SPDK_NVMF_SUBSYSTEM_ enums=$(print_enums) clear=$(print_clear) +# Add an empty line before "BEGIN {" to avoid it being commented out +# when there is annotation at the end of bpftrace script cat <<- ENUM + BEGIN { $enums }