accel/qaic: Add AIC200 support
[drm/drm-misc.git] / tools / testing / selftests / damon / _chk_dependency.sh
blobdda3a87dc00a267a365d1116c987423f3510a823
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 # Kselftest framework requirement - SKIP code is 4.
5 ksft_skip=4
7 DBGFS=$(grep debugfs /proc/mounts --max-count 1 | awk '{print $2}')
8 if [ "$DBGFS" = "" ]
9 then
10 echo "debugfs not mounted"
11 exit $ksft_skip
14 DBGFS+="/damon"
16 if [ $EUID -ne 0 ];
17 then
18 echo "Run as root"
19 exit $ksft_skip
22 if [ ! -d "$DBGFS" ]
23 then
24 echo "$DBGFS not found"
25 exit $ksft_skip
28 if [ -f "$DBGFS/monitor_on_DEPRECATED" ]
29 then
30 monitor_on_file="monitor_on_DEPRECATED"
31 else
32 monitor_on_file="monitor_on"
35 for f in attrs target_ids "$monitor_on_file"
37 if [ ! -f "$DBGFS/$f" ]
38 then
39 echo "$f not found"
40 exit 1
42 done
44 permission_error="Operation not permitted"
45 for f in attrs target_ids "$monitor_on_file"
47 status=$( cat "$DBGFS/$f" 2>&1 )
48 if [ "${status#*$permission_error}" != "$status" ]; then
49 echo "Permission for reading $DBGFS/$f denied; maybe secureboot enabled?"
50 exit $ksft_skip
52 done