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..d4062270c 100755 --- a/hiebpf/scripts/gen_skeleton.sh +++ b/hiebpf/scripts/gen_skeleton.sh @@ -13,12 +13,13 @@ # See the License for the specific language governing permissions and # 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 +52,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"