From a78d8ea4f2a57370c608117742b2316ef001ea5b Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Wed, 20 Oct 2021 10:31:29 +0200 Subject: [PATCH] scripts/bpftrace: force basic regex syntax in grep Forced grep to use use basic regular expression syntax (-G option) and removed escape characters from "{", as they're not needed in this mode. It fixes the following errors: fatal: command line, 'enum spdk_nvmf_subsystem_state \{': Unmatched \{ fatal: command line, 'enum nvmf_tgt_state \{': Unmatched \{ Signed-off-by: Konrad Sztyber Change-Id: I7dd15207d6ff22d229d8f66668d33e0f5596379e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9932 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- scripts/bpf/gen_enums.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/bpf/gen_enums.sh b/scripts/bpf/gen_enums.sh index 4a7a19e6a..b2c75df5e 100755 --- a/scripts/bpf/gen_enums.sh +++ b/scripts/bpf/gen_enums.sh @@ -6,7 +6,7 @@ rootdir=$(git rev-parse --show-toplevel) _print_enums() { local enum_type=$1 enum_string=$2 enum_prefix=$3 enum output - output=$(< "$rootdir/$(git -C "$rootdir" grep -l "$enum_string" -- lib module)") + output=$(< "$rootdir/$(git -C "$rootdir" grep -G -l "$enum_string" -- lib module)") # Isolate the enum block output=${output#*$enum_string$'\n'} output=${output%%$'\n'\};*} @@ -34,8 +34,8 @@ print_clear() { printf ' clear(@%s);\n' "${!state_enums[@]}"; } declare -A state_enums=() state_prefix=() -state_enums["target"]="enum nvmf_tgt_state \{" -state_enums["subsystem"]="enum spdk_nvmf_subsystem_state \{" +state_enums["target"]="enum nvmf_tgt_state {" +state_enums["subsystem"]="enum spdk_nvmf_subsystem_state {" state_prefix["target"]=NVMF_TGT_ state_prefix["subsystem"]=SPDK_NVMF_SUBSYSTEM_