rpms/kcbench/devel kcbench,1.1,1.2

Thorsten Leemhuis (thl) fedora-extras-commits at redhat.com
Mon Oct 22 05:58:35 UTC 2007


Author: thl

Update of /cvs/pkgs/rpms/kcbench/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30564

Modified Files:
	kcbench 
Log Message:
update script to 0.1.2, bo build yet


Index: kcbench
===================================================================
RCS file: /cvs/pkgs/rpms/kcbench/devel/kcbench,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- kcbench	15 Oct 2007 16:06:25 -0000	1.1
+++ kcbench	22 Oct 2007 05:57:59 -0000	1.2
@@ -25,7 +25,7 @@
 
 # this is me
 myprog_name=kcbench
-myprog_version=0.1.1
+myprog_version=0.1.2
 
 # set some defaults -- called before cmdoptions are parsed
 kcbench_init ()
@@ -68,12 +68,14 @@
 	if [[ ! "${ignore_running_apps}" ]]; then
 		local runningtasks="$(echo $(ps -A | grep --word -e crond -e httpd -e atd -e sendmail -e smbd | awk '{print $4}' | sort | uniq))"
 		if [[ "${runningtasks}" ]] ; then
-			echo "WARNING: The following daemons run and might disturb the benchmark: ${runningtasks}; use '--ignore-running-apps' to disabled this warning" >&2
+			echo "WARNING: There are some daemons runnningin the background:" >&2
+			echo "         ${runningtasks}" >&2
+			echo "         Those might disturb the benchmark; you should disable them!" >&2
+			echo "         (use '--ignore-running-apps' to disabled this warning" >&2
 			sleep 5
 		fi
 	fi
 
-
 	# find a srctree to compile!
 	if [[ "${compile_srctree}" ]]; then
 		# user provided some informations what kernel to use
@@ -246,11 +248,14 @@
 		# But it does not work as good as a thrown-away compile-run
 
 		# only print result in verbose mode
-		(( ${verboselevel} == 2 )) && kcbench_echo 1 2 -n "Filling caches:     This might take a while..."
-		kcbench_compile_kernel 3 ${default_number_of_jobs} run-0-fillcaches "Filling caches:     "
-		kcbench_echo 1 3 "-------------------------------------------------------------------------------"
-		# is there a better way to move the cursor to the left?
-		(( ${verboselevel} == 2 )) && kcbench_echo 1 2 -e "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bFilling caches:     Done                                                      "
+		if [[ "${show_result_from_cache_free_run}" ]]; then
+			kcbench_compile_kernel 2 ${default_number_of_jobs} run-0-fillcaches "Filling caches:     "
+		else
+			(( ${verboselevel} == 2 )) && kcbench_echo 1 2 -n "Filling caches:     This might take a while..."
+			kcbench_compile_kernel 3 ${default_number_of_jobs} run-0-fillcaches "Fill cache run (${default_number_of_jobs})"
+			kcbench_echo 1 3 "-------------------------------------------------------------------------------"
+			(( ${verboselevel} == 2 )) && kcbench_echo 1 2 " Done"
+		fi
 	fi
 
 	# go
@@ -293,10 +298,14 @@
 	kcbench_echo 1 ${this_verboselevel} -n "${this_msgstart}"
 
 
-	if /usr/bin/time -o "${this_logfile}.time" -f "P:%P R:%e U:%U S:%S" make O="${dir_outputtmp}" -C "${dir_sources}" -j ${this_nrjobs} vmlinux >> "${this_logfile}" 2>&1 ; then
-		local time_points="$(echo 1000000/$(cut -d ' ' -f 2 < "${this_logfile}.time" | cut -d ':' -f 2) | /usr/bin/bc)"
-		local time_details="$(cat "${this_logfile}.time")"
-		kcbench_echo 1 ${this_verboselevel} "${time_points} (${time_details})"
+	if /usr/bin/time -o "${this_logfile}.time" -f "P:%P e:%e U:%U S:%S" make O="${dir_outputtmp}" -C "${dir_sources}" -j ${this_nrjobs} vmlinux >> "${this_logfile}" 2>&1 ; then
+		if [[ "${3}" == "run-0-fillcaches" ]] && [[ "${show_result_from_cache_free_run}" ]]; then
+			kcbench_echo 1 2 "Done (-j ${default_number_of_jobs}, e:$(cut -d ' ' -f 2 < "${this_logfile}.time" | cut -d ':' -f 2))"
+		else
+			local time_points="$(echo 1000000/$(cut -d ' ' -f 2 < "${this_logfile}.time" | cut -d ':' -f 2) | /usr/bin/bc)"
+			local time_details="$(cat "${this_logfile}.time")"
+			kcbench_echo 1 ${this_verboselevel} "${time_points} (${time_details})"	
+		fi
 	else
 		kcbench_echo 2 1 "Failed ($(date))."
 
@@ -330,7 +339,7 @@
 {
 	kcbench_echo 1 ${1} "Linux running:      $(uname -r)"
 	kcbench_echo 1 ${1} "Compiler:           $(gcc --version | head -n 1)"
-	kcbench_echo 1 ${1} "CPU:                $(grep '^processor' < /proc/cpuinfo  | wc -l) x $(grep 'model name' /proc/cpuinfo  | sed 's!model name\t: !!' | sort | uniq)"
+	kcbench_echo 1 ${1} "Processor Cores:    $(grep '^processor' < /proc/cpuinfo  | wc -l) -- $(grep 'model name' /proc/cpuinfo  | sed 's!model name\t: !!' | sort | uniq)"
 	kcbench_echo 1 ${1} "Memory:             $(( $(awk '/MemTotal:/ { print $2}' /proc/meminfo) / 1024  )) MByte"
 	kcbench_echo 1 ${1} "Linux compiled:     $(basename "${dir_sources}") (${dir_sources})"
 }




More information about the fedora-extras-commits mailing list