summaryrefslogtreecommitdiff
authoryang.xu <yang.xu@amlogic.com>2018-03-08 06:08:43 (GMT)
committer yang.xu <yang.xu@amlogic.com>2018-03-08 06:08:43 (GMT)
commit010d780d295dc8017b9a2a05ce667802368265ac (patch)
treebbd9517f9fa60bcb11581d61b88634c560301f6f
parent040ac36be08c593cdef73109859c2ded4b561ea2 (diff)
downloadampere-010d780d295dc8017b9a2a05ce667802368265ac.zip
ampere-010d780d295dc8017b9a2a05ce667802368265ac.tar.gz
ampere-010d780d295dc8017b9a2a05ce667802368265ac.tar.bz2
tools: Remove the unuse file [1/1]
PD# NONE Remove the unuse file. Change-Id: Id1496c9df76925930acd2ea6b983e36a44a57c47
Diffstat
-rw-r--r--tools/cpuburn/cpuburn-krait.S96
-rw-r--r--tools/cpuburn/cpufreq-ljt-stress-test217
-rw-r--r--tools/cpuburn/gnuplot-sunxi-cpufreq112
3 files changed, 0 insertions, 425 deletions
diff --git a/tools/cpuburn/cpuburn-krait.S b/tools/cpuburn/cpuburn-krait.S
deleted file mode 100644
index 44d1a20..0000000
--- a/tools/cpuburn/cpuburn-krait.S
+++ b/dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2016 Siarhei Siamashka <siarhei.siamashka@gmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * This program tries to stress Qualcomm Krait 300/400 processor to generate
- * as much heat as possible.
- * WARNING: improperly cooled or otherwise flawed hardware may potentially
- * overheat and fail. Use at your own risk.
- *
- * Compilation instructions:
- * $ arm-linux-gnueabihf-gcc -o cpuburn-krait cpuburn-krait.S
- *
- * See http://ssvb.github.io/2012/04/10/cpuburn-arm-cortex-a9.html
- * for more details.
- */
-
- .syntax unified
- .text
- .arch armv7-a
- .fpu neon
- .global main
- .type main, %function
- .align 2
- .arm
-
-main:
- push {r4-r12, lr}
-
-#ifdef __linux__
- mov r0, #84 /* _SC_NPROCESSORS_ONLN */
- bl sysconf
- mov r4, r0
- cmp r4, #2
- blt 1f
- bl fork /* have at least 2 cores */
- cmp r4, #4
- blt 1f
- bl fork /* have at least 4 cores */
- cmp r4, #8
- blt 1f
- bl fork /* have at least 8 cores */
-1:
-#endif
- vmov.u8 q8, #0x0
- vmov.u8 q9, #0x0
- vmov.u8 q14, #0xff
- vmov.u8 q15, #0xff
-
- adr lr, 9f
- mov r1, #16
- mov r2, #-16
- mov ip, #1
- b 0f
-
- .balign 64
-9:
- .rept 64
- .long 0xffffffff
- .endr
-
- .balign 64
-/****************************************************************************/
-/* Main loop (2 cycles per loop iteration, reaching peak IPC=3) */
-/****************************************************************************/
-0: vld2.8 {q1}, [lr, :128], r1
- vaba.u8 q8, q2, q14
-
- vld2.8 {q2}, [lr, :128], r2
- vaba.u8 q9, q1, q15
-
- subs ip, ip, #0
- bne 0b
-/****************************************************************************/
-
- mov r0, #0
- pop {r4-r12, pc}
diff --git a/tools/cpuburn/cpufreq-ljt-stress-test b/tools/cpuburn/cpufreq-ljt-stress-test
deleted file mode 100644
index 3f1d956..0000000
--- a/tools/cpuburn/cpufreq-ljt-stress-test
+++ b/dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-raise "Please upgrade ruby to at least version 1.9" if RUBY_VERSION =~ /^1\.8/
-
-require 'shellwords'
-
-# Test the availability of the required tools
-
-def tool_exists(tool_name)
- `which #{tool_name} > /dev/null 2>&1`
- if $?.to_i != 0 then
- printf("Error: the required '%s' executable is not found in PATH\n", tool_name)
- return false
- else
- return true
- end
-end
-
-exit(1) if not tool_exists("md5sum") or
- not tool_exists("nproc") or
- not tool_exists("taskset")
-
-$cjpeg = "cjpeg"
-$djpeg = "djpeg"
-
-def download_and_compile_libjpeg_turbo()
- exit(1) if not tool_exists("wget") or
- not tool_exists("tar") or
- not tool_exists("gcc")
-
- shellescaped_dirname = Shellwords.escape(File.dirname(__FILE__))
- ljtname = File.join(File.dirname(__FILE__), "libjpeg-turbo-1.3.1")
- shellescaped_ljtname = Shellwords.escape(ljtname)
-
- if File.exists?(File.join(ljtname, "djpeg")) then
- $cjpeg = Shellwords.escape(File.join(ljtname, "cjpeg"))
- $djpeg = Shellwords.escape(File.join(ljtname, "djpeg"))
- return
- end
-
- if not `md5sum #{shellescaped_ljtname}.tar.gz 2>&1` =~ /2c3a68129dac443a72815ff5bb374b05/ then
- url = "http://downloads.sourceforge.net/project/libjpeg-turbo/1.3.1/libjpeg-turbo-1.3.1.tar.gz"
- printf("Downloading libjpeg-turbo-1.3.1.tar.gz ...")
- `wget -c #{url} -O #{shellescaped_ljtname}.tar.gz 2>&1`
- if $?.to_i != 0 then
- printf(" failed\n")
- exit(1)
- end
- printf(" done\n")
- end
- if not `md5sum #{shellescaped_ljtname}.tar.gz 2>&1` =~ /2c3a68129dac443a72815ff5bb374b05/ then
- printf("MD5 check failed for the downloaded libjpeg-turbo-1.3.1.tar.gz\n")
- exit(1)
- end
-
- printf("Extracting libjpeg-turbo-1.3.1.tar.gz ...")
- `tar -xzf #{shellescaped_ljtname}.tar.gz -C #{shellescaped_dirname}`
- if $?.to_i != 0 then
- printf(" failed\n")
- exit(1)
- end
- printf(" done\n")
-
- Dir.chdir(ljtname) {
- printf("Compiling libjpeg-turbo, please be patient ...")
- compilation_log = `./configure --disable-shared && make -j2 2>&1`
- if $?.to_i != 0 then
- printf(" failed\n%s\n", compilation_log)
- exit(1)
- end
- printf(" done\n")
- }
-
- $cjpeg = Shellwords.escape(File.join(ljtname, "cjpeg"))
- $djpeg = Shellwords.escape(File.join(ljtname, "djpeg"))
-end
-
-# Check if we have the right cjpeg and djpeg
-if not `#{$djpeg} -v </dev/null 2>&1` =~ /libjpeg\-turbo/ or
- not `#{$cjpeg} -v </dev/null 2>&1` =~ /libjpeg\-turbo/
-then
- printf("The cjpeg and djpeg tools from libjpeg-turbo are not found.\n")
- printf("Trying to download and compile them.\n")
- download_and_compile_libjpeg_turbo()
-end
-
-###############################################################################
-
-def create_random_jpg(filename, width, height)
- IO.popen(sprintf("#{$cjpeg} -q 95 > %s", Shellwords.escape(filename)), "wb") {|fh|
- fh.printf("P3\n%d %d\n255\n", width, height)
- fh.write(Random.new(0).bytes(3 * width * height).bytes.to_a.map {|x|
- x.to_s }.join(" "))
- }
-end
-
-def read_file(filename)
- return if not File.exists?(filename)
- fh = File.open(filename, "rb")
- data = fh.read
- fh.close
- return data
-end
-
-def write_file(filename, data)
- begin
- fh = File.open(filename, "wb")
- fh.write(data)
- fh.close
- rescue
- return false
- end
- return true
-end
-
-def set_userspace_governor(core)
- write_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_governor", "userspace")
- governor = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_governor")
- return false if not governor
- return governor.strip == "userspace"
-end
-
-def set_freq(core, freq)
- write_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_setspeed", freq.to_s)
- cur_freq = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_cur_freq")
- return false if not cur_freq
- return cur_freq.to_i == freq
-end
-
-def get_freq_list(core)
- freq_list = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_available_frequencies")
- if not freq_list then
- freq_list = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/stats/time_in_state")
- return [] if not freq_list
- return freq_list.split(/\s+/).each_slice(2).map {|x| x[0].to_i}
- end
- return freq_list.split(" ").map {|x| x.to_i}
-end
-
-jpgname = File.join(File.dirname(__FILE__), "whitenoise-1920x1080.jpg")
-shellescaped_jpgname = Shellwords.escape(jpgname)
-
-if not File.exists?(jpgname) then
- printf("Creating '%s' ...", jpgname)
- create_random_jpg(jpgname, 1920, 1080)
- printf(" done\n")
-end
-
-number_of_cpu_cores = `nproc`.to_i
-
-test_failed = false
-
-min_freq = 0
-max_freq = 10000
-
-printf("CPU stress test, which is doing JPEG decoding by libjpeg-turbo\n")
-printf("at different cpufreq operating points.\n")
-
-if ARGV[0] and ARGV[1] then
- min_freq = [ARGV[0].to_i, ARGV[1].to_i].min
- max_freq = [ARGV[0].to_i, ARGV[1].to_i].max
- printf("\nTesting CPU clock frequencies between %d MHz and %d MHz\n",
- min_freq, max_freq)
-end
-
-0.upto(number_of_cpu_cores - 1) {|core|
- printf("\nTesting CPU %d\n", core)
- if not set_userspace_governor(core) then
- raise "Can't set the userspace cpufreq governor"
- end
-
- freq_list = get_freq_list(core)
- freq_list.sort.reverse.each {|freq|
- printf("%5d MHz ", freq / 1000)
- if freq < min_freq * 1000 or freq > max_freq * 1000 or not set_freq(core, freq)
- then
- printf("SKIPPED\n")
- next
- end
- subtest_failed = false
- expected_result = `taskset -c #{core} #{$djpeg} #{shellescaped_jpgname} | md5sum`
- 1.upto(60) {
- printf(".")
- STDOUT.flush
- if `taskset -c #{core} #{$djpeg} #{shellescaped_jpgname} | md5sum` != expected_result
- then
- subtest_failed = true
- break
- end
- }
- test_failed = true if subtest_failed
- printf(subtest_failed ? " FAILED\n" : " OK\n")
- }
-}
-
-printf("\nOverall result : %s\n", (test_failed ? "FAILED" : "PASSED"))
diff --git a/tools/cpuburn/gnuplot-sunxi-cpufreq b/tools/cpuburn/gnuplot-sunxi-cpufreq
deleted file mode 100644
index 858713c..0000000
--- a/tools/cpuburn/gnuplot-sunxi-cpufreq
+++ b/dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-require 'tempfile'
-
-# Test the availability of the required tools
-
-def tool_exists(tool_name)
- `which #{tool_name} > /dev/null 2>&1`
- if $?.to_i != 0 then
- printf("Error: the required '%s' executable is not found in PATH\n", tool_name)
- return false
- else
- return true
- end
-end
-
-exit(1) if not tool_exists("gnuplot")
-
-pngfile = nil
-cpufreq_src_files = []
-
-ARGV.each {|a|
- if a =~ /\.png$/ then
- pngfile = a
- else
- cpufreq_src_files.push(a) if File.exists?(a)
- end
-}
-
-if not pngfile or cpufreq_src_files.size == 0 then
- printf("Usage: #{$PROGRAM_NAME} <png_file> <cpufreq_src_file> [cpufreq_src_file]\n")
- printf("Where:\n")
- printf(" png_file - resulting PNG file with the plot.\n")
- printf(" cpufreq_src_file - source file with the cpufreq table\n")
- printf(" to parse (from the sunxi-3.4 kernel).\n")
- exit(1)
-end
-
-data = {}
-# Parse the linux-sunxi cpufreq tables
-tablename = nil
-cpufreq_src_files.each {|filename|
- File.open(filename).each_line {|l|
- if l =~ /static struct cpufreq_dvfs (.*?)[_]?dvfs_table\[\]/ then
- tablename = $1
- tablename = "unknown" if tablename == ""
- data[tablename] = [] if not data.has_key?(tablename)
- end
- if l =~ /\.freq\s*\=\s*(\d+),\s*\.volt\s*\=\s*(\d+)/ then
- freq = $1.to_i / 1000000
- volt = $2.to_f / 1000
- if freq == 0 then
- tablename = nil
- end
- data[tablename].push([freq, volt]) if tablename
- end
- }
-}
-
-# Prepare and feed data to gnuplot
-tmpfiles = {}
-data.each {|tablename, data|
- tmpfiles[tablename] = Tempfile.new(tablename)
- data.each {|v|
- tmpfiles[tablename].printf("%f %f\n", v[0], v[1])
- }
- tmpfiles[tablename].flush
-}
-
-IO.popen("gnuplot", "w") {|fh|
- fh.write "
- set terminal png size 1600, 900
- set output '#{pngfile}'
- set format y '%.3f'
- set xtics 48
- set ytics 0.025
- set grid xtics ytics
- set yrange [0.9:1.575]
- set xlabel 'CPU clock frequency, MHz'
- set ylabel 'Required core voltage for reliable operation, V'
- set style line 1 lc rgb 'blue' linewidth 10
- set style line 2 lc rgb 'cyan' linewidth 8
- set style line 3 lc rgb 'orange' linewidth 6
- set style line 4 lc rgb 'brown' linewidth 4
- "
- plotdata = data.sort.map.with_index {|x, i|
- "'%s' using 1:2 with linespoints ls #{i + 1} title '%s'" %
- [tmpfiles[x[0]].path, x[0]]
- }
- fh.printf("plot %s\n", plotdata.join(","))
-}