summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/damon/_chk_dependency.sh
blob: 0189db81550be9f196cee04c6ed3ad1614db4248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

DBGFS=/sys/kernel/debug/damon

if [ $EUID -ne 0 ];
then
	echo "Run as root"
	exit $ksft_skip
fi

if [ ! -d "$DBGFS" ]
then
	echo "$DBGFS not found"
	exit $ksft_skip
fi

for f in attrs target_ids monitor_on
do
	if [ ! -f "$DBGFS/$f" ]
	then
		echo "$f not found"
		exit 1
	fi
done