162306a36Sopenharmony_ci#!/bin/sh
262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
362306a36Sopenharmony_ci# Test one of the main kernel Makefile targets to generate a perf sources tarball
462306a36Sopenharmony_ci# suitable for build outside the full kernel sources.
562306a36Sopenharmony_ci#
662306a36Sopenharmony_ci# This is to test that the tools/perf/MANIFEST file lists all the files needed to
762306a36Sopenharmony_ci# be in such tarball, which sometimes gets broken when we move files around,
862306a36Sopenharmony_ci# like when we made some files that were in tools/perf/ available to other tools/
962306a36Sopenharmony_ci# codebases by moving it to tools/include/, etc.
1062306a36Sopenharmony_ciset -e
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciPERF=$1
1362306a36Sopenharmony_cicd ${PERF}/../..
1462306a36Sopenharmony_cimake perf-targz-src-pkg
1562306a36Sopenharmony_ciTARBALL=$(ls -rt perf-*.tar.gz)
1662306a36Sopenharmony_ciTMP_DEST=$(mktemp -d)
1762306a36Sopenharmony_citar xf ${TARBALL} -C $TMP_DEST
1862306a36Sopenharmony_cirm -f ${TARBALL}
1962306a36Sopenharmony_cicd - > /dev/null
2062306a36Sopenharmony_cimake -C $TMP_DEST/perf*/tools/perf
2162306a36Sopenharmony_ciRC=$?
2262306a36Sopenharmony_cirm -rf ${TMP_DEST}
2362306a36Sopenharmony_ciexit $RC
24