148878053SArnaldo Carvalho de Melo#!/bin/sh
2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
348878053SArnaldo Carvalho de Melo# Test one of the main kernel Makefile targets to generate a perf sources tarball
448878053SArnaldo Carvalho de Melo# suitable for build outside the full kernel sources.
548878053SArnaldo Carvalho de Melo#
648878053SArnaldo Carvalho de Melo# This is to test that the tools/perf/MANIFEST file lists all the files needed to
748878053SArnaldo Carvalho de Melo# be in such tarball, which sometimes gets broken when we move files around,
848878053SArnaldo Carvalho de Melo# like when we made some files that were in tools/perf/ available to other tools/
948878053SArnaldo Carvalho de Melo# codebases by moving it to tools/include/, etc.
10*ee84a303SIan Rogersset -e
1148878053SArnaldo Carvalho de Melo
1248878053SArnaldo Carvalho de MeloPERF=$1
1348878053SArnaldo Carvalho de Melocd ${PERF}/../..
14*ee84a303SIan Rogersmake perf-targz-src-pkg
1548878053SArnaldo Carvalho de MeloTARBALL=$(ls -rt perf-*.tar.gz)
1648878053SArnaldo Carvalho de MeloTMP_DEST=$(mktemp -d)
1748878053SArnaldo Carvalho de Melotar xf ${TARBALL} -C $TMP_DEST
1848878053SArnaldo Carvalho de Melorm -f ${TARBALL}
1948878053SArnaldo Carvalho de Melocd - > /dev/null
20*ee84a303SIan Rogersmake -C $TMP_DEST/perf*/tools/perf
2148878053SArnaldo Carvalho de MeloRC=$?
2248878053SArnaldo Carvalho de Melorm -rf ${TMP_DEST}
2348878053SArnaldo Carvalho de Meloexit $RC
24