From db5e7fcf6cdc0ed28b3def57e08b919b84af010a Mon Sep 17 00:00:00 2001 From: zhangjian22 Date: Sun, 12 Feb 2023 12:26:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Hiebpf=E4=B8=ADgen=5Fskeleton.sh=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=8Cout?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=B1=82=E7=BA=A7=E5=8F=98=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E4=BC=9A=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99=20Signed-off-by:?= =?UTF-8?q?=20=E5=BC=A0=E5=BB=BA=20=20#I6EHBC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiebpf/BUILD.gn | 8 ++++++-- hiebpf/scripts/gen_skeleton.sh | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/hiebpf/BUILD.gn b/hiebpf/BUILD.gn index 1eb543933..0e2dceaed 100644 --- a/hiebpf/BUILD.gn +++ b/hiebpf/BUILD.gn @@ -84,9 +84,13 @@ action("gen_bpf_skeleton") { script = "./scripts/gen_skeleton.sh" sources = [] outputs = [ "$skel_out_dir/hiebpf.skel.h" ] + bpftool_dir = rebase_path("//prebuilts/develop_tools/bpftool/bin/bpftool") + skel_src_dir_abs = rebase_path("${skel_src_dir}") + skel_out_dir_abs = rebase_path("${skel_out_dir}") args = [ - skel_src_dir, - skel_out_dir, + bpftool_dir, + skel_src_dir_abs, + skel_out_dir_abs, ] deps = [ ":hiebpf.bpf" ] } diff --git a/hiebpf/scripts/gen_skeleton.sh b/hiebpf/scripts/gen_skeleton.sh index 1ee7c7dc0..89c4f757b 100755 --- a/hiebpf/scripts/gen_skeleton.sh +++ b/hiebpf/scripts/gen_skeleton.sh @@ -14,11 +14,13 @@ # limitations under the License CWD=$(pwd) -BASE_DIR=${CWD}"/../.."${1#\/} -DEST_DIR=${CWD}"/../.."${2#\/} +BPFTOOL_DIR=${1} +BASE_DIR=${2} +DEST_DIR=${3} -echo ${BASE_DIR} -echo ${DEST_DIR} +echo "BPFTOOL_DIR:"${BPFTOOL_DIR} +echo "BASE_DIR:"${BASE_DIR} +echo "DEST_DIR:"${DEST_DIR} if [[ ! -d "${BASE_DIR}" ]] then @@ -51,7 +53,7 @@ do echo "current skeleton name: "${SKEL_NAME} SKEL_PATH=${DEST_DIR}"/"${SKEL_NAME} echo "current skeleton path: "${SKEL_PATH} - ../../prebuilts/develop_tools/bpftool/bin/bpftool gen skeleton ${OBJ_PATH} > ${SKEL_PATH} + ${BPFTOOL_DIR} gen skeleton ${OBJ_PATH} > ${SKEL_PATH} if [ ! -s "${SKEL_PATH}" ] then echo ${SKEL_PATH}" is empty" From 653fbae4cdc6def9a4ac4d66d0ff63665ecd1232 Mon Sep 17 00:00:00 2001 From: zhangjian22 Date: Mon, 13 Feb 2023 09:22:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Hiebpf=E4=B8=ADgen=5Fskeleton.sh=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=8Cout?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=B1=82=E7=BA=A7=E5=8F=98=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E4=BC=9A=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99=20Signed-off-by:?= =?UTF-8?q?=20=E5=BC=A0=E5=BB=BA=20=20#I6EHBC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiebpf/scripts/gen_skeleton.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/hiebpf/scripts/gen_skeleton.sh b/hiebpf/scripts/gen_skeleton.sh index 89c4f757b..d4062270c 100755 --- a/hiebpf/scripts/gen_skeleton.sh +++ b/hiebpf/scripts/gen_skeleton.sh @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License -CWD=$(pwd) BPFTOOL_DIR=${1} BASE_DIR=${2} DEST_DIR=${3}