File Index
Files and directories
Sign in
FILE

perf-report-hierarchy.sh

File preview with syntax highlighting.

linux-6.19.14/tools/perf/tests/shell/perf-report-hierarchy.sh BASH
 1#!/bin/bash
 2# perf report --hierarchy
 3# SPDX-License-Identifier: GPL-2.0
 4# Arnaldo Carvalho de Melo <acme@redhat.com> 
 5
 6set -e
 7
 8temp_dir=$(mktemp -d /tmp/perf-test-report.XXXXXXXXXX)
 9
10cleanup()
11{
12	trap - EXIT TERM INT
13	sane=$(echo "${temp_dir}" | cut -b 1-21)
14	if [ "${sane}" = "/tmp/perf-test-report" ] ; then
15		echo "--- Cleaning up ---"
16		rm -rf "${temp_dir:?}/"*
17		rmdir "${temp_dir}"
18	fi
19}
20
21trap_cleanup()
22{
23	cleanup
24	exit 1
25}
26
27trap trap_cleanup EXIT TERM INT
28
29test_report_hierarchy()
30{
31	echo "perf report --hierarchy"
32
33	perf_data="${temp_dir}/perf-report-hierarchy-perf.data"
34	perf record -o "${perf_data}" uname
35	perf report --hierarchy -i "${perf_data}" > /dev/null
36	echo "perf report --hierarchy test [Success]"
37}
38
39test_report_hierarchy
40
41cleanup
42
43exit 0
~/ Read-only file preview.