403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.70.147.202
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-143/tools/memory-model/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/linux-headers-5.15.0-143/tools/memory-model/scripts/cmplitmushist.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0+
#
# Compares .out and .out.new files for each name on standard input,
# one full pathname per line.  Outputs comparison results followed by
# a summary.
#
# sh cmplitmushist.sh

T=/tmp/cmplitmushist.sh.$$
trap 'rm -rf $T' 0
mkdir $T

# comparetest oldpath newpath
perfect=0
obsline=0
noobsline=0
obsresult=0
badcompare=0
comparetest () {
	grep -v 'maxresident)k\|minor)pagefaults\|^Time' $1 > $T/oldout
	grep -v 'maxresident)k\|minor)pagefaults\|^Time' $2 > $T/newout
	if cmp -s $T/oldout $T/newout && grep -q '^Observation' $1
	then
		echo Exact output match: $2
		perfect=`expr "$perfect" + 1`
		return 0
	fi

	grep '^Observation' $1 > $T/oldout
	grep '^Observation' $2 > $T/newout
	if test -s $T/oldout -o -s $T/newout
	then
		if cmp -s $T/oldout $T/newout
		then
			echo Matching Observation result and counts: $2
			obsline=`expr "$obsline" + 1`
			return 0
		fi
	else
		echo Missing Observation line "(e.g., herd7 timeout)": $2
		noobsline=`expr "$noobsline" + 1`
		return 0
	fi

	grep '^Observation' $1 | awk '{ print $3 }' > $T/oldout
	grep '^Observation' $2 | awk '{ print $3 }' > $T/newout
	if cmp -s $T/oldout $T/newout
	then
		echo Matching Observation Always/Sometimes/Never result: $2
		obsresult=`expr "$obsresult" + 1`
		return 0
	fi
	echo ' !!!' Result changed: $2
	badcompare=`expr "$badcompare" + 1`
	return 1
}

sed -e 's/^.*$/comparetest &.out &.out.new/' > $T/cmpscript
. $T/cmpscript > $T/cmpscript.out
cat $T/cmpscript.out

echo ' ---' Summary: 1>&2
grep '!!!' $T/cmpscript.out 1>&2
if test "$perfect" -ne 0
then
	echo Exact output matches: $perfect 1>&2
fi
if test "$obsline" -ne 0
then
	echo Matching Observation result and counts: $obsline 1>&2
fi
if test "$noobsline" -ne 0
then
	echo Missing Observation line "(e.g., herd7 timeout)": $noobsline 1>&2
fi
if test "$obsresult" -ne 0
then
	echo Matching Observation Always/Sometimes/Never result: $obsresult 1>&2
fi
if test "$badcompare" -ne 0
then
	echo "!!!" Result changed: $badcompare 1>&2
	exit 1
fi

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit