!752 Hiebpf中gen_skeleton.sh使用相对路径,out目录层级变化时会编译报错

Merge pull request !752 from zhangjian22/master
This commit is contained in:
openharmony_ci 2023-02-13 04:03:34 +00:00 committed by Gitee
commit a994e57db2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 8 deletions

View File

@ -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" ]
}

View File

@ -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"