From: Carl E. L. <ce...@li...> - 2014-02-14 21:03:51
|
Maynard: The following patch addresses an issue with the latest development version of OProfile. The issue is the time units for the --time-interval command line argument to ocount changed from seconds in the released versions to milliseconds in the current git development version. The patch now checks what version of ocount is running and adjusts the input parameter as needed to get the desired run time. The patch has been tested on Power for both the released 0.9.9 version and for 1.0.0-git version. Carl Love ---------------------------------------------------------------------- Ocount, fix run time parameter The units for the --time-interval was changed from units of seconds to units of milliseconds in version 1.0. This patch sets the --time-interval appropriately for version 1.0 and for previous versions. Signed-off-by: Carl Love <ca...@us...> --- .../cycle-check-ocount/ocount-cycle-check-run.exp | 18 ++++++- testsuite/oprofile-ocount/ocount-run.exp | 57 +++++++++++++++++++--- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp b/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp index a43c15e..5ddacef 100644 --- a/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp +++ b/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp @@ -20,7 +20,10 @@ load_lib "ocount_util.exp" +set ocount_version "" + proc do_test_ocount_cycle_test {workload_exec output_format} { + global ocount_version # Get processor frequency in Hz set freq [get_cpu_frequency] @@ -31,14 +34,27 @@ proc do_test_ocount_cycle_test {workload_exec output_format} { # idle. set event [get_cycles_event] + + # run for interval of one second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the run time-interval is in units of seconds. + set run_time_interval $interval + } + {1.*} { + # Version 1.0 and beyond run time-interval is in units of milliseconds + set run_time_interval [expr 1000 * $interval] + } + } + set pid [exec $workload_exec > /tmp/junky.xwyesu.xse &] # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result [local_exec "ocount $output_format -e $event --time-interval $interval:1 -p $pid " "" "" 60] + set result [local_exec "ocount $output_format -e $event --time-interval $run_time_interval:1 -p $pid " "" "" 60] test_kill_workload $pid diff --git a/testsuite/oprofile-ocount/ocount-run.exp b/testsuite/oprofile-ocount/ocount-run.exp index 8ac9fbd..c02944f 100644 --- a/testsuite/oprofile-ocount/ocount-run.exp +++ b/testsuite/oprofile-ocount/ocount-run.exp @@ -23,17 +23,30 @@ set ocount_version 0 proc do_test_ocount_cycle_test {workload_exec output_format} { + global ocount_version # Check that counting cycles for "interval" seconds is non-zero set event [get_cycles_event] + + # run for one second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the run time-interval is in units of seconds. + set run_time_interval $interval + } + {1.*} { + # Version 1.0 and beyond the run time-interval is in units of milliseconds + set run_time_interval [expr $interval * 1000] + } + } set pid [exec $workload_exec > /tmp/junky.xwyesu.xse &] # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result [local_exec "ocount $output_format -e $event --time-interval $interval:1 -p $pid " "" "" 60] + set result [local_exec "ocount $output_format -e $event --time-interval $run_time_interval:1 -p $pid " "" "" 60] test_kill_workload $pid @@ -55,13 +68,30 @@ proc do_test_ocount_cycle_test {workload_exec output_format} { } proc do_test_ocount_scaling {workload_exec} { + global ocount_version # The actual result is expected to be within the following percent of the # actual count set percent 5 + + # Test sample intervals of 1, 2, 4 seconds set interval1 1 set interval2 2 set interval4 4 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the time interval is in units of seconds. + set run_time_interval1 $interval1 + set run_time_interval2 $interval2 + set run_time_interval4 $interval4 + } + {1.*} { + # Version 1.0 and beyond time interval is in units of milliseconds + set run_time_interval1 [expr $interval1 * 1000] + set run_time_interval2 [expr $interval2 * 1000] + set run_time_interval4 [expr $interval4 * 1000] + } + } set event [get_cycles_event] @@ -70,9 +100,9 @@ proc do_test_ocount_scaling {workload_exec} { # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result1 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval1:1 -p $pid" "" "" 60] - set result2 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval2:1 -p $pid" "" "" 60] - set result4 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval4:1 -p $pid" "" "" 60] + set result1 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval1:1 -p $pid" "" "" 60] + set result2 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval2:1 -p $pid" "" "" 60] + set result4 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval4:1 -p $pid" "" "" 60] test_kill_workload $pid @@ -110,11 +140,24 @@ proc do_test_ocount_scaling {workload_exec} { } proc do_test_ocount_modes {workload_exec} { + global ocount_version # The actual result is expected to be within the following percent of the # actual count set percent 5 + + # test for 1 second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the time interval is in units of seconds. + set run_time_interval $interval + } + {1.*} { + # Version 1.0 and beyond time interval is in units of milliseconds + set run_time_interval [expr $interval * 1000] + } + } set event [get_cycles_event] @@ -125,11 +168,11 @@ proc do_test_ocount_modes {workload_exec} { # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set user_result [local_exec "taskset -c 0 ocount -e ${event}:0:0:1 --time-interval $interval:1 -p $pid" "" "" 60] + set user_result [local_exec "taskset -c 0 ocount -e ${event}:0:0:1 --time-interval $run_time_interval:1 -p $pid" "" "" 60] - set kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:0 --time-interval $interval:1 -p $pid" "" "" 60] + set kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:0 --time-interval $run_time_interval:1 -p $pid" "" "" 60] - set user_kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:1 --time-interval $interval:1 -p $pid" "" "" 60] + set user_kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:1 --time-interval $run_time_interval:1 -p $pid" "" "" 60] test_kill_workload $pid -- 1.8.4.2 |
From: Carl E. L. <ce...@li...> - 2014-02-14 22:31:21
|
On Fri, 2014-02-14 at 13:03 -0800, Carl E. Love wrote: > Maynard: > > The following patch addresses an issue with the latest development > version of OProfile. The issue is the time units for the > --time-interval command line argument to ocount changed from seconds in > the released versions to milliseconds in the current git development > version. The patch now checks what version of ocount is running and > adjusts the input parameter as needed to get the desired run time. > > The patch has been tested on Power for both the released 0.9.9 version > and for 1.0.0-git version. > > Carl Love Maynard: I realized after I posted the patch that the case {1.*} will be a bit of a maintenance headache when we hit version 2.*. I changed the case statements to check for version {0.*} or {*} for versions 1.0 and beyond. Carl Love ------------------------------------------------------------------ Ocount, fix run time parameter The units for the --time-interval was changed from units of seconds to units of milliseconds in version 1.0. This patch sets the --time-interval appropriately for version 1.0 and for previous versions. Signed-off-by: Carl Love <ca...@us...> --- .../cycle-check-ocount/ocount-cycle-check-run.exp | 19 ++++++- testsuite/oprofile-ocount/ocount-run.exp | 57 +++++++++++++++++--- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp b/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp index a43c15e..20f2705 100644 --- a/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp +++ b/testsuite/cycle-check-ocount/ocount-cycle-check-run.exp @@ -1,3 +1,4 @@ + # ocount-cycle-check-run.exp # Copyright (C) 2013 IBM # @@ -20,7 +21,10 @@ load_lib "ocount_util.exp" +set ocount_version "" + proc do_test_ocount_cycle_test {workload_exec output_format} { + global ocount_version # Get processor frequency in Hz set freq [get_cpu_frequency] @@ -31,14 +35,27 @@ proc do_test_ocount_cycle_test {workload_exec output_format} { # idle. set event [get_cycles_event] + + # run for interval of one second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the run time-interval is in units of seconds. + set run_time_interval $interval + } + {*} { + # Version 1.0 and beyond run time-interval is in units of milliseconds + set run_time_interval [expr 1000 * $interval] + } + } + set pid [exec $workload_exec > /tmp/junky.xwyesu.xse &] # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result [local_exec "ocount $output_format -e $event --time-interval $interval:1 -p $pid " "" "" 60] + set result [local_exec "ocount $output_format -e $event --time-interval $run_time_interval:1 -p $pid " "" "" 60] test_kill_workload $pid diff --git a/testsuite/oprofile-ocount/ocount-run.exp b/testsuite/oprofile-ocount/ocount-run.exp index 8ac9fbd..6bac65d 100644 --- a/testsuite/oprofile-ocount/ocount-run.exp +++ b/testsuite/oprofile-ocount/ocount-run.exp @@ -23,17 +23,30 @@ set ocount_version 0 proc do_test_ocount_cycle_test {workload_exec output_format} { + global ocount_version # Check that counting cycles for "interval" seconds is non-zero set event [get_cycles_event] + + # run for one second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the run time-interval is in units of seconds. + set run_time_interval $interval + } + {*} { + # Version 1.0 and beyond the run time-interval is in units of milliseconds + set run_time_interval [expr $interval * 1000] + } + } set pid [exec $workload_exec > /tmp/junky.xwyesu.xse &] # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result [local_exec "ocount $output_format -e $event --time-interval $interval:1 -p $pid " "" "" 60] + set result [local_exec "ocount $output_format -e $event --time-interval $run_time_interval:1 -p $pid " "" "" 60] test_kill_workload $pid @@ -55,13 +68,30 @@ proc do_test_ocount_cycle_test {workload_exec output_format} { } proc do_test_ocount_scaling {workload_exec} { + global ocount_version # The actual result is expected to be within the following percent of the # actual count set percent 5 + + # Test sample intervals of 1, 2, 4 seconds set interval1 1 set interval2 2 set interval4 4 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the time interval is in units of seconds. + set run_time_interval1 $interval1 + set run_time_interval2 $interval2 + set run_time_interval4 $interval4 + } + {*} { + # Version 1.0 and beyond time interval is in units of milliseconds + set run_time_interval1 [expr $interval1 * 1000] + set run_time_interval2 [expr $interval2 * 1000] + set run_time_interval4 [expr $interval4 * 1000] + } + } set event [get_cycles_event] @@ -70,9 +100,9 @@ proc do_test_ocount_scaling {workload_exec} { # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set result1 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval1:1 -p $pid" "" "" 60] - set result2 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval2:1 -p $pid" "" "" 60] - set result4 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $interval4:1 -p $pid" "" "" 60] + set result1 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval1:1 -p $pid" "" "" 60] + set result2 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval2:1 -p $pid" "" "" 60] + set result4 [local_exec "taskset -c 0 ocount -e ${event} --time-interval $run_time_interval4:1 -p $pid" "" "" 60] test_kill_workload $pid @@ -110,11 +140,24 @@ proc do_test_ocount_scaling {workload_exec} { } proc do_test_ocount_modes {workload_exec} { + global ocount_version # The actual result is expected to be within the following percent of the # actual count set percent 5 + + # test for 1 second set interval 1 + case $ocount_version { + { 0.*} { + # Prior to version 1.0 the time interval is in units of seconds. + set run_time_interval $interval + } + {*} { + # Version 1.0 and beyond time interval is in units of milliseconds + set run_time_interval [expr $interval * 1000] + } + } set event [get_cycles_event] @@ -125,11 +168,11 @@ proc do_test_ocount_modes {workload_exec} { # allow workload to reach steady state local_exec "sleep 1" "" "" 10 - set user_result [local_exec "taskset -c 0 ocount -e ${event}:0:0:1 --time-interval $interval:1 -p $pid" "" "" 60] + set user_result [local_exec "taskset -c 0 ocount -e ${event}:0:0:1 --time-interval $run_time_interval:1 -p $pid" "" "" 60] - set kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:0 --time-interval $interval:1 -p $pid" "" "" 60] + set kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:0 --time-interval $run_time_interval:1 -p $pid" "" "" 60] - set user_kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:1 --time-interval $interval:1 -p $pid" "" "" 60] + set user_kernel_result [local_exec "taskset -c 0 ocount -e ${event}:0:1:1 --time-interval $run_time_interval:1 -p $pid" "" "" 60] test_kill_workload $pid -- 1.7.1 |
From: Maynard J. <may...@us...> - 2014-02-17 15:42:17
|
On 02/14/2014 04:31 PM, Carl E. Love wrote: > On Fri, 2014-02-14 at 13:03 -0800, Carl E. Love wrote: >> Maynard: >> >> The following patch addresses an issue with the latest development >> version of OProfile. The issue is the time units for the >> --time-interval command line argument to ocount changed from seconds in >> the released versions to milliseconds in the current git development >> version. The patch now checks what version of ocount is running and >> adjusts the input parameter as needed to get the desired run time. >> >> The patch has been tested on Power for both the released 0.9.9 version >> and for 1.0.0-git version. >> >> Carl Love > > Maynard: > > I realized after I posted the patch that the case {1.*} will be > a bit of a maintenance headache when we hit version 2.*. I changed > the case statements to check for version {0.*} or {*} for versions > 1.0 and beyond. > > Carl Love > > ------------------------------------------------------------------ > Ocount, fix run time parameter > > The units for the --time-interval was changed from units of seconds to > units of milliseconds in version 1.0. This patch sets the --time-interval > appropriately for version 1.0 and for previous versions. > > Signed-off-by: Carl Love <ca...@us...> > --- > .../cycle-check-ocount/ocount-cycle-check-run.exp | 19 ++++++- > testsuite/oprofile-ocount/ocount-run.exp | 57 +++++++++++++++++--- > 2 files changed, 68 insertions(+), 8 deletions(-) > Thanks, Carl. Patch applied. -Maynard [snip] |