403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.163.121
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/linux-headers-5.15.0-142/tools/testing/selftests/vm/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/linux-headers-5.15.0-142/tools/testing/selftests/vm/test_hmm.sh
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2018 Uladzislau Rezki (Sony) <[email protected]>
#
# This is a test script for the kernel test driver to analyse vmalloc
# allocator. Therefore it is just a kernel module loader. You can specify
# and pass different parameters in order to:
#     a) analyse performance of vmalloc allocations;
#     b) stressing and stability check of vmalloc subsystem.

TEST_NAME="test_hmm"
DRIVER="test_hmm"

# 1 if fails
exitcode=1

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

check_test_requirements()
{
	uid=$(id -u)
	if [ $uid -ne 0 ]; then
		echo "$0: Must be run as root"
		exit $ksft_skip
	fi

	if ! which modprobe > /dev/null 2>&1; then
		echo "$0: You need modprobe installed"
		exit $ksft_skip
	fi

	if ! modinfo $DRIVER > /dev/null 2>&1; then
		echo "$0: You must have the following enabled in your kernel:"
		echo "CONFIG_TEST_HMM=m"
		exit $ksft_skip
	fi
}

load_driver()
{
	modprobe $DRIVER > /dev/null 2>&1
	if [ $? == 0 ]; then
		major=$(awk "\$2==\"HMM_DMIRROR\" {print \$1}" /proc/devices)
		mknod /dev/hmm_dmirror0 c $major 0
		mknod /dev/hmm_dmirror1 c $major 1
	fi
}

unload_driver()
{
	modprobe -r $DRIVER > /dev/null 2>&1
	rm -f /dev/hmm_dmirror?
}

run_smoke()
{
	echo "Running smoke test. Note, this test provides basic coverage."

	load_driver
	$(dirname "${BASH_SOURCE[0]}")/hmm-tests
	unload_driver
}

usage()
{
	echo -n "Usage: $0"
	echo
	echo "Example usage:"
	echo
	echo "# Shows help message"
	echo "./${TEST_NAME}.sh"
	echo
	echo "# Smoke testing"
	echo "./${TEST_NAME}.sh smoke"
	echo
	exit 0
}

function run_test()
{
	if [ $# -eq 0 ]; then
		usage
	else
		if [ "$1" = "smoke" ]; then
			run_smoke
		else
			usage
		fi
	fi
}

check_test_requirements
run_test $@

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit