change kernbench into kernbench.cr
Signed-off-by: Lu Kaiyi 2392863668@qq.com --- stats/crystal/kernbench.cr | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/stats/crystal/kernbench.cr b/stats/crystal/kernbench.cr index 0da37fe88..9777a11ca 100644 --- a/stats/crystal/kernbench.cr +++ b/stats/crystal/kernbench.cr @@ -1,28 +1,26 @@ -#!/usr/bin/env ruby +#!/usr/bin/env crystal
-LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME))) +require "../../lib/statistics"
-require "#{LKP_SRC}/lib/statistics" - -$stdin.each_line do |line| +STDIN.each_line do |line| case line when /Elapsed Time/ - puts 'elapsed_time: ' + line.split[2] - puts 'elapsed_time_stddev: ' + line.split[3].gsub(/[()]/, "") + puts "elapsed_time: " + line.split[2] + puts "elapsed_time_stddev: " + line.split[3].gsub(/[()]/, "") when /User Time/ - puts 'user_time: ' + line.split[2] - puts 'user_time_stddev: ' + line.split[3].gsub(/[()]/, "") + puts "user_time: " + line.split[2] + puts "user_time_stddev: " + line.split[3].gsub(/[()]/, "") when /System Time/ - puts 'system_time: ' + line.split[2] - puts 'system_time_stddev: ' + line.split[3].gsub(/[()]/, "") + puts "system_time: " + line.split[2] + puts "system_time_stddev: " + line.split[3].gsub(/[()]/, "") when /Percent CPU/ - puts 'percent_cpu: ' + line.split[2] - puts 'percent_cpu_stddev: ' + line.split[3].gsub(/[()]/, "") + puts "percent_cpu: " + line.split[2] + puts "percent_cpu_stddev: " + line.split[3].gsub(/[()]/, "") when /Context Switches/ - puts 'context_switches: ' + line.split[2] - puts 'context_switches_stddev: ' + line.split[3].gsub(/[()]/, "") + puts "context_switches: " + line.split[2] + puts "context_switches_stddev: " + line.split[3].gsub(/[()]/, "") when /Sleeps/ - puts 'sleeps: ' + line.split[1] - puts 'sleeps_stddev: ' + line.split[2].gsub(/[()]/, "") + puts "sleeps: " + line.split[1] + puts "sleeps_stddev: " + line.split[2].gsub(/[()]/, "") end end
There are tools to help automate some common conversions. Better make a standalone patch for the automated conversion. The changelog should show how you run the tool.
Then do another patch for manual changes.
Thanks, Fengguang
On Thu, Jan 07, 2021 at 03:07:06PM +0800, Lu Kaiyi wrote:
change kernbench into kernbench.cr
Signed-off-by: Lu Kaiyi 2392863668@qq.com
stats/crystal/kernbench.cr | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/stats/crystal/kernbench.cr b/stats/crystal/kernbench.cr index 0da37fe88..9777a11ca 100644 --- a/stats/crystal/kernbench.cr +++ b/stats/crystal/kernbench.cr @@ -1,28 +1,26 @@ -#!/usr/bin/env ruby +#!/usr/bin/env crystal
-LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME))) +require "../../lib/statistics"
-require "#{LKP_SRC}/lib/statistics"
-$stdin.each_line do |line| +STDIN.each_line do |line| case line when /Elapsed Time/
- puts 'elapsed_time: ' + line.split[2]
- puts 'elapsed_time_stddev: ' + line.split[3].gsub(/[()]/, "")
- puts "elapsed_time: " + line.split[2]
- puts "elapsed_time_stddev: " + line.split[3].gsub(/[()]/, "") when /User Time/
- puts 'user_time: ' + line.split[2]
- puts 'user_time_stddev: ' + line.split[3].gsub(/[()]/, "")
- puts "user_time: " + line.split[2]
- puts "user_time_stddev: " + line.split[3].gsub(/[()]/, "") when /System Time/
- puts 'system_time: ' + line.split[2]
- puts 'system_time_stddev: ' + line.split[3].gsub(/[()]/, "")
- puts "system_time: " + line.split[2]
- puts "system_time_stddev: " + line.split[3].gsub(/[()]/, "") when /Percent CPU/
- puts 'percent_cpu: ' + line.split[2]
- puts 'percent_cpu_stddev: ' + line.split[3].gsub(/[()]/, "")
- puts "percent_cpu: " + line.split[2]
- puts "percent_cpu_stddev: " + line.split[3].gsub(/[()]/, "") when /Context Switches/
- puts 'context_switches: ' + line.split[2]
- puts 'context_switches_stddev: ' + line.split[3].gsub(/[()]/, "")
- puts "context_switches: " + line.split[2]
- puts "context_switches_stddev: " + line.split[3].gsub(/[()]/, "") when /Sleeps/
- puts 'sleeps: ' + line.split[1]
- puts 'sleeps_stddev: ' + line.split[2].gsub(/[()]/, "")
- puts "sleeps: " + line.split[1]
- puts "sleeps_stddev: " + line.split[2].gsub(/[()]/, "") end
end
2.23.0