Re: Let's talk about boot loaders

2016-05-05 Thread Amit Kucheria
On Thu, May 5, 2016 at 9:29 PM, Mark Brown <broo...@kernel.org> wrote:
> On Thu, May 05, 2016 at 09:01:05PM +0530, Amit Kucheria wrote:
>> On Thu, May 5, 2016 at 5:15 PM, Marcin Juszkiewicz
>
>> > Solution for existing SoCs is usually adding 1MB of SPI flash during design
>> > phase of device and store boot loader(s) there. But it is so expensive
>> > someone would say when it is in 10-30 cents range...
>
>> > Even 96boards CE specification totally ignored that fact while it could be 
>> > a
>> > way of showing how to make popular board. Instead it became
>> > yet-another-board-to-laugh (EE spec did not improve much).
>
>> > Is there a way to get it improved? At least for new designs?
>
>> Yes! I've added this suggestion to a list of suggestions for evolution
>> of the 96boards spec.
>
> We already went round the houses repeatedly on that one :(

Yes, but it wasn't in the list. So if we want to reject something (or
make it optional), I'd like us to document why we reached that
decision for posterity.

As Grant mentioned elsewhere, the single-storage device configuration
seems to be where a lot of the vendors seem to be focusing on.
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Let's talk about boot loaders

2016-05-05 Thread Amit Kucheria
On Thu, May 5, 2016 at 5:15 PM, Marcin Juszkiewicz
 wrote:



> Solution for existing SoCs is usually adding 1MB of SPI flash during design
> phase of device and store boot loader(s) there. But it is so expensive
> someone would say when it is in 10-30 cents range...
>
> Even 96boards CE specification totally ignored that fact while it could be a
> way of showing how to make popular board. Instead it became
> yet-another-board-to-laugh (EE spec did not improve much).
>
> Is there a way to get it improved? At least for new designs?

Yes! I've added this suggestion to a list of suggestions for evolution
of the 96boards spec.
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [Dev] Reference platform kernel on github

2016-03-02 Thread Amit Kucheria
Hi Zoltan,

We've already enabled DRM on the 4.4 kernel with the framebuffer Xorg
driver. What do you need on top of that to enable you do run
Wayland/Weston? A link to a patchset would allow me to evaluate
whether we can incorporate these into the next release.

Regards,
Amit

On Wed, Mar 2, 2016 at 3:54 PM, Zoltan Kuscsik
<zoltan.kusc...@linaro.org> wrote:
> Hi Amit,
>
>   are you planning to support DRM/KMS on 4.4 Kernel/Hikey? At LHG we are
> currently using a 4.5 Kernel snapshot with Wayland/Weston due to incomplete
> support of DRM/KMS extensions on 4.4.
> The main issue we saw on the 4.4 was the missing VBlank support in the DRM
> driver.
>
> Br,
>
> Zoltan
>
> On 2 March 2016 at 10:53, Amit Kucheria <amit.kuche...@linaro.org> wrote:
>>
>> Hi all,
>>
>> For the upcoming 16.03 release of the reference platform, we've been
>> working on a unified kernel that works on Hikey, Dragonboard 410c and
>> also enables enterprise HW that we have access to (D02, Overdrive, APM
>> XGene).
>>
>> That kernel is now pushed to github[1] to the 96b/releases/2016.03
>> branch. It is based on the upstream kernel v4.4 and combines the work
>> from the Hisilicon and Qualcomm landing teams with the enterprise bits
>> coming from the Linaro Enterprise Group. A big thanks for their
>> assistance in sorting out various integration issues.
>>
>> Please note that this kernel tree will now be used only to host a
>> unified kernel. The Hisilicon landing team has graciously agreed to
>> modify their workflow and move their kernel tree to the 96boards-hikey
>> namespace[2] on github.
>>
>> I'll be talking about the experience of putting together this tree at
>> Connect BKK16 (including some patch statistics) and soliciting
>> feedback on the roadmap for this kernel tree - please get in touch if
>> you have ideas.
>>
>> Look forward to more information about the release itself from Ricardo
>> later.
>>
>> Regards,
>> Amit
>>
>> [1] https://github.com/96boards/linux.git
>> [2] https://github.com/96boards-hikey
>> ___
>> Dev mailing list
>> d...@lists.96boards.org
>> https://lists.96boards.org/mailman/listinfo/dev
>
>
>
>
> --
> Zoltan Kuscsik
>
> Senior Software Developer, Linaro Digital Home Group
> email: zoltan.kusc...@linaro.org
> IRC: zoli_ on irc.linaro.org
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Reference platform kernel on github

2016-03-02 Thread Amit Kucheria
Hi all,

For the upcoming 16.03 release of the reference platform, we've been
working on a unified kernel that works on Hikey, Dragonboard 410c and
also enables enterprise HW that we have access to (D02, Overdrive, APM
XGene).

That kernel is now pushed to github[1] to the 96b/releases/2016.03
branch. It is based on the upstream kernel v4.4 and combines the work
from the Hisilicon and Qualcomm landing teams with the enterprise bits
coming from the Linaro Enterprise Group. A big thanks for their
assistance in sorting out various integration issues.

Please note that this kernel tree will now be used only to host a
unified kernel. The Hisilicon landing team has graciously agreed to
modify their workflow and move their kernel tree to the 96boards-hikey
namespace[2] on github.

I'll be talking about the experience of putting together this tree at
Connect BKK16 (including some patch statistics) and soliciting
feedback on the roadmap for this kernel tree - please get in touch if
you have ideas.

Look forward to more information about the release itself from Ricardo later.

Regards,
Amit

[1] https://github.com/96boards/linux.git
[2] https://github.com/96boards-hikey
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2] Update the README file

2015-04-21 Thread Amit Kucheria
On Mon, Apr 20, 2015 at 10:03 PM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Update the README file with bugs, questions, and contribution
 sections and fix the format for readability.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org

Feel free to add my ack and commit.

 ---
 Changes in v2:
 * Removed references to LAVA
 * Rewritten Additional Notes section of README
 * Replace the phrase Linux devices with hardware to be more generic

  README | 76 
 --
  1 file changed, 60 insertions(+), 16 deletions(-)

 diff --git a/README b/README
 index 2eef1c4..b976727 100644
 --- a/README
 +++ b/README
 @@ -1,5 +1,5 @@
 -General Info
 -
 +Commands
 +
  - In order to run the tests, invoke as root:

 make check
 @@ -12,20 +12,64 @@ General Info

 make -C cpufreq check

 -- The test specifications can be found at
 +
 +Test Specifications
 +===
 +The test specifications can be found at:

  
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification

 -Other info
 -==
 -- PM-QA is one of the tools in the external opensource modules in the 
 external
 -  path of android. For building on android, the makefile Android.mk is used 
 to
 -  build the testsuite with a makefile for each subtest.
 -- Incase you are extending a subtest, say a new script which will test a
 -  feature. Add the test number in the Android.mk, in addition to this if its
 -  using a source file (say .c), add the source file in the Android.mk so that
 -  it gets built.
 -- LAVA scripts are used to trigger the pm-qa tests.
 -- Similarly for non-android adding a script and txt (test description) pair 
 is
 -  needed to extent the suite.
 -===
 +
 +Bugs
 +
 +If you believe that you have encountered a bug, please file a bug report on
 +Linaro Bugzilla at https://bugs.linaro.org. Once you log in, click on
 +New -- Power Management -- PM-QA as the component. Then fill
 +in the form.
 +
 +Helpful tips for filing a bug report:
 +1. Provide logs, be verbose as possible
 +2. Outline steps to reproduce the bug
 +3. Describe the environment you are running PM-QA on (e.g. Android,
 +OpenEmbedded, Ubuntu, etc.)
 +4. What hardware you're using
 +
 +Questions/Comments
 +==
 +Please submit questions and comments to the linaro-dev mailing list at
 +linaro-dev@lists.linaro.org with PM-QA as part of the subject.
 +
 +Contributions
 +=
 +If you wish to submit patches to improve PM-QA, please send them to
 +the linaro-dev mailing list at linaro-dev@lists.linaro.org with
 +PATCH PM-QA as the subject prefix.
 +
 +All scripts in PM-QA must be POSIX-compliant and cannot use any
 +bashisms. At a minimum, they must run in Android and Ubuntu
 +environment and have text files that include their descriptions.
 +
 +Additional notes on new tests
 +=
 +PM-QA can be extended with more functional tests by following a few
 +simple rules.
 +
 +a. Add the test (usually a shell script) and its associated
 +description (in a .txt file with the same name) in the appropriate
 +subdirectory
 +b. Change the Android.mk makefile in the subdirectory as appropriate.
 +You will need to change the 'test_num' variable at a minimum. If
 +you're using other source files (say .c), add that to the makefile as
 +well.
 +c. Create a draft specification for your test that can be added to the
 +wiki page[1]
 +d. Make sure your shell scripts do not use bash-specific constructs.
 +Run them with the #!/bin/sh as the interpreter directive instead of
 +#!/bin/bash.
 +e. PM-QA can be found in the external opensource modules in the
 +external path of android sources hosted at Linaro. It is synced with
 +the latest version of PM-QA everytime a new release is made.
 +Android.mk makefiles are used to build the test suite - there is one in
 +each sub-directory.
 +
 +[1] 
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification
 --
 1.9.1

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA] Update the README file

2015-04-15 Thread Amit Kucheria
On Wed, Apr 15, 2015 at 3:32 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Update the README file with bugs, questions, and contribution
 sections and fix the format for readability.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  README |   46 +++---
  1 file changed, 39 insertions(+), 7 deletions(-)

 diff --git a/README b/README
 index 2eef1c4..5da4485 100644
 --- a/README
 +++ b/README
 @@ -1,5 +1,5 @@
 -General Info
 -
 +Commands
 +
  - In order to run the tests, invoke as root:

 make check
 @@ -12,20 +12,52 @@ General Info

 make -C cpufreq check

 -- The test specifications can be found at
 +
 +Test Specifications
 +===
 +The test specifications can be found at:

  
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification

 -Other info
 -==
 +
 +Bugs
 +
 +If you believe that you have encountered a bug, please file a bug report on
 +Linaro Bugzilla at https://bugs.linaro.org. Once you log in, click on
 +New -- Power Management -- PM-QA as the component. Then fill
 +in the form.
 +
 +Helpful tips for filing a bug report:
 +1. Provide logs, be verbose as possible
 +2. Outline steps to reproduce the bug
 +3. Describe the environment you are running PM-QA on (e.g. Android,
 +OpenEmbedded, Ubuntu, etc.)
 +4. What Linux device(s) you're using

s/Linux//
s/devices/HW/

 +
 +Questions/Comments
 +==
 +Please submit questions and comments to the linaro-dev mailing list at
 +linaro-dev@lists.linaro.org with PM-QA as part of the subject.
 +
 +Contributions
 +=
 +If you wish to submit patches to improve PM-QA, please send them to
 +the linaro-dev mailing list at linaro-dev@lists.linaro.org with
 +PATCH PM-QA as the subject prefix.
 +
 +All scripts in PM-QA must be POSIX-compliant and cannot use any
 +bashisms. At a minimum, they must run in Android and Ubuntu
 +environment and have text files that include their descriptions.
 +
 +Additional Notes
 +
  - PM-QA is one of the tools in the external opensource modules in the 
 external
path of android. For building on android, the makefile Android.mk is used 
 to
build the testsuite with a makefile for each subtest.
 -- Incase you are extending a subtest, say a new script which will test a
 +- In case you are extending a subtest, say a new script which will test a
feature. Add the test number in the Android.mk, in addition to this if its
using a source file (say .c), add the source file in the Android.mk so that
it gets built.
  - LAVA scripts are used to trigger the pm-qa tests.

Remove this line, PM-QA isn't exclusive to LAVA.

  - Similarly for non-android adding a script and txt (test description) pair 
 is
needed to extent the suite.
 -===

Consider rephrasing this last section as follows:

Additional notes on new tests
==
PM-QA can be extended with more functional tests by following a few
simple rules.

a. Add the test (usually a shell script) and its associated
description (in a .txt file with the same name) in the appropriate
subdirectory
b. Change the Android.mk makefile in the subdirectory as appropriate.
You will need to change the 'test_num' variable at a minimum. If
you're using other source files (say .c), add that to the makefile as
well.
c. Create a draft specification for your test that can be added to the
wiki page[1]
d. Make sure your shell scripts do not use bash-specific constructs.
Run them with the #!/bin/sh as the interpreter directive instead of
#!/bin/bash.
e. PM-QA can be found in the external opensource modules in the
external path of android sources hosted at Linaro. It is synced with
the latest version of PM-QA everytime a new release is made.
Android.mk makefiles are used to build the testsuite - there is one in
each sub-directory.

[1] 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v3] cputopology: add arm capacity calculation test

2015-04-05 Thread Amit Kucheria
On Fri, Apr 3, 2015 at 1:09 AM, Larry Bassel larry.bas...@linaro.org wrote:
 Add test which verifies capacity calculation on arm
 architecture platforms.

 Since there isn't yet a similar calculation done
 for arm64 platforms, this architecture isn't supported
 by this test (at least as of now).

Rephrase to This will work on any platform that uses foo() arch hook
to set cpu capacity. Currently only arm32 platforms use this. ?

 Signed-off-by: Larry Bassel larry.bas...@linaro.org
 ---
  cputopology/cputopology_04.sh  | 127 
 +
  cputopology/cputopology_04.txt |   1 +
  2 files changed, 128 insertions(+)
  create mode 100755 cputopology/cputopology_04.sh
  create mode 100644 cputopology/cputopology_04.txt

 diff --git a/cputopology/cputopology_04.sh b/cputopology/cputopology_04.sh
 new file mode 100755
 index 000..d66c1c8
 --- /dev/null
 +++ b/cputopology/cputopology_04.sh
 @@ -0,0 +1,127 @@
 +#!/bin/bash
 +#

Nack! Please replace with /bin/sh and test to make sure it still
works. Lisa, please pay attention to this one for future patches from
anybody.

 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2015, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 +#
 +# Contributors:
 +# Larry Bassel larry.bas...@linaro.org
 +#
 +
 +# URL : 
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cputopology_04

This link is not present. Can you add a section to the spec (and mark
it as draft). Otherwise, once patches get accepted, we'll forget to
update the spec.

Similarly, cputopology_03 section is also missing. So we're already
forgetting to update the spec.


 +source ../include/functions.sh
 +
 +calc_freq()
 +{
 +byte1=$1
 +byte2=$2
 +byte3=$3
 +byte4=$4
 +freq=$((byte1*0x100+byte2*0x1+byte3*0x100+byte4))
 +}
 +
 +set_eff() {

what is eff? perhaps a comment?

 +type=$1
 +
 +case $type in
 +arm,cortex-a15) eff=3891 ;;
 +arm,cortex-a7)  eff=2048 ;;
 +* ) eff=1024 ;;
 +esac
 +}
 +
 +calc_mid_capacity()

What is the significance of middle capacity? A comment perhaps?

 +{
 +dt_cpus=$(ls /sys/firmware/devicetree/base/cpus | grep cpu@[0-9].*)
 +min_capacity=$((0x))
 +max_capacity=0
 +sched_capacity_shift=10
 +
 +for dt_cpu in $dt_cpus; do
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency 
 ]; then
 +   log_skip no clock frequency file present
 +   return
 +fi
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; 
 then
 +   log_skip no compatible file present
 +   return
 +fi
 +filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
 +bytes=$(od -t u1 -A n $filename)
 +calc_freq $bytes
 +cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
 +   set_eff $cpu_type
 +   capacity=$((($freq20)*$eff))
 +   if [ $capacity -gt $max_capacity ]; then
 +   max_capacity=$capacity
 +   fi
 +   if [ $capacity -lt $min_capacity ]; then
 +   min_capacity=$capacity
 +   fi
 +if [ $(((4 * $max_capacity))) -lt $(((3 * ($max_capacity + 
 $min_capacity ]; then
 +middle_capacity=$((($min_capacity + 
 $max_capacity)($sched_capacity_shift+1)))
 +else
 +middle_capacity=$$max_capacity / 
 3)($sched_capacity_shift-1))+1))
 +fi
 +done
 +}
 +
 +cpu_num=0
 +
 +verify_cpu_capacity()
 +{
 +for dt_cpu in $dt_cpus; do
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency 
 ]; then
 +   log_skip no clock frequency file present
 +   return
 +fi
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; 
 then
 +   log_skip no compatible file present
 +   return
 +fi
 +filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
 +bytes=$(od -t u1 -A n $filename)
 +calc_freq $bytes
 +cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
 +   set_eff $cpu_type
 +   capacity=$((($freq20)*$eff/$middle_capacity))
 +   

Re: [PATCH PM-QA 2/2] cpufreq: Remove unnecessary checks

2015-03-24 Thread Amit Kucheria
On Thu, Feb 19, 2015 at 5:44 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 The check function already determines if a subtest fails, passes, or
 skips. No need to check for the return value of the command.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpufreq/cpufreq_08.sh |3 ---
  cpufreq/cpufreq_09.sh |6 --
  2 files changed, 9 deletions(-)

 diff --git a/cpufreq/cpufreq_08.sh b/cpufreq/cpufreq_08.sh
 index f81976d..7821897 100755
 --- a/cpufreq/cpufreq_08.sh
 +++ b/cpufreq/cpufreq_08.sh
 @@ -43,9 +43,6 @@ check_frequency() {
  kill $pid

  check 'userspace' $(frequnit $freq) is fixed test \$curfreq\ = 
 \$freq\
 -if [ $? != 0 ]; then
 -   return 1
 -fi

  return 0
  }
 diff --git a/cpufreq/cpufreq_09.sh b/cpufreq/cpufreq_09.sh
 index 2ba1652..3e40cbf 100755
 --- a/cpufreq/cpufreq_09.sh
 +++ b/cpufreq/cpufreq_09.sh
 @@ -41,9 +41,6 @@ check_powersave() {
  curfreq=$(get_frequency $cpu)

  check 'powersave' sets frequency to $(frequnit $minfreq) test 
 \$curfreq\ = \$minfreq\
 -if [ $? != 0 ]; then
 -   return 1
 -fi

Hmm, I'm confused. If you remove these, execution of the script
continues regardless of the the return code of check(). Is that
desirable?

We seem to do it in other places too...

  $CPUBURN $cpu 
  pid=$!
 @@ -53,9 +50,6 @@ check_powersave() {
  kill $pid

  check 'powersave' frequency $(frequnit $minfreq) is fixed test 
 \$curfreq\ = \$minfreq\
 -if [ $? -ne 0 ]; then
 -   return 1
 -fi

  return 0
  }
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2] cputopology: add scheduler domain flag test

2015-03-24 Thread Amit Kucheria
On Wed, Mar 11, 2015 at 1:08 AM, Larry Bassel larry.bas...@linaro.org wrote:
 On 10 Mar 15 12:30, Lisa Nguyen wrote:
 On 3 March 2015 at 13:02, Larry Bassel larry.bas...@linaro.org wrote:
 
  Add test which checks and prints scheduler domain flags.
 
  Signed-off-by: Larry Bassel larry.bas...@linaro.org
  ---
   cputopology/cputopology_03.sh  | 109 
  +
   cputopology/cputopology_03.txt |   1 +
   2 files changed, 110 insertions(+)
   create mode 100755 cputopology/cputopology_03.sh
   create mode 100644 cputopology/cputopology_03.txt
 
  diff --git a/cputopology/cputopology_03.sh b/cputopology/cputopology_03.sh
  new file mode 100755
  index 000..bfff5de
  --- /dev/null
  +++ b/cputopology/cputopology_03.sh
  @@ -0,0 +1,109 @@
  +#!/bin/sh
  +#
  +# PM-QA validation test suite for the power management on Linux
  +#
  +# Copyright (C) 2015, Linaro Limited.
  +#
  +# This program is free software; you can redistribute it and/or
  +# modify it under the terms of the GNU General Public License
  +# as published by the Free Software Foundation; either version 2
  +# of the License, or (at your option) any later version.
  +#
  +# This program is distributed in the hope that it will be useful,
  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  +# GNU General Public License for more details.
  +#
  +# You should have received a copy of the GNU General Public License
  +# along with this program; if not, write to the Free Software
  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
  02110-1301, USA.
  +#
  +# Contributors:
  +# Larry Bassel larry.bas...@linaro.org
  +#
  +
  +# URL : 
  https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cputopology_03
  +
  +. ../include/functions.sh
  +
  +is_flag_set() {
  +flag=$1
  +mask=$2
  +message=$3
  +
  +value=$(( $flag  $mask ))
  +
  +if [ $value -ne 0 ]; then
  +   echo $message set
  +else
  +   echo $message not set
  +fi
  +}
  +
  +are_flags_set() {
  +val=$1
  +domain_num=$2
  +
  +# flag value, flag description
  +set -- 0x80  domain$domain_num share cpu capacity flag 0x100  
  domain$domain_num share power domain flag 0x200  domain$domain_num 
  share cpu package resources flag
  +
  +if [ $(($# % 2)) -ne 0 ]; then
  +echo WARNING: malformed flag value, description in test
  +fi
  +
  +nflags=$(($# / 2))
  +i=1
  +
  +while [ $i -le $nflags ] ; do
  +   flagval=$((2*i-1))
  +eval var1=\${$flagval}
  +   flagstr=$((2*i))
  +eval var2=\${$flagstr}
  +is_flag_set $val $var1 $var2
  +   i=$(( i + 1))
  +done
  +}
  +
  +check_sched_domain_flags() {
  +
  +cpu_num=$1
  +domain_num=$2
  +
  +
  sched_domain_flags=/proc/sys/kernel/sched_domain/$cpu_num/domain$domain_num/flags
  +val=$(cat $sched_domain_flags)
  +
  +check sched_domain_flags (domain $domain_num) test \$val\ != 
  \-1\
  +printf domain$domain_num flag 0x%x\n $val
  +
  +mask=$((0x7fff))
  +unexpected_bits=$((val  ~mask))
  +
  +if [ $unexpected_bits -ne 0 ]; then
  +printf NOTE: unexpected flag bits 0x%x set\n $unexpected_bits
  +fi
  +
  +are_flags_set $val $domain_num
  +}
  +
  +check_all_sched_domain_flags() {
  +
  +sched_domain_0_path=/proc/sys/kernel/sched_domain/cpu0
  +
  +if [ ! -d $sched_domain_0_path ]; then
  +log_skip no sched_domain directory present
  +   return
  +fi
  +
  +n=0
  +
  +sched_domain_flags_path=/proc/sys/kernel/sched_domain/$1/domain0/flags
  +
  +while [ -e $sched_domain_flags_path ]; do
  +check_sched_domain_flags $1 $n
  +   n=$(( n + 1))
  +
  sched_domain_flags_path=/proc/sys/kernel/sched_domain/$1/domain$n/flags
  +done
  +}
  +
  +for_each_cpu check_all_sched_domain_flags 1 || exit 1
  +test_status_show
  diff --git a/cputopology/cputopology_03.txt 
  b/cputopology/cputopology_03.txt
  new file mode 100644
  index 000..e43de69
  --- /dev/null
  +++ b/cputopology/cputopology_03.txt
  @@ -0,0 +1 @@
  +test that the sched_domain files are present and show the topology 
  related flags
  --
  1.9.1
 

 Hi Larry,

 I ran your script on the chromebook2 with mainline v4 quickly, and
 these are the results I get:

 root@linaro-developer:~/pm-qa/cputopology# ./cputopology_03.sh
 cputopology_03.0/cpu0: checking sched_domain_flags (domain 0)...
 Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set
 cputopology_03.0/cpu1: checking sched_domain_flags (domain 0)...
 Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set
 

Re: [PATCH PM-QA v2] cputopology: add arm capacity calculation test

2015-03-24 Thread Amit Kucheria
Larry,

Could you also please attach the output of the script on your test platform?

Regards,
Amit

On Mon, Mar 9, 2015 at 3:55 AM, Larry Bassel larry.bas...@linaro.org wrote:
 Add test which verifies capacity calculation on arm
 architecture platforms.

 Since there isn't yet a similar calculation done
 for arm64 platforms, this architecture isn't supported
 by this test (at least as of now).

 Signed-off-by: Larry Bassel larry.bas...@linaro.org
 ---
  cputopology/cputopology_04.sh  | 137 
 +
  cputopology/cputopology_04.txt |   1 +
  2 files changed, 138 insertions(+)
  create mode 100755 cputopology/cputopology_04.sh
  create mode 100644 cputopology/cputopology_04.txt

 diff --git a/cputopology/cputopology_04.sh b/cputopology/cputopology_04.sh
 new file mode 100755
 index 000..26f611c
 --- /dev/null
 +++ b/cputopology/cputopology_04.sh
 @@ -0,0 +1,137 @@
 +#!/bin/bash
 +#
 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2015, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 +#
 +# Contributors:
 +# Larry Bassel larry.bas...@linaro.org
 +#
 +
 +# URL : 
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cputopology_04
 +
 +source ../include/functions.sh
 +
 +calc_freq()
 +{
 +byte1=$1
 +byte2=$2
 +byte3=$3
 +byte4=$4
 +freq=$((byte1*0x100+byte2*0x1+byte3*0x100+byte4))
 +}
 +
 +set_eff() {
 +type=$1
 +
 +case $type in
 +arm,cortex-a15) eff=3891 ;;
 +arm,cortex-a7)  eff=2048 ;;
 +* ) eff=1024 ;;
 +esac
 +}
 +
 +calc_mid_capacity()
 +{
 +dt_cpus=$(ls /sys/firmware/devicetree/base/cpus | grep cpu@[0-9].*)
 +min_capacity=$((0x))
 +max_capacity=0
 +sched_capacity_shift=10
 +
 +for dt_cpu in $dt_cpus; do
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency 
 ]; then
 +   log_skip no clock frequency file present
 +   return
 +fi
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; 
 then
 +   log_skip no compatible file present
 +   return
 +fi
 +filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
 +echo clock frequency file: $filename
 +bytes=$(od -t u1 -A n $filename)
 +calc_freq $bytes
 +echo clock frequency: $freq
 +cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
 +   echo cpu type: $cpu_type
 +   set_eff $cpu_type
 +   echo efficiency: $eff
 +   capacity=$((($freq20)*$eff))
 +   echo capacity: $capacity
 +   if [ $capacity -gt $max_capacity ]; then
 +   max_capacity=$capacity
 +   fi
 +   if [ $capacity -lt $min_capacity ]; then
 +   min_capacity=$capacity
 +   fi
 +if [ $(((4 * $max_capacity))) -lt $(((3 * ($max_capacity + 
 $min_capacity ]; then
 +middle_capacity=$((($min_capacity + 
 $max_capacity)($sched_capacity_shift+1)))
 +else
 +middle_capacity=$$max_capacity / 
 3)($sched_capacity_shift-1))+1))
 +fi
 +   echo min capacity: $min_capacity max: $max_capacity middle: 
 $middle_capacity
 +done
 +}
 +
 +cpu_num=0
 +
 +verify_cpu_capacity()
 +{
 +for dt_cpu in $dt_cpus; do
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency 
 ]; then
 +   log_skip no clock frequency file present
 +   return
 +fi
 +if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; 
 then
 +   log_skip no compatible file present
 +   return
 +fi
 +filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
 +echo clock frequency file: $filename
 +bytes=$(od -t u1 -A n $filename)
 +calc_freq $bytes
 +echo frequency: $freq
 +cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
 +   echo cpu type: $cpu_type
 +   set_eff $cpu_type
 +   echo efficiency: $eff
 +   capacity=$((($freq20)*$eff/$middle_capacity))
 +   expected_capacity_string=$(dmesg | grep CPU$cpu_num: update 
 cpu_capacity)
 +   

Re: [PATCH PM-QA v2] cputopology: add scheduler domain flag test

2015-03-24 Thread Amit Kucheria
On Tue, Mar 24, 2015 at 1:58 PM, Vincent Guittot
vincent.guit...@linaro.org wrote:
 On 24 March 2015 at 07:34, Amit Kucheria amit.kuche...@linaro.org wrote:
 On Wed, Mar 11, 2015 at 1:08 AM, Larry Bassel larry.bas...@linaro.org 
 wrote:

 root@linaro-developer:~/pm-qa/cputopology# ./cputopology_03.sh
 cputopology_03.0/cpu0: checking sched_domain_flags (domain 0)...   
  Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set
 cputopology_03.0/cpu1: checking sched_domain_flags (domain 0)...   
  Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set
 cputopology_03.0/cpu2: checking sched_domain_flags (domain 0)...   
  Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set
 cputopology_03.0/cpu3: checking sched_domain_flags (domain 0)...   
  Ok
 domain0 flag 0x102f
 domain0 share cpu capacity flag not set
 domain0 share power domain flag not set
 domain0 share cpu package resources flag not set

 cputopology_03: pass

 I'm not sure if printing the domain0 flag is still necessary except
 for debugging, but I'll let others comment.

 I think someone wanted all flags interpreted, personally
 I think this is overkill since the test IMHO should be focused
 on flags important to EAS, printing the flag value is a compromise
 between nothing and full interpretation.


 One question that I may have forgotten to ask you earlier: How did you
 define a test failure? AFAICT, I get the impression that the test
 passes every time, or if it will skip if the sched_domain directory
 doesn't exist. I haven't come across an instance where a subtest
 fails.

 Yes, I think the test isn't so much a pass/fail one than an informational
 one and the person running the test would need to know if the flag
 settings make sense. Do (any of you) have any better ideas here? Perhaps
 if the directory doesn't exist it should be a fail (if the EAS patches
 creating this directory weren't applied or were not working properly,
 the directory would not exist).

 I think the sched_domain directory is always present. Vincent?

 It's present only with debug config

Larry, this fact should be documented in the test description with the
name of the config option.

 I think the power domain flag is the interesting one for EAS but I'll
 defer to Vincent on whether we need to care about the others - e.g. we
 in case of cpu capacity we care about the values they're set to.

 We are interested in the 3 flags that are tested by the script: share
 capacity,share resources and share power domain
 These flags reflect the soc topology

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v2 1/2] rt-app: Add a script to tune parameters in json file

2015-03-05 Thread Amit Kucheria
On Thu, Mar 5, 2015 at 3:49 PM, Vincent Guittot
vincent.guit...@linaro.org wrote:
 On 19 November 2014 at 14:14, pi-cheng.chen pi-cheng.c...@linaro.org wrote:
 This scripts strips all comments in the input JSON file, modifies the
 parameters according to commnad line arguments, and write the content to a 
 new
 JSON file.

 Signed-off-by: Pi-Cheng Chen pi-cheng.c...@linaro.org
 ---
  doc/tune_json.py | 138 
 +++
  1 file changed, 138 insertions(+)
  create mode 100755 doc/tune_json.py

 diff --git a/doc/tune_json.py b/doc/tune_json.py
 new file mode 100755
 index 000..36746ff
 --- /dev/null
 +++ b/doc/tune_json.py
 @@ -0,0 +1,138 @@
 +#!/usr/bin/env python
 +
 +import collections
 +import argparse
 +import shutil
 +import os
 +import sys
 +import json
 +import re
 +
 +
 +def find_dict_by_key(doc, key):
 +if key in doc and type(doc[key]) is collections.OrderedDict:
 +return doc[key]
 +
 +for k in doc:
 +if type(doc[k]) is collections.OrderedDict:
 +return find_dict_by_key(doc[k], key)
 +
 +
 +def dict_find_and_replace_value(dic, key, val):
 +for k in dic:
 +if type(dic[k]) is collections.OrderedDict:
 +dict_find_and_replace_value(dic[k], key, val)
 +if k == key:
 +dic[k] = val
 +
 +
 +def dict_of_loading(dic):
 +if not 'run' in dic:
 +return False, None
 +
 +for k in dic:
 +if 'timer' in k and 'period' in dic[k]:
 +return True, k
 +else:
 +return False, None
 +
 +
 +def calculate_and_update_loading(dic, loading):
 +of_loading, timer_id = dict_of_loading(dic)
 +
 +if of_loading:
 +period = dic[timer_id]['period']
 +run = period * loading / 100
 +dic['run'] = run
 +
 +for k in dic:
 +if type(dic[k]) is collections.OrderedDict:
 +calculate_and_update_loading(dic[k], loading)
 +
 +
 +# strip comments in json file and load the file as a dict
 +def load_json_file(filename):
 +try:
 +f = open(filename, 'r')
 +except:
 +print 'ERROR: Unable to open %s' %filename
 +sys.exit(2)
 +
 +comment_re = re.compile(
 +'(^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?',
 +re.DOTALL | re.MULTILINE)
 +
 +content = ''.join(f.readlines())
 +
 +match = comment_re.search(content)
 +while match:
 +content = content[:match.start()] + content[match.end():]
 +match = comment_re.search(content)
 +
 +return 
 json.JSONDecoder(object_pairs_hook=collections.OrderedDict).decode(content)
 +
 +
 +def dump_json_file(doc, filename):
 +try:
 +fo = open(filename, 'w+')
 +except:
 +print 'ERROR: Unable to open %s' %filename
 +sys.exit(2)
 +
 +json.dump(doc, fo, indent=4, sort_keys=False)
 +fo.close()
 +
 +
 +if __name__ == '__main__':
 +tmp = 'tmp.json'

 your tmp file should be a bit more unique than tmp.json. I can imagine
 that the user of tune_json.py already has a tmp.json in the dir which
 will be overwritten by the script.
 You could add something like the current time stamp in the temporary
 file name to reduce the probability to overwrite a user's file

Or actually use the python standard library functions to generate
unique temporary files:
https://docs.python.org/2/library/tempfile.html

If you care about referencing the file externally, NamedTemporaryFile
might be the right method to use.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 13/25] Rewrite logic to check for sampling_rate

2015-02-02 Thread Amit Kucheria
On Tue, Feb 3, 2015 at 3:14 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 On 1 February 2015 at 22:00, Amit Kucheria amit.kuche...@linaro.org wrote:
 On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Set the sampling_rate to zero if the sampling_rate attribute cannot
 be found in either directories listed in the if condition. This will
 also resolve minor bugs where the sampling_rate is missing.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  include/functions.sh |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/include/functions.sh b/include/functions.sh
 index e3eb140..4486da8 100644
 --- a/include/functions.sh
 +++ b/include/functions.sh
 @@ -164,8 +164,10 @@ wait_latency() {
  # consider per-policy governor case
  if [ -e $CPU_PATH/$wait_latency_cpu/cpufreq/$gov ]; then
 sampling_rate=$(cat 
 $CPU_PATH/$wait_latency_cpu/cpufreq/$gov/sampling_rate)
 -else
 +elif [ -e $CPU_PATH/cpufreq/$gov/sampling_rate ]; then
  sampling_rate=$(cat $CPU_PATH/cpufreq/$gov/sampling_rate)
 +else
 +sampling_rate=0
  fi
  sampling_rate=$((sampling_rate * 1000)) # unit nsec


 Hmm, let us think about this a bit. In what situation will be not find
 a sampling rate for the governor? In the case where we are NOT using
 ondemand governor. This is expected on Android which uses the
 interactive governor.

 So the entire wait_latency() function is going to return somewhat
 incorrect values when run on Android.

 I agree.

 I suggest the following removing this patch from the series and
 properly fixing this problem by doing tests on ubuntu and android with
 ondemand and interactive respectively to figure out what variables
 should be read to get the sampling rate.

 The common errors I ran into were these ones without the patch:

 + gov=userspace
 + [ -e /sys/devices/system/cpu/cpu0/cpufreq/userspace ]
 + cat /sys/devices/system/cpu/cpufreq/userspace/sampling_rate
 cat: /sys/devices/system/cpu/cpufreq/userspace/sampling_rate: No such
 file or directory
 + sampling_rate=

 I'll see what results I get on Ubuntu and Android with ondemand and
 interactive respectively.

Read Documentation/cpu-freq/governors.txt for details on the knobs
available for ondemand. These knobs are specific to each governor for
tuning, so of course you won't find them with the userspace governor.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA 0/4] Minor sanity scripts adjustments

2015-02-02 Thread Amit Kucheria
On Tue, Feb 3, 2015 at 6:52 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 My previous patchset[1] had too many types of patches (cleanups,
 bug fixes, additions, etc.), so it will be broken up much further
 to make it easy on the eyes :)

 This particular set focuses on renaming existing sanity scripts,
 adding a new one to the cputopology test module, and if the
 changes look good, then update the Android makefiles to include
 the new test names. The PM-QA wiki[2] will be updated as well.

 [1] http://lists.linaro.org/pipermail/linaro-dev/2015-February/017797.html

 [2] https://wiki.linaro.org/WorkingGroups/PowerManagement/
 Resources/TestSuite/PmQaSpecification

Ack for this series.

 Lisa Nguyen (4):
   cpuhotplug: Rename 1_sanity_check files to cpuhotplug_00 files
   cpuhotplug: Rename z_sanity_check files to cpuhotplug_99 files
   cputopology: Add cputopology_sanity.sh
   Android: Update makefiles with new test numbers

  cpuhotplug/1_sanity_check.sh   |   40 -
  cpuhotplug/1_sanity_check.txt  |1 -
  cpuhotplug/Android.mk  |4 +--
  cpuhotplug/cpuhotplug_00.sh|   40 +
  cpuhotplug/cpuhotplug_00.txt   |1 +
  cpuhotplug/cpuhotplug_99.sh|   40 +
  cpuhotplug/cpuhotplug_99.txt   |1 +
  cpuhotplug/z_sanity_check.sh   |   40 -
  cpuhotplug/z_sanity_check.txt  |1 -
  cputopology/Android.mk |2 +-
  cputopology/cputopology_sanity.sh  |   49 
 
  cputopology/cputopology_sanity.txt |1 +
  12 files changed, 134 insertions(+), 86 deletions(-)
  delete mode 100755 cpuhotplug/1_sanity_check.sh
  delete mode 100644 cpuhotplug/1_sanity_check.txt
  create mode 100755 cpuhotplug/cpuhotplug_00.sh
  create mode 100644 cpuhotplug/cpuhotplug_00.txt
  create mode 100755 cpuhotplug/cpuhotplug_99.sh
  create mode 100644 cpuhotplug/cpuhotplug_99.txt
  delete mode 100755 cpuhotplug/z_sanity_check.sh
  delete mode 100644 cpuhotplug/z_sanity_check.txt
  create mode 100755 cputopology/cputopology_sanity.sh
  create mode 100644 cputopology/cputopology_sanity.txt

 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 13/25] Rewrite logic to check for sampling_rate

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Set the sampling_rate to zero if the sampling_rate attribute cannot
 be found in either directories listed in the if condition. This will
 also resolve minor bugs where the sampling_rate is missing.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  include/functions.sh |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/include/functions.sh b/include/functions.sh
 index e3eb140..4486da8 100644
 --- a/include/functions.sh
 +++ b/include/functions.sh
 @@ -164,8 +164,10 @@ wait_latency() {
  # consider per-policy governor case
  if [ -e $CPU_PATH/$wait_latency_cpu/cpufreq/$gov ]; then
 sampling_rate=$(cat 
 $CPU_PATH/$wait_latency_cpu/cpufreq/$gov/sampling_rate)
 -else
 +elif [ -e $CPU_PATH/cpufreq/$gov/sampling_rate ]; then
  sampling_rate=$(cat $CPU_PATH/cpufreq/$gov/sampling_rate)
 +else
 +sampling_rate=0
  fi
  sampling_rate=$((sampling_rate * 1000)) # unit nsec


Hmm, let us think about this a bit. In what situation will be not find
a sampling rate for the governor? In the case where we are NOT using
ondemand governor. This is expected on Android which uses the
interactive governor.

So the entire wait_latency() function is going to return somewhat
incorrect values when run on Android.

I suggest the following removing this patch from the series and
properly fixing this problem by doing tests on ubuntu and android with
ondemand and interactive respectively to figure out what variables
should be read to get the sampling rate.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 09/25] Fix the syntax to call C programs

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 In PM-QA, there are programs written in C (e.g. cpuidle_killer,
 uevent_reader) that run in the background while some scripts are
 being.

 However, remove the extra slash and period when it's not necessary
 and create variables to store the path of these programs.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpuhotplug/cpuhotplug_07.sh |4 +++-
  cpuidle/cpuidle_02.sh   |2 +-
  cpuidle/cpuidle_03.sh   |2 +-
  include/functions.sh|3 ++-
  thermal/thermal_04.sh   |2 +-
  5 files changed, 8 insertions(+), 5 deletions(-)

 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
 index 8ae9f72..2e81f28 100755
 --- a/cpuhotplug/cpuhotplug_07.sh
 +++ b/cpuhotplug/cpuhotplug_07.sh
 @@ -27,6 +27,7 @@

  . ../include/functions.sh
  TMPFILE=cpuhotplug_07.tmp
 +UEVENT_READER=../utils/uevent_reader

  check_notification() {
  cpu=$1
 @@ -38,8 +39,9 @@ check_notification() {

  # damn ! udevadm is buffering the output, we have to use a temp file
  # to retrieve the output
 +
  rm -f $TMPFILE
 -../utils/uevent_reader $TMPFILE 
 +$UEVENT_READER $TMPFILE 
  pid=$!
  sleep 1

 diff --git a/cpuidle/cpuidle_02.sh b/cpuidle/cpuidle_02.sh
 index 61176d7..4242e24 100755
 --- a/cpuidle/cpuidle_02.sh
 +++ b/cpuidle/cpuidle_02.sh
 @@ -29,5 +29,5 @@

  CPUIDLE_KILLER=./cpuidle_killer

 -check cpuidle program runs successfully (120 secs) ./$CPUIDLE_KILLER
 +check cpuidle program runs successfully (120 secs) $CPUIDLE_KILLER
  test_status_show
 diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpuidle_03.sh
 index 5dbf37f..26d3e28 100755
 --- a/cpuidle/cpuidle_03.sh
 +++ b/cpuidle/cpuidle_03.sh
 @@ -46,7 +46,7 @@ check_cpuidle_kill() {
  fi

  set_offline $1
 -check cpuidle program runs successfully (120 secs) ./$CPUIDLE_KILLER
 +check cpuidle program runs successfully (120 secs) $CPUIDLE_KILLER
  }

  trap restore_cpus; sigtrap HUP INT TERM
 diff --git a/include/functions.sh b/include/functions.sh
 index 2ffdb36..97930ae 100644
 --- a/include/functions.sh
 +++ b/include/functions.sh
 @@ -34,6 +34,7 @@ pass_count=0
  fail_count=0
  skip_count=0
  test_script_status=pass
 +nanosleep=../utils/nanosleep

If you're using ALL CAPs variable names for all the external programs,
why leave this one out? :)

  test_status_show() {
  if [ $fail_count -ne 0 ]; then
 @@ -180,7 +181,7 @@ wait_latency() {

  sleep_time=$(($latency + $sampling_rate))

 -../utils/nanosleep $(($nrfreq * $sleep_time))
 +$nanosleep $(($nrfreq * $sleep_time))
  }

  frequnit() {
 diff --git a/thermal/thermal_04.sh b/thermal/thermal_04.sh
 index 37c65f6..b290c5a 100755
 --- a/thermal/thermal_04.sh
 +++ b/thermal/thermal_04.sh
 @@ -54,7 +54,7 @@ verify_cooling_device_temp_change() {
  init_temp=0
  final_temp=0
  cool_temp=0
 -./$HEAT_CPU_MODERATE moderate 
 +$HEAT_CPU_MODERATE moderate 
  pid=$!
  test $pid -eq 0  return

 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 24/25] cpufreq: Rewrite logic to check if powersave is supported

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 With this new change, the final result for the cpufreq_09
 script will always show up and be counted in LAVA.

Why?

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpufreq/cpufreq_09.sh |5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

 diff --git a/cpufreq/cpufreq_09.sh b/cpufreq/cpufreq_09.sh
 index 3e40cbf..9135fd5 100755
 --- a/cpufreq/cpufreq_09.sh
 +++ b/cpufreq/cpufreq_09.sh
 @@ -59,12 +59,11 @@ save_governors
  supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep 
 powersave)
  if [ -z $supported ]; then
  log_skip powersave not supported
 -return 0
 +else
 +for_each_cpu check_powersave
  fi

  trap restore_governors; sigtrap HUP INT TERM

 -for_each_cpu check_powersave
 -
  restore_governors
  test_status_show
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 23/25] cpufreq: Check to see if scaling_available_governors is available

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Before searching for specific governors, check to see if the
 scaling_available_governors attribute exists first. It is to add
 more error handling.

This doesn't seem to handle interactive governor that is usually the
default on Android.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpufreq/cpufreq_05.sh |   83 
 +++--
  1 file changed, 45 insertions(+), 38 deletions(-)

 diff --git a/cpufreq/cpufreq_05.sh b/cpufreq/cpufreq_05.sh
 index 862d310..8d37bae 100755
 --- a/cpufreq/cpufreq_05.sh
 +++ b/cpufreq/cpufreq_05.sh
 @@ -58,51 +58,58 @@ check_governor() {
  check '$gov' directory exists test -d $GOV_PATH
  }

 -supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep 
 ondemand)
 -if [ -z $supported ]; then
 -log_skip ondemand not supported
 -else
 -for cpu in $cpus; do
 -switch_ondemand $cpu
 -done
 -check_governor $cpu 'ondemand'
 -fi
 +scaling_govs=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors)
 +if [ -n $scaling_govs ]; then
 +supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | 
 grep ondemand)
 +if [ -z $supported ]; then
 +log_skip ondemand not supported
 +else
 +for cpu in $cpus; do
 +switch_ondemand $cpu
 +done
 +check_governor $cpu 'ondemand'
 +fi

 -supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep 
 conservative)
 -if [ -z $supported ]; then
 -log_skip conservative not supported
 -else
 -for cpu in $cpus; do
 -switch_conservative $cpu
 -done
 -check_governor $cpu 'conservative'
 -fi
 +supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | 
 grep conservative)
 +if [ -z $supported ]; then
 +log_skip conservative not supported
 +else
 +for cpu in $cpus; do
 +switch_conservative $cpu
 +done
 +check_governor $cpu 'conservative'
 +fi

 -supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep 
 userspace)
 -if [ -z $supported ]; then
 -log_skip userspace not supported
 -else
 -for cpu in $cpus; do
 -switch_userspace $cpu
 -done
 +supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | 
 grep userspace)
 +if [ -z $supported ]; then
 +log_skip userspace not supported
 +else
 +for cpu in $cpus; do
 +switch_userspace $cpu
 +done

  check 'ondemand' directory is not there test ! -d 
 $CPU_PATH/cpufreq/ondemand
  check 'conservative' directory is not there test ! -d 
 $CPU_PATH/cpufreq/conservative
 -fi
 +fi

 -# if more than one cpu, combine governors
 -nrcpus=$(ls $CPU_PATH | grep cpu[0-9].* | wc -l)
 -if [ $nrcpus -gt 1 ]; then
 -affected=$(cat $CPU_PATH/cpu0/cpufreq/affected_cpus | grep 1)
 -if [ -z $affected ]; then
 -switch_ondemand cpu0
 -switch_conservative cpu1
 -check_governor cpu0 'ondemand'
 -check_governor cpu1 'conservative'
 -else
 -log_skip combine governors not supported
 +# if more than one cpu, combine governors
 +nrcpus=$(ls $CPU_PATH | grep cpu[0-9].* | wc -l)
 +if [ $nrcpus -gt 1 ]; then
 +affected=$(cat $CPU_PATH/cpu0/cpufreq/affected_cpus | grep 1)
 +if [ -z $affected ]; then
 +switch_ondemand cpu0
 +switch_conservative cpu1
 +check_governor cpu0 'ondemand'
 +check_governor cpu1 'conservative'
 +else
 +log_skip combine governors not supported
 +fi
  fi
 +
 +restore_governors
 +
 +else
 +log_skip scaling available governors not available
  fi

 -restore_governors
  test_status_show
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 00/25] Removing bashisms and other cleanups

2015-02-01 Thread Amit Kucheria
On Mon, Feb 2, 2015 at 11:40 AM, Amit Kucheria amit.kuche...@linaro.org wrote:
 Hi Lisa,

 On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Changes in v2:
 - Reorganized previous patchset and recreated patches based on
 logical change
 - Rewritten logic to find certain attributes in sysfs

 [Let's try again...]

 Looks much better and easier to review. Still a few more things for
 the perfect patchset though :)

 You've conflated several things into one big patch series - removal of
 bashisms, bug fixes, better error handling, new features.

 Patches 1-12 seem to contain all the bashism removal. Let us get those
 merged first after you've run them through git test-sequence[1].
 This'll make sure that the change from /bin/bash to /bin/sh in the
 first patch won't break the intermediate state of the tree. Each patch
 should be atomic.

 [1] http://dustin.sallings.org/2010/03/28/git-test-sequence.html

To be perfectly clear, please feel free to add my reviewed-by to 1-12
after you do two things:
 1. Run them through git test-sequence
 2. Minor fix in 9

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA v2 00/25] Removing bashisms and other cleanups

2015-02-01 Thread Amit Kucheria
Hi Lisa,

On Mon, Feb 2, 2015 at 7:34 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Changes in v2:
 - Reorganized previous patchset and recreated patches based on
 logical change
 - Rewritten logic to find certain attributes in sysfs

 [Let's try again...]

Looks much better and easier to review. Still a few more things for
the perfect patchset though :)

You've conflated several things into one big patch series - removal of
bashisms, bug fixes, better error handling, new features.

Patches 1-12 seem to contain all the bashism removal. Let us get those
merged first after you've run them through git test-sequence[1].
This'll make sure that the change from /bin/bash to /bin/sh in the
first patch won't break the intermediate state of the tree. Each patch
should be atomic.

[1] http://dustin.sallings.org/2010/03/28/git-test-sequence.html

 This patchset primarily fixes Linaro Bug# 772
 (https://bugs.linaro.org/show_bug.cgi?id=772) to remove
 bashisms in all PM-QA scripts. These scripts will run on
 Android, Openembedded, and Ubuntu.

 Cleanups have been done to remove redundant code, improve
 readability, and resolve syntax errors that were not
 detected before.

 Currently, the suspend and powertop test modules are disabled.
 However, to maintain consistency, the format of the suspend
 and powertop scripts have been updated to be POSIX-compliant.

 Next steps:

 Once this patchset has been reviewed and acked, the following
 steps will be taken:

 1. Submit a patch to update the release tag on the pwrmgmt
 test definitions to pm-qa-v0.5.0

 2. Submit a patch to update the pm-qa script
 (https://git.linaro.org/qa/test-definitions.git/blob/HEAD:/common/scripts/pm-qa.sh)
 used to run PM-QA on Android by removing unnecessary busybox sym
 links and replace suspend test module with thermal in
 directory list.

 3. Investigate further on why pandaboards do not like the
 cpuidle_03 test case.

 4. Update the PM-QA wiki with new test cases and their descriptions:
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification

 Comments and/or questions are highly encouraged.

 Lisa Nguyen (25):
   Fix path to library files and change shebang line
   Replace double equals with one for comparison
   Remove sigtrap prefixes for traps
   Remove local keywords and uninitialized variables
   Fix syntax to get the cpu id number
   Remove thermal_try_max variable
   Switches: Add hotplug_allow_cpu0=0
   cpuhotplug: Rewrite randomize() function
   Fix the syntax to call C programs
   cpuidle: Use is_root() function in cpuidle_03
   Remove unused variables and rename some
   Remove BASH arrays
   Rewrite logic to check for sampling_rate
   suspend_functions: Check if $LOGDIR exists
   cpuhotplug: Rename 1_sanity_check files to cpuhotplug_00 files
   cpuhotplug: Rename z_sanity_check files to cpuhotplug_99
   cputopology: Add cputopology_sanity.sh
   Android: Update makefiles with new test numbers
   Use -q option for grep command
   Improve test conditions to see if a directory or file exists
   cpufreq: Remove unnecessary checks
   Test: Add sort function
   cpufreq: Check to see if scaling_available_governors is available
   cpufreq: Rewrite logic to check if powersave is supported
   Whitespace cleanup

  Switches.sh|6 +-
  Test.mk|2 +-
  cpufreq/cpufreq_01.sh  |4 +-
  cpufreq/cpufreq_02.sh  |4 +-
  cpufreq/cpufreq_03.sh  |   15 +-
  cpufreq/cpufreq_04.sh  |   16 +--
  cpufreq/cpufreq_05.sh  |  105 +++---
  cpufreq/cpufreq_06.sh  |   46 +++---
  cpufreq/cpufreq_07.sh  |   47 +++
  cpufreq/cpufreq_08.sh  |   26 ++--
  cpufreq/cpufreq_09.sh  |   28 ++--
  cpufreq/cpufreq_sanity.sh  |   10 +-
  cpuhotplug/1_sanity_check.sh   |   40 --
  cpuhotplug/1_sanity_check.txt  |1 -
  cpuhotplug/Android.mk  |4 +-
  cpuhotplug/cpuhotplug_00.sh|   40 ++
  cpuhotplug/cpuhotplug_00.txt   |1 +
  cpuhotplug/cpuhotplug_01.sh|5 +-
  cpuhotplug/cpuhotplug_02.sh|   23 ++-
  cpuhotplug/cpuhotplug_03.sh|   18 ++-
  cpuhotplug/cpuhotplug_04.sh|   17 +--
  cpuhotplug/cpuhotplug_05.sh|   13 +-
  cpuhotplug/cpuhotplug_06.sh|   15 +-
  cpuhotplug/cpuhotplug_07.sh|   26 ++--
  cpuhotplug/cpuhotplug_08.sh|   22 +--
  cpuhotplug/cpuhotplug_99.sh|   40 ++
  cpuhotplug/cpuhotplug_99.txt   |1 +
  cpuhotplug/cpuhotplug_sanity.sh|6 +-
  cpuhotplug/z_sanity_check.sh   |   40 --
  cpuhotplug/z_sanity_check.txt  |1 -
  cpuidle/cpuidle_01.sh  |   18 ++-
  cpuidle/cpuidle_02.sh  |6 +-
  cpuidle/cpuidle_03.sh  |   16 +--
  cpuidle/cpuidle_sanity.sh  |7 +-
  cputopology/Android.mk |2 +-
  cputopology/cputopology_01.sh   

Re: [PATCH PM-QA 00/18] Removing bashisms and other cleanups

2015-01-19 Thread Amit Kucheria
On Tue, Jan 20, 2015 at 6:06 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 [ It's been long overdue and PM-QA gets a makeover... ]

Indeed.

 This patchset primarily fixes Linaro Bug# 772
 (https://bugs.linaro.org/show_bug.cgi?id=772) to remove
 bashisms in all PM-QA scripts. These scripts will run on
 Android, Openembedded, and Ubuntu.

Sorry, but I don't like the way you've split up patches 1-9 by
directory. Can you merge them back and split them up by change
across directories. (Great use for git add -p)

e.g. All bash - sh changes can be one patch, all replacing source
with . could be another and so on. This makes it easier to review
similar changes together. Use your judgement to merge several trivial
changes together in one patch.

-#!/bin/bash
+#!/bin/sh

-source ../include/functions.sh
+. ../include/functions.sh

 Cleanups have been done to remove redundant code, improve
 readability, and resolve syntax errors that were not
 detected before.

 Next steps:

 Once this patchset has been reviewed and acked, the following
 steps will be taken:

 1. Submit a patch to update the release tag on the pwrmgmt
 test definitions to pm-qa-v0.5.0

 2. Submit a patch to update the pm-qa script
 (https://git.linaro.org/qa/test-definitions.git/blob/HEAD:/common/scripts/pm-qa.sh)
 used to run PM-QA on Android by removing unnecessary busybox sym
 links and replace suspend test module with thermal in
 directory list.

 3. Investigate further on why pandaboards do not like the
 cpuidle_03 test case.

 Comments and/or questions are highly encouraged.

 Lisa Nguyen (18):
   functions: Remove bashisms in function scripts
   cpuidle: Remove bashisms in cpuidle test module
   cputopology: Remove bashisms in cputopology test module
   cpufreq: Remove bashisms in cpufreq test module
   thermal: Remove bashisms in thermal test module
   cpuhotplug: Remove bashisms in cpuhotplug scripts
   suspend: Remove bashisms in suspend test module
   utils: Remove bashisms in utils_sanity.sh
   powertop: Remove bashisms in powertop test module
   Test.mk: Add sort function
   Switches: Export hotplug_allow_cpu0
   Add cputopology_sanity script
   cpuhotplug: Rename 1_sanity_check.sh to cpuhotplug_00.sh
   cpuhotplug: Rename z_sanity_check.sh to cpuhotplug_09.sh
   Add descriptions for cpuhotplug_00.sh and cpuhotplug_09.sh
   Switches: Remove thermal_try_max variable
   cpufreq: Rewrite logic to check for userspace and powersave governors
   Android.mk: Update test numbers and remove whitespace

  Switches.sh   |6 +-
  Test.mk   |4 +-
  cpufreq/Android.mk|2 +-
  cpufreq/cpufreq_01.sh |4 +-
  cpufreq/cpufreq_02.sh |5 +-
  cpufreq/cpufreq_03.sh |   13 +-
  cpufreq/cpufreq_04.sh |   16 ++-
  cpufreq/cpufreq_05.sh |   24 ++--
  cpufreq/cpufreq_06.sh |   59 -
  cpufreq/cpufreq_07.sh |   48 ---
  cpufreq/cpufreq_08.sh |   31 ++---
  cpufreq/cpufreq_09.sh |   27 ++--
  cpufreq/cpufreq_sanity.sh |9 +-
  cpuhotplug/1_sanity_check.sh  |   40 --
  cpuhotplug/1_sanity_check.txt |1 -
  cpuhotplug/Android.mk |   18 +--
  cpuhotplug/cpuhotplug_00.sh   |   39 ++
  cpuhotplug/cpuhotplug_00.txt  |1 +
  cpuhotplug/cpuhotplug_01.sh   |5 +-
  cpuhotplug/cpuhotplug_02.sh   |   21 ++--
  cpuhotplug/cpuhotplug_03.sh   |   15 ++-
  cpuhotplug/cpuhotplug_04.sh   |   21 ++--
  cpuhotplug/cpuhotplug_05.sh   |   13 +-
  cpuhotplug/cpuhotplug_06.sh   |   16 ++-
  cpuhotplug/cpuhotplug_07.sh   |   17 ++-
  cpuhotplug/cpuhotplug_08.sh   |   23 ++--
  cpuhotplug/cpuhotplug_09.sh   |   39 ++
  cpuhotplug/cpuhotplug_09.txt  |1 +
  cpuhotplug/cpuhotplug_sanity.sh   |5 +-
  cpuhotplug/z_sanity_check.sh  |   40 --
  cpuhotplug/z_sanity_check.txt |1 -
  cpuidle/Android.mk|4 +-
  cpuidle/cpuidle_01.sh |   21 ++--
  cpuidle/cpuidle_02.sh |7 +-
  cpuidle/cpuidle_03.sh |   17 ++-
  cpuidle/cpuidle_sanity.sh |9 +-
  cputopology/Android.mk|2 +-
  cputopology/cputopology_01.sh |9 +-
  cputopology/cputopology_02.sh |5 +-
  cputopology/cputopology_sanity.sh |   49 
  include/functions.sh  |  248 
 +
  include/suspend_functions.sh  |   24 ++--
  include/thermal_functions.sh  |  219 
  powertop/powertop_01.sh   |   19 ++-
  powertop/powertop_sanity.sh   |8 +-
  suspend/suspend_01.sh |9 +-
  suspend/suspend_02.sh |9 +-
  suspend/suspend_03.sh |9 +-
  suspend/suspend_04.sh |   11 +-
  suspend/suspend_05.sh |   11 +-
  suspend/suspend_sanity.sh |4 +-
  thermal/thermal_00.sh 

Re: [PATCH PM-QA 18/18] Android.mk: Update test numbers and remove whitespace

2015-01-19 Thread Amit Kucheria
On Tue, Jan 20, 2015 at 6:06 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Update the Android makefiles in cputopology and cpuhotplug
 since a few subtests have been added or renamed. Remove
 unnecessary whitespace detected by checkpatch as well.

Have you ensured that the test spec[1] corresponds to the current
script numbering?

[1] 
https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpufreq/Android.mk |2 +-
  cpuhotplug/Android.mk  |   18 ++
  cpuidle/Android.mk |4 ++--
  cputopology/Android.mk |2 +-
  4 files changed, 6 insertions(+), 20 deletions(-)

 diff --git a/cpufreq/Android.mk b/cpufreq/Android.mk
 index 15d6d9e..4f1bd34 100644
 --- a/cpufreq/Android.mk
 +++ b/cpufreq/Android.mk
 @@ -5,7 +5,7 @@ module_name = cpufreq

  define $(module_name)_add_executable
  include $(CLEAR_VARS)
 -LOCAL_MODULE_TAGS := optional
 +LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_CLASS := tests
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
 diff --git a/cpuhotplug/Android.mk b/cpuhotplug/Android.mk
 index fabb70a..e74170f 100644
 --- a/cpuhotplug/Android.mk
 +++ b/cpuhotplug/Android.mk
 @@ -5,7 +5,7 @@ module_name = cpuhotplug

  define $(module_name)_add_executable
  include $(CLEAR_VARS)
 -LOCAL_MODULE_TAGS := optional
 +LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_CLASS := tests
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
 @@ -14,19 +14,5 @@ define $(module_name)_add_executable
  include $(BUILD_PREBUILT)
  endef

 -test_num := sanity 01 02 03 04 05 06 07 08
 +test_num := sanity 00 01 02 03 04 05 06 07 08 09
  $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, 
 $(module_name)_$(item
 -
 -define $(module_name)_etc_add_executable
 -include $(CLEAR_VARS)
 -LOCAL_MODULE_TAGS := optional
 -LOCAL_MODULE_CLASS := tests
 -LOCAL_MODULE := $1.sh
 -systemtarball: $1.sh
 -LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/pm-qa/$(module_name)
 -include $(BUILD_PREBUILT)
 -endef
 -
 -test_names := 1_sanity_check z_sanity_check
 -$(foreach item,$(test_names),$(eval $(call 
 $(module_name)_etc_add_executable, $(item
 diff --git a/cpuidle/Android.mk b/cpuidle/Android.mk
 index 1d1292c..cf22f18 100644
 --- a/cpuidle/Android.mk
 +++ b/cpuidle/Android.mk
 @@ -5,7 +5,7 @@ module_name = cpuidle

  define $(module_name)_add_executable
  include $(CLEAR_VARS)
 -LOCAL_MODULE_TAGS := optional
 +LOCAL_MODULE_TAGS := optional
  LOCAL_MODULE_CLASS := tests
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
 @@ -21,7 +21,7 @@ include $(CLEAR_VARS)
  LOCAL_MODULE := cpuidle_killer
  systemtarball: cpuidle_killer
  LOCAL_SRC_FILES:= cpuidle_killer.c
 -LOCAL_STATIC_LIBRARIES := libcutils libc
 +LOCAL_STATIC_LIBRARIES := libcutils libc
  LOCAL_MODULE_TAGS := tests
  LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)/pm-qa/$(module_name)
  include $(BUILD_EXECUTABLE)
 diff --git a/cputopology/Android.mk b/cputopology/Android.mk
 index d5b5480..3555496 100644
 --- a/cputopology/Android.mk
 +++ b/cputopology/Android.mk
 @@ -14,5 +14,5 @@ define $(module_name)_add_executable
  include $(BUILD_PREBUILT)
  endef

 -test_num := 01 02
 +test_num := sanity 01 02
  $(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, 
 $(module_name)_$(item
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA 14/18] cpuhotplug: Rename z_sanity_check.sh to cpuhotplug_09.sh

2015-01-19 Thread Amit Kucheria
On Tue, Jan 20, 2015 at 6:06 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Rename z_sanity_check.sh script to cpuhotplug_09.sh to give it a
 more meaningful name and to check if all cpus are back online after
 running previous cpuhotplug tests.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  cpuhotplug/cpuhotplug_09.sh  |   39 +++

Rename to 99 instead of 09 so that you don't have to change the number
if you add another hotplug test.

  cpuhotplug/z_sanity_check.sh |   39 ---
  2 files changed, 39 insertions(+), 39 deletions(-)
  create mode 100755 cpuhotplug/cpuhotplug_09.sh
  delete mode 100755 cpuhotplug/z_sanity_check.sh

 diff --git a/cpuhotplug/cpuhotplug_09.sh b/cpuhotplug/cpuhotplug_09.sh
 new file mode 100755
 index 000..d6fc0cc
 --- /dev/null
 +++ b/cpuhotplug/cpuhotplug_09.sh
 @@ -0,0 +1,39 @@
 +#!/bin/sh
 +#
 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2011, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 +#
 +# Contributors:
 +# Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
 +#   - initial API and implementation
 +#
 +# URL :
 +
 +. ../include/functions.sh
 +
 +check_cpus_online() {
 +   ret=$(cat $CPU_PATH/offline)
 +   if [ -z $ret ]; then
 +   return 0
 +   else
 +   return 1
 +   fi
 +}
 +
 +check all cpus are back online check_cpus_online
 +test_status_show
 diff --git a/cpuhotplug/z_sanity_check.sh b/cpuhotplug/z_sanity_check.sh
 deleted file mode 100755
 index 98115a3..000
 --- a/cpuhotplug/z_sanity_check.sh
 +++ /dev/null
 @@ -1,39 +0,0 @@
 -#!/bin/sh
 -#
 -# PM-QA validation test suite for the power management on Linux
 -#
 -# Copyright (C) 2011, Linaro Limited.
 -#
 -# This program is free software; you can redistribute it and/or
 -# modify it under the terms of the GNU General Public License
 -# as published by the Free Software Foundation; either version 2
 -# of the License, or (at your option) any later version.
 -#
 -# This program is distributed in the hope that it will be useful,
 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -# GNU General Public License for more details.
 -#
 -# You should have received a copy of the GNU General Public License
 -# along with this program; if not, write to the Free Software
 -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 -#
 -# Contributors:
 -# Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
 -#   - initial API and implementation
 -#
 -# URL :
 -
 -. ../include/functions.sh
 -
 -sanity_check() {
 -   ret=$(cat $CPU_PATH/offline)
 -   if [ -z $ret ]; then
 -   return 0
 -   else
 -   return 1
 -   fi
 -}
 -
 -check all cpu are back online sanity_check
 -test_status_show
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] rt-app: Add IO-bounded and memory-bounded events

2014-12-02 Thread Amit Kucheria
On Tue, Dec 2, 2014 at 12:57 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 On 2 December 2014 at 12:51, pi-cheng.chen pi-cheng.c...@linaro.org wrote:
 Add 2 new kind of event for running a memory or a io bounded load.
 mem name for a load is memory bounded, and iorun name for a load is io
 bounded. The default file to be written to create the load is /dev/null and
 the device/file could be specified with io_device key in global section.

 E.g.
 tasks : {
 thread0 :
 { sleep : 1000, run : 100, mem : 1000, sleep 1, iorun : 1000 }
 },
 global : { io_device : /dev/ttyS0 }

 Signed-off-by: pi-cheng.chen pi-cheng.c...@linaro.org
 ---
  src/rt-app.c  | 74 
 +++
  src/rt-app.h  |  2 ++
  src/rt-app_parse_config.c | 23 +++
  src/rt-app_types.h|  4 +++
  4 files changed, 103 insertions(+)

 Hi Pi-cheng,

 Sorry for troubling again. There are still few issues:
 - I thought it will look like this:
 [RT-APP][PATCH] Add IO-bounded and memory-bounded events

 @Amit ? Same is true for all other utilities like idlestat as well..

 The place where you have put rt-app now is reserved for the
 module within the repo to which the patch belongs. Not sure
 if rt-app repo has need of such modules though.

Sure.

 - There should have been somebody in the --to field, whom
 you want to review your patches.

 You don't have to resend it now.. :)

Pi-Cheng, for future postings let us just skip linaro-dev list and cc
sched-to...@linaro.org instead. And yes, adding at least one real
person in To field ensures someone will look at your patches.

Regards,
Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [rt-app 0/3] Dependencies and example files fixes

2014-10-31 Thread Amit Kucheria
Hi Ivan,

Our main developer was on holidays this week. We'll review these next week.

Thanks for the patches.

Regards,
Amit

On Fri, Oct 31, 2014 at 7:50 PM, Ivan T. Ivanov iiva...@mm-sol.com wrote:
 Hi,

 On Fri, 2014-10-24 at 17:45 +0300, Ivan T. Ivanov wrote:
 Hi,

 Here small set of patches which fix:

 - Build time dependencies. Application actually depend on json-c
 - Add __aarch64__ sched_setget|set_attr syscall numbers.
 - Fixed suspend event definition in example files. JSON expect object
   of type string after event definition.

 Hopefully I get it right. If you have any questions or/and comments,
 please let me know.


 Any comments or remarks?

 Regards,
 Ivan

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v2] idlestat: Add -o option to save output report to a file

2014-08-28 Thread Amit Kucheria
Applied with a fix to check for bad filenames. See earlier commit in the tree.

On Fri, Aug 22, 2014 at 1:58 PM, pi-cheng.chen pi-cheng.c...@linaro.org wrote:
 Currently the serial terminal connected to the boards running idlestat are
 restricted to be at least 80 characters wide to output the report. Otherwise
 idlestat quits with message The terminal must be at least 80 columns wide.

 Changes v1 to v2:
 * Duplicate opened report file to stdout instead of replacing all printf()

 Fix it by adding a -o option to save report output to a file.

 Signed-off-by: Pi-Cheng Chen pi-cheng.c...@linaro.org
 ---
  idlestat.c | 56 ++--
  idlestat.h |  1 +
  2 files changed, 51 insertions(+), 6 deletions(-)

 diff --git a/idlestat.c b/idlestat.c
 index bba8951..7aa9d74 100644
 --- a/idlestat.c
 +++ b/idlestat.c
 @@ -34,6 +34,7 @@
  #include sched.h
  #include string.h
  #include float.h
 +#include fcntl.h
  #include sys/ioctl.h
  #include sys/time.h
  #include sys/types.h
 @@ -71,6 +72,33 @@ static void charrep(char c, int count)
 printf(%c, c);
  }

 +static int open_report_file(const char *path)
 +{
 +   int fd;
 +   int ret = 0;
 +
 +   if (path) {
 +   fd = open(path, O_RDWR | O_CREAT | O_TRUNC,
 +   S_IRUSR | S_IWUSR | S_IRGRP |S_IROTH);
 +   if (fd  0) {
 +   fprintf(stderr, %s: failed to open '%s'\n, 
 __func__, path);
 +   return -1;
 +   }
 +
 +   close(STDOUT_FILENO);
 +
 +   ret = dup2(fd, STDOUT_FILENO);
 +   close(fd);
 +
 +   if (ret  0) {
 +   fprintf(stderr, %s: failed to duplicate '%s'\n, 
 __func__, path);
 +   return ret;
 +   }
 +   }
 +
 +   return 0;
 +}
 +
  static void display_cpu_header(char *cpu, int length)
  {
 charrep('-', length);
 @@ -,11 +1139,11 @@ static void help(const char *cmd)
  {
 fprintf(stderr,
 \nUsage:\nTrace mode:\n\t%s --trace -f|--trace-file 
 filename
 --t|--duration seconds -c|--idle -p|--frequency 
 -w|--wakeup,
 -   basename(cmd));
 +-o|--output-file filename -t|--duration seconds
 +-c|--idle -p|--frequency -w|--wakeup, basename(cmd));
 fprintf(stderr,
 -   \nReporting mode:\n\t%s --import -f|--trace-file filename,
 -   basename(cmd));
 +   \nReporting mode:\n\t%s --import -f|--trace-file filename
 +-o|--output-file filename, basename(cmd));
 fprintf(stderr,
 \n\nExamples:\n1. Run a trace, post-process the results
  (default is to show only C-state statistics):\n\tsudo 
 @@ -1131,6 +1159,15 @@ static void help(const char *cmd)
 fprintf(stderr,
 \n4. Post-process a trace captured earlier:\n\tsudo ./%s
  --import -f /tmp/mytrace\n, basename(cmd));
 +   fprintf(stderr,
 +   \n5. Run a trace, post-process the results and print all
 +statistics into a file:\n\tsudo ./%s --trace -f 
 /tmp/mytrace -t 10 -p -c -w
 +-o /tmp/myreport\n, basename(cmd));
 +   fprintf(stderr,
 +   \n6. Post-process a trace captured earlier and print all
 +statistics into a file:\n\tsudo ./%s --import -f 
 /tmp/mytrace -p -c -w
 +-o /tmp/myreport\n,
 +   basename(cmd));
  }

  static void version(const char *cmd)
 @@ -1144,6 +1181,7 @@ int getoptions(int argc, char *argv[], struct 
 program_options *options)
 { trace,   no_argument,   options-mode, TRACE },
 { import,  no_argument,   options-mode, IMPORT },
 { trace-file,  required_argument, NULL, 'f' },
 +   { output-file, required_argument, NULL, 'o' },
 { help,no_argument,   NULL, 'h' },
 { duration,required_argument, NULL, 't' },
 { version, no_argument,   NULL, 'V' },
 @@ -1157,13 +1195,14 @@ int getoptions(int argc, char *argv[], struct 
 program_options *options)

 memset(options, 0, sizeof(*options));
 options-filename = NULL;
 +   options-outfilename = NULL;
 options-mode = -1;
 options-format = -1;
 while (1) {

 int optindex = 0;

 -   c = getopt_long(argc, argv, :df:ht:cpwVv,
 +   c = getopt_long(argc, argv, :df:o:ht:cpwVv,
 long_options, optindex);
 if (c == -1)
 break;
 @@ -1172,6 +1211,9 @@ int getoptions(int argc, char *argv[], struct 
 program_options *options)
 case 'f':
 options-filename = optarg;
 break;
 +   case 'o':
 +

Re: [PATCH PM-QA] Simplify code to obtain number of cpus for a platform

2014-08-08 Thread Amit Kucheria
On Fri, Aug 8, 2014 at 7:02 PM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:

 On Friday 08 August 2014 10:43 AM, Amit Kucheria wrote:

 On Fri, Aug 8, 2014 at 7:05 AM, Lisa Nguyen lisa.ngu...@linaro.org
 wrote:

 Create a global variable that will look for number of cpus
 for a platform and use it in multiple functions to make the
 code simplier to read.

 Agree with the patch.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
 diff --git a/cpuhotplug/cpuhotplug_sanity.sh
 b/cpuhotplug/cpuhotplug_sanity.sh
 index d9b6af8..2ad24ff 100755
 --- a/cpuhotplug/cpuhotplug_sanity.sh
 +++ b/cpuhotplug/cpuhotplug_sanity.sh
 @@ -33,7 +33,6 @@ fi

   check_cpuhotplug_sysfs_entry() {

 -cpus=$(ls $CPU_PATH | grep cpu[0-9].*)
   cpunum=$(ls $CPU_PATH | grep cpu[0-9].* -c)

   if [ $cpunum -eq 1 ]; then
 diff --git a/include/functions.sh b/include/functions.sh
 index e0f08fb..74b2294 100644
 --- a/include/functions.sh
 +++ b/include/functions.sh
 @@ -30,6 +30,7 @@ TEST_NAME=$(basename ${0%.sh})
   PREFIX=$TEST_NAME
   INC=0
   CPU=
 +cpus=$(ls $CPU_PATH | grep cpu[0-9].*)

 Let's fix this properly while we're at it. We already have boards with
 more than 10 cpus now - D01.


 - Its fine, it will work. The sqare brackets filters the pattern, e.g. with
 this filter

Right. I misread the regex. What's new.

 cpu1 and also all cpu1*** will be filtered IN.

 - Issue with this filter here is it will return cpu is improper order, as

 cpu0
 cpu1
 cpu10
 cpu11
 cpu12
 cpu13
 cpu14
 cpu15
 cpu2
 cpu3
 cpu4

 so here after cpu1, cpu10 will be processed instead of logically cpu2. We
 can sort using *-v*
 option of ls here to get cpus sequentially

 cpus=$(ls -1v $CPU_PATH | grep cpu[0-9].*)



 Regards,
 Amit


 --
 sanjay


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH PM-QA] Simplify code to obtain number of cpus for a platform

2014-08-07 Thread Amit Kucheria
On Fri, Aug 8, 2014 at 7:05 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Create a global variable that will look for number of cpus
 for a platform and use it in multiple functions to make the
 code simplier to read.

Agree with the patch.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---

 diff --git a/cpuhotplug/cpuhotplug_sanity.sh b/cpuhotplug/cpuhotplug_sanity.sh
 index d9b6af8..2ad24ff 100755
 --- a/cpuhotplug/cpuhotplug_sanity.sh
 +++ b/cpuhotplug/cpuhotplug_sanity.sh
 @@ -33,7 +33,6 @@ fi

  check_cpuhotplug_sysfs_entry() {

 -cpus=$(ls $CPU_PATH | grep cpu[0-9].*)
  cpunum=$(ls $CPU_PATH | grep cpu[0-9].* -c)

  if [ $cpunum -eq 1 ]; then
 diff --git a/include/functions.sh b/include/functions.sh
 index e0f08fb..74b2294 100644
 --- a/include/functions.sh
 +++ b/include/functions.sh
 @@ -30,6 +30,7 @@ TEST_NAME=$(basename ${0%.sh})
  PREFIX=$TEST_NAME
  INC=0
  CPU=
 +cpus=$(ls $CPU_PATH | grep cpu[0-9].*)

Let's fix this properly while we're at it. We already have boards with
more than 10 cpus now - D01.

Regards,
Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [GIT PULL] Create a workload generator tool

2014-08-07 Thread Amit Kucheria
On Thu, Aug 7, 2014 at 8:27 PM, Juri Lelli juri.le...@arm.com wrote:
 Hi Amit,

 On 06/08/14 12:35, Amit Kucheria wrote:
 Hi Juri,

 On Wed, Aug 6, 2014 at 3:38 PM, Juri Lelli juri.le...@arm.com wrote:
 Hi Vincent,

 I'm actually adding Chris to Cc: as he is also part of the
 original discussion about rt-app.

 On 05/08/14 22:45, Vincent Guittot wrote:
 Hi Juri,

 Here is the pull request for the changes that create a workload generator 
 tool

 Regards,

 The following changes since commit 
 17be4548c4260b80be623e0e1317e98a770dea7a:

   copyright added (2014-04-11 09:28:27 +0200)

 are available in the git repository at:

   git://git.linaro.org/power/rt-app.git master

 for you to fetch changes up to 8cbaad65d00e3c64c4f941139bc11f4d07822474:

   add a web browsing use case (2014-08-01 15:43:47 +0200)

 Thanks for sharing changes in your repository, but IMHO it is
 somewhat difficult to review them in this form, as behavioural
 changes are intermixed with small fixes. Also, it would be good
 if we can integrate changes keeping git history clean. Ideally
 we could introduce functional changes followed by (or together
 with) examples showing what feature the change introduces. I
 know that this is time consuming, so I'm actually asking if you
 think you have some time to work on rearranging things.

 Vincent is on vacations until the end of the month. After that, I
 expect he'll be busy with Linaro Connect preparations.

 Yes, the timing of all this sucks given that we want to announce the
 tools this week to give 2 weeks of lead time before Kernel Summit.

 Having a proper history could also ease review. I'd say we could
 try two different methods. I created a GitHub organization that
 now hosts the rt-app repo: https://github.com/scheduler-tools/rt-app.
 I also created a branch for the original version of the tool so that
 we can integrate changes on master.

  Method 1) We use GitHub pull request feature to discuss changes and
finally integrate them.

  Method 2) You post the patchset (based on master) on linaro-dev
mailing list, discussion happens on the mailing list
(everybody can participate), after discussion I apply
patches resulting from discussion on master.

 I'd personally prefer method 2 as it is simpler and can probably get
 contributions from a wider audience. What other thinks?

 I prefer Method 2 myself but it is going to be hard to get anything
 refactored until late September.


 So, I'd say we wait for the actual review process to happen when
 feasible anyway.

I agree. Admittedly the kernel summit deadlines and vacation schedules
among other things have forced us to take some shortcuts.

We'll feed these patches back in small chunks over time. In the
meanwhile, for the sake of the tools announcement, we'll just refer to
the tree on g.l.o

 We also said that the name of the tool could be changed, any opinions
 on this? Something like workload-gen or wload-gen ?

 IMHO, the name change is just a nice to have and not critical to the
 success of this project.

Workload Generator is the obvious choice of name but not very
Google-friendly. Can someone think of a suitable qualifier before it?
It'd stick with rt-app until then.

Regards,
Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [GIT PULL] Create a workload generator tool

2014-08-06 Thread Amit Kucheria
Hi Juri,

On Wed, Aug 6, 2014 at 3:38 PM, Juri Lelli juri.le...@arm.com wrote:
 Hi Vincent,

 I'm actually adding Chris to Cc: as he is also part of the
 original discussion about rt-app.

 On 05/08/14 22:45, Vincent Guittot wrote:
 Hi Juri,

 Here is the pull request for the changes that create a workload generator 
 tool

 Regards,

 The following changes since commit 17be4548c4260b80be623e0e1317e98a770dea7a:

   copyright added (2014-04-11 09:28:27 +0200)

 are available in the git repository at:

   git://git.linaro.org/power/rt-app.git master

 for you to fetch changes up to 8cbaad65d00e3c64c4f941139bc11f4d07822474:

   add a web browsing use case (2014-08-01 15:43:47 +0200)

 Thanks for sharing changes in your repository, but IMHO it is
 somewhat difficult to review them in this form, as behavioural
 changes are intermixed with small fixes. Also, it would be good
 if we can integrate changes keeping git history clean. Ideally
 we could introduce functional changes followed by (or together
 with) examples showing what feature the change introduces. I
 know that this is time consuming, so I'm actually asking if you
 think you have some time to work on rearranging things.

Vincent is on vacations until the end of the month. After that, I
expect he'll be busy with Linaro Connect preparations.

Yes, the timing of all this sucks given that we want to announce the
tools this week to give 2 weeks of lead time before Kernel Summit.

 Having a proper history could also ease review. I'd say we could
 try two different methods. I created a GitHub organization that
 now hosts the rt-app repo: https://github.com/scheduler-tools/rt-app.
 I also created a branch for the original version of the tool so that
 we can integrate changes on master.

  Method 1) We use GitHub pull request feature to discuss changes and
finally integrate them.

  Method 2) You post the patchset (based on master) on linaro-dev
mailing list, discussion happens on the mailing list
(everybody can participate), after discussion I apply
patches resulting from discussion on master.

 I'd personally prefer method 2 as it is simpler and can probably get
 contributions from a wider audience. What other thinks?

I prefer Method 2 myself but it is going to be hard to get anything
refactored until late September.

 We also said that the name of the tool could be changed, any opinions
 on this? Something like workload-gen or wload-gen ?

IMHO, the name change is just a nice to have and not critical to the
success of this project.

Regards,
Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v3] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-07-03 Thread Amit Kucheria
On Thu, Jul 3, 2014 at 2:22 PM, Jon Medhurst (Tixy) t...@linaro.org wrote:
 On Thu, 2014-07-03 at 10:24 +0530, Amit Kucheria wrote:
 On Thu, Jul 3, 2014 at 7:37 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 [...]
  diff --git a/include/functions.sh b/include/functions.sh
  index 6d75e34..d44706f 100644
  --- a/include/functions.sh
  +++ b/include/functions.sh
  @@ -285,10 +285,10 @@ check_cpuhotplug_files() {
   shift 1
 
   for i in $@; do
  -# skip check for cpu0
  -if [ `echo $dirpath | grep -c cpu0` -eq 1 ]; then
  -continue
  -fi
  +if [[ $dirpath =~ cpu0$  $hotplug_allow_cpu0 -eq 0 ]]; then

 I just checked 'man bash' for the meaning of =~ and found this:

 The return value is 0 if the string matches the pattern, and 1 otherwise.

 So if you find cpu0 in $dirpath, it'll return a zero, right? So your
 above expression becomes zero and you don't end up skipping the test
 for cpu0.

 But in shells, isn't zero true and non-zero false, and  behaves
 accordingly?

I knew I was missing something. Thanks for the correction. No more
morning reviews.

 I have another comment though, will the scripts only be used on systems
 with bash? If we can't guarantee this perhaps bash specific features
 should be avoided. (Is the android shell bash compatible?)

At the moment pm-qa depends on /bin/bash. While restricting ourselves
to POSIX shell constructs would be ideal, I can't commit to doing a
wholesale conversion anytime soon.

Having said that, I just confirmed with Vishal and Android doesn't
care about #!/bin/bash. It just executes the shell script using
/system/bin/sh. And we've been fixing any error reports, so it looks
like the shell is Bash-compatible.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v3] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-07-03 Thread Amit Kucheria
On Thu, Jul 3, 2014 at 3:38 PM, Jon Medhurst (Tixy) t...@linaro.org wrote:
 On Thu, 2014-07-03 at 14:59 +0530, Amit Kucheria wrote:
 On Thu, Jul 3, 2014 at 2:22 PM, Jon Medhurst (Tixy) t...@linaro.org wrote:
  On Thu, 2014-07-03 at 10:24 +0530, Amit Kucheria wrote:
  On Thu, Jul 3, 2014 at 7:37 AM, Lisa Nguyen lisa.ngu...@linaro.org 
  wrote:
  [...]
   diff --git a/include/functions.sh b/include/functions.sh
   index 6d75e34..d44706f 100644
   --- a/include/functions.sh
   +++ b/include/functions.sh
   @@ -285,10 +285,10 @@ check_cpuhotplug_files() {
shift 1
  
for i in $@; do
   -# skip check for cpu0
   -if [ `echo $dirpath | grep -c cpu0` -eq 1 ]; then
   -continue
   -fi
   +if [[ $dirpath =~ cpu0$  $hotplug_allow_cpu0 -eq 0 ]]; then
 
  I just checked 'man bash' for the meaning of =~ and found this:
 
  The return value is 0 if the string matches the pattern, and 1 
  otherwise.
 
  So if you find cpu0 in $dirpath, it'll return a zero, right? So your
  above expression becomes zero and you don't end up skipping the test
  for cpu0.
 
  But in shells, isn't zero true and non-zero false, and  behaves
  accordingly?

 I knew I was missing something. Thanks for the correction. No more
 morning reviews.

  I have another comment though, will the scripts only be used on systems
  with bash? If we can't guarantee this perhaps bash specific features
  should be avoided. (Is the android shell bash compatible?)

 At the moment pm-qa depends on /bin/bash. While restricting ourselves
 to POSIX shell constructs would be ideal, I can't commit to doing a
 wholesale conversion anytime soon.

 Having said that, I just confirmed with Vishal and Android doesn't
 care about #!/bin/bash. It just executes the shell script using
 /system/bin/sh. And we've been fixing any error reports, so it looks
 like the shell is Bash-compatible.

 Well, for me on Android I get

syntax error: '=~' unexpected operator/operand

 when running a script containing

 #!/bin/bash
 foo=bar; if [[ $foo =~ $1 ]]; then echo yes; else echo no; fi

 The same script runs OK on my PC, giving yes/no as appropriate to what I
 pass as the argument.

 So for the $subject patch, best to keep the existing check which uses
 grep, and just make the 'continue' conditional, e.g.

 if [ `echo $dirpath | grep -c cpu0` -eq 1 ]; then
 if [ $hotplug_allow_cpu0 -eq 0 ]; then continue; fi
 fi


Makes sense.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v4] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-07-03 Thread Amit Kucheria
On Fri, Jul 4, 2014 at 4:06 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 By default, cpuhotplug does not run on cpu0. However, if
 we want to allow cpuhotplug to run on cpu0, then we must
 pass the parameter, hotplug_allow_cpu0=1, to make check.

Please add a Reported-by credit for Milosz here.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org

Acked-by: Amit Kucheria amit.kuche...@linaro.org

Please apply this to the PM-QA git tree to allow  Milosz to take it for a spin.

Regards,
Amit

 ---
 Changes from v3 to v4:
 - Remove =~ symbol and rewrote test condition in
 check_cpuhotplug_files() function

 Changes from v2 to v3:
 - Renamed is_cpu0_allowed() function to is_cpu0_hotplug_allowed()
 - Removed $cpu parameter from is_cpu0_allowed function()
 - Modified test condition in check_cpuhotplug_files() function

 Changes from v1 to v2:
 - Rename the parameter from hotplug_cpu_start to hotplug_allow_cpu0
 - Add is_cpu0_allowed() function to check if we want to start running
 test scripts from cpu0..cpuN
 ---
  Makefile|4 ++--
  cpuhotplug/Makefile |2 +-
  cpuhotplug/cpuhotplug_02.sh |2 +-
  cpuhotplug/cpuhotplug_03.sh |2 +-
  cpuhotplug/cpuhotplug_04.sh |2 +-
  cpuhotplug/cpuhotplug_05.sh |2 +-
  cpuhotplug/cpuhotplug_06.sh |2 +-
  cpuhotplug/cpuhotplug_07.sh |2 +-
  cpuhotplug/cpuhotplug_08.sh |6 +-
  include/functions.sh|   20 
  10 files changed, 30 insertions(+), 14 deletions(-)

 diff --git a/Makefile b/Makefile
 index 731619d..d76deb7 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -21,14 +21,14 @@
  # Torez Smith torez.sm...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +hotplug_allow_cpu0?=0
  all:
 @(cd utils; $(MAKE))

  check:
 @(cd utils; $(MAKE) check)
 @(cd cpufreq; $(MAKE) check)
 -   @(cd cpuhotplug; $(MAKE) check)
 +   @(cd cpuhotplug; $(MAKE) hotplug_allow_cpu0=${hotplug_allow_cpu0} 
 check)
 @(cd cpuidle; $(MAKE) check)
  #  @(cd suspend; $(MAKE) check)
 @(cd thermal; $(MAKE) check)
 diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
 index df0b8f4..6ee600d 100644
 --- a/cpuhotplug/Makefile
 +++ b/cpuhotplug/Makefile
 @@ -21,5 +21,5 @@
  # Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +export hotplug_allow_cpu0?=0
  include ../Test.mk
 diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
 index 3157307..d2bb5b4 100755
 --- a/cpuhotplug/cpuhotplug_02.sh
 +++ b/cpuhotplug/cpuhotplug_02.sh
 @@ -34,7 +34,7 @@ check_state() {
  shift 1

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
 index 13a0ce9..2a5ae48 100755
 --- a/cpuhotplug/cpuhotplug_03.sh
 +++ b/cpuhotplug/cpuhotplug_03.sh
 @@ -34,7 +34,7 @@ check_affinity_fails() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
 index 394a512..7938e7d 100755
 --- a/cpuhotplug/cpuhotplug_04.sh
 +++ b/cpuhotplug/cpuhotplug_04.sh
 @@ -37,7 +37,7 @@ check_task_migrate() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  taskset 0x$cpumask $CPUBURN $cpu 
 diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
 index a8eb312..4042f2c 100755
 --- a/cpuhotplug/cpuhotplug_05.sh
 +++ b/cpuhotplug/cpuhotplug_05.sh
 @@ -33,7 +33,7 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
 index 347906d..0461e37 100755
 --- a/cpuhotplug/cpuhotplug_06.sh
 +++ b/cpuhotplug/cpuhotplug_06.sh
 @@ -33,7 +33,7 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
 index eaeba77..a3526be 100755
 --- a/cpuhotplug/cpuhotplug_07.sh
 +++ b/cpuhotplug/cpuhotplug_07.sh
 @@ -35,7 +35,7 @@ check_notification() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  # damn ! udevadm is buffering the output, we have to use a temp file
 diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh
 index 9e2c355..00315a4 100755
 --- a/cpuhotplug/cpuhotplug_08.sh
 +++ b/cpuhotplug/cpuhotplug_08.sh
 @@ -28,7 +28,11 @@
  source ../include

Re: [Powertop] [PATCH POWERTOP] Fix various resource leaks

2014-07-02 Thread Amit Kucheria
Mohammad,

We've got a couple of patches that haven't been upstreamed yet. We'll
get to it. Sorry I didn't notice that your patch was to that code.

Regards,
Amit

On Wed, Jul 2, 2014 at 3:41 PM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 I cloned powertop repo from -
 git://git.linaro.org/power/powertop-2.0.git. When I build and run, I
 see an additional tab Device Freq stats and powertop version shows
 2.4.

 I got the copy from github (pointed to by Sergey) now. When I build
 and run, I don't see any Device Freq stats tab and powertop version
 shows 2.6.1.



 On Tue, Jul 1, 2014 at 6:47 PM, Sergey Senozhatsky
 sergey.senozhat...@gmail.com wrote:
 On (07/01/14 17:54), Amit Kucheria wrote:
 Date: Tue, 1 Jul 2014 17:54:15 +0530
 From: Amit Kucheria amit.kuche...@linaro.org
 To: Mohammad Merajul Islam Molla meraj.eni...@gmail.com,
  power...@lists.01.org
 Cc: Lists linaro-dev linaro-dev@lists.linaro.org
 Subject: Re: [Powertop] [PATCH POWERTOP] Fix various resource leaks

 Mohammad,

 This fix should go upstream. cc'ing the powertop list.

 Regards,
 Amit

 On Thu, Jun 26, 2014 at 12:42 PM, Mohammad Merajul Islam Molla
 meraj.eni...@gmail.com wrote:
  Fixes some resource leaks detected by valgrind and coverity scan.
 
 
  diff --git a/src/devices/ahci.cpp b/src/devices/ahci.cpp
  index ac06460..7f704b6 100644
  --- a/src/devices/ahci.cpp
  +++ b/src/devices/ahci.cpp
  @@ -64,8 +64,10 @@ static string disk_name(char *path, char *target,
  char *shortname)
  sprintf(line, %s/%s/model, pathname, dirent-d_name);
  file = fopen(line, r);
  if (file) {
  -   if (fgets(line, 4096, file) == NULL)
  +   if (fgets(line, 4096, file) == NULL) {
  +   fclose(file);
  break;
  +   }
  fclose(file);
  c = strchr(line, '\n');
  if (c)
  diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
  index e16951c..23c4b0c 100644
  --- a/src/devices/devfreq.cpp
  +++ b/src/devices/devfreq.cpp
  @@ -238,6 +238,7 @@ void create_all_devfreq_devices(void)
 
  callback fn = devfreq_dev_callback;
  process_directory(p.c_str(), fn);
  +   closedir(dir);

 I don't see this file at
 https://github.com/fenrus75/powertop/tree/master/src/devices

 afair, process_directory() closes dir.

 -ss

   }
 
   void initialize_devfreq(void)
  diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
  index b0e982b..cf1ae11 100644
  --- a/src/perf/perf_bundle.cpp
  +++ b/src/perf/perf_bundle.cpp
  @@ -142,8 +142,10 @@ static void parse_event_format(const char 
  *event_name)
 
  buf = read_file(file);
  free(file);
  -   if (!buf)
  +   if (!buf) {
  +   free(name);
  return;
  +   }
 
  pevent_parse_event(perf_event::pevent, buf, strlen(buf), sys);
  free(name);
  diff --git a/src/tuning/bluetooth.cpp b/src/tuning/bluetooth.cpp
  index e0bdf12..5100a8a 100644
  --- a/src/tuning/bluetooth.cpp
  +++ b/src/tuning/bluetooth.cpp
  @@ -144,8 +144,10 @@ int bt_tunable::good_bad(void)
  if (file) {
  char line[2048];
  /* first line is standard header */
  -   if (fgets(line, 2047, file) == NULL)
  +   if (fgets(line, 2047, file) == NULL) {
  +   pclose(file);
  goto out;
  +   }
  memset(line, 0, 2048);
  if (fgets(line, 2047, file) == NULL) {
  result = last_check_result = TUNE_GOOD;
 
 
 
  --
  Thanks,
  -Meraj
 
  ___
  linaro-dev mailing list
  linaro-dev@lists.linaro.org
  http://lists.linaro.org/mailman/listinfo/linaro-dev
 
 ___
 PowerTop mailing list
 power...@lists.01.org
 https://lists.01.org/mailman/listinfo/powertop


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH v3] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-07-02 Thread Amit Kucheria
On Thu, Jul 3, 2014 at 7:37 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 By default, cpuhotplug does not run on cpu0. However, if
 we want to allow cpuhotplug to run on cpu0, then we must
 pass the parameter, hotplug_allow_cpu0=1, to make check.

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
 Changes from v2 to v3:
 - Renamed is_cpu0_allowed() function to is_cpu0_hotplug_allowed()
 - Removed $cpu parameter from is_cpu0_allowed function()
 - Modified test condition in check_cpuhotplug_files() function

 Changes from v1 to v2:
 - Rename the parameter from hotplug_cpu_start to hotplug_allow_cpu0
 - Add is_cpu0_allowed() function to check if we want to start running
 test scripts from cpu0..cpuN
 ---
  Makefile|4 ++--
  cpuhotplug/Makefile |2 +-
  cpuhotplug/cpuhotplug_02.sh |2 +-
  cpuhotplug/cpuhotplug_03.sh |2 +-
  cpuhotplug/cpuhotplug_04.sh |2 +-
  cpuhotplug/cpuhotplug_05.sh |2 +-
  cpuhotplug/cpuhotplug_06.sh |2 +-
  cpuhotplug/cpuhotplug_07.sh |2 +-
  cpuhotplug/cpuhotplug_08.sh |6 +-
  include/functions.sh|   18 ++
  10 files changed, 28 insertions(+), 14 deletions(-)

 diff --git a/Makefile b/Makefile
 index 731619d..d76deb7 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -21,14 +21,14 @@
  # Torez Smith torez.sm...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +hotplug_allow_cpu0?=0
  all:
 @(cd utils; $(MAKE))

  check:
 @(cd utils; $(MAKE) check)
 @(cd cpufreq; $(MAKE) check)
 -   @(cd cpuhotplug; $(MAKE) check)
 +   @(cd cpuhotplug; $(MAKE) hotplug_allow_cpu0=${hotplug_allow_cpu0} 
 check)
 @(cd cpuidle; $(MAKE) check)
  #  @(cd suspend; $(MAKE) check)
 @(cd thermal; $(MAKE) check)
 diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
 index df0b8f4..6ee600d 100644
 --- a/cpuhotplug/Makefile
 +++ b/cpuhotplug/Makefile
 @@ -21,5 +21,5 @@
  # Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +export hotplug_allow_cpu0?=0
  include ../Test.mk
 diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
 index 3157307..d2bb5b4 100755
 --- a/cpuhotplug/cpuhotplug_02.sh
 +++ b/cpuhotplug/cpuhotplug_02.sh
 @@ -34,7 +34,7 @@ check_state() {
  shift 1

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
 index 13a0ce9..2a5ae48 100755
 --- a/cpuhotplug/cpuhotplug_03.sh
 +++ b/cpuhotplug/cpuhotplug_03.sh
 @@ -34,7 +34,7 @@ check_affinity_fails() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
 index 394a512..7938e7d 100755
 --- a/cpuhotplug/cpuhotplug_04.sh
 +++ b/cpuhotplug/cpuhotplug_04.sh
 @@ -37,7 +37,7 @@ check_task_migrate() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  taskset 0x$cpumask $CPUBURN $cpu 
 diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
 index a8eb312..4042f2c 100755
 --- a/cpuhotplug/cpuhotplug_05.sh
 +++ b/cpuhotplug/cpuhotplug_05.sh
 @@ -33,7 +33,7 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
 index 347906d..0461e37 100755
 --- a/cpuhotplug/cpuhotplug_06.sh
 +++ b/cpuhotplug/cpuhotplug_06.sh
 @@ -33,7 +33,7 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
 index eaeba77..a3526be 100755
 --- a/cpuhotplug/cpuhotplug_07.sh
 +++ b/cpuhotplug/cpuhotplug_07.sh
 @@ -35,7 +35,7 @@ check_notification() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_hotplug_allowed $hotplug_allow_cpu0 || return 0
  fi

  # damn ! udevadm is buffering the output, we have to use a temp file
 diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh
 index 9e2c355..00315a4 100755
 --- a/cpuhotplug/cpuhotplug_08.sh
 +++ b/cpuhotplug/cpuhotplug_08.sh
 @@ -28,7 +28,11 @@
  source ../include/functions.sh

  function randomize() {
 -echo $[ ( $RANDOM % $1 )  + 1 ]
 +if [ $hotplug_allow_cpu0 -eq 0 ]; then
 +   echo $[ ( $RANDOM % $1 )  + 1 ]
 +else
 +   echo $[ ( $RANDOM % $1 ) ]
 +fi
  }

  random_stress() {
 diff --git a/include/functions.sh b/include/functions.sh
 index 

Re: [PATCH POWERTOP] Remove temporary file created during calibration

2014-07-01 Thread Amit Kucheria
Mohammad,

This fix should go upstream. cc'ing the powertop list.

Regards,
Amit

On Thu, Jun 26, 2014 at 12:27 PM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 powertop creates temporary file in /tmp folder during calibration.
 Simply closing does not remove these files.
 Instead use unlink to remove the file.

 diff --git a/src/calibrate/calibrate.cpp b/src/calibrate/calibrate.cpp
 index db368e0..1336c3f 100644
 --- a/src/calibrate/calibrate.cpp
 +++ b/src/calibrate/calibrate.cpp
 @@ -242,7 +242,7 @@ static void *burn_disk(void *dummy)
 write(fd, buffer, 64*1024);
 fdatasync(fd);
 }
 -   close(fd);
 +   unlink(filename);
 return NULL;
  }



 --
 Thanks,
 -Meraj

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH POWERTOP] Fix various resource leaks

2014-07-01 Thread Amit Kucheria
Mohammad,

This fix should go upstream. cc'ing the powertop list.

Regards,
Amit

On Thu, Jun 26, 2014 at 12:42 PM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 Fixes some resource leaks detected by valgrind and coverity scan.


 diff --git a/src/devices/ahci.cpp b/src/devices/ahci.cpp
 index ac06460..7f704b6 100644
 --- a/src/devices/ahci.cpp
 +++ b/src/devices/ahci.cpp
 @@ -64,8 +64,10 @@ static string disk_name(char *path, char *target,
 char *shortname)
 sprintf(line, %s/%s/model, pathname, dirent-d_name);
 file = fopen(line, r);
 if (file) {
 -   if (fgets(line, 4096, file) == NULL)
 +   if (fgets(line, 4096, file) == NULL) {
 +   fclose(file);
 break;
 +   }
 fclose(file);
 c = strchr(line, '\n');
 if (c)
 diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
 index e16951c..23c4b0c 100644
 --- a/src/devices/devfreq.cpp
 +++ b/src/devices/devfreq.cpp
 @@ -238,6 +238,7 @@ void create_all_devfreq_devices(void)

 callback fn = devfreq_dev_callback;
 process_directory(p.c_str(), fn);
 +   closedir(dir);
  }

  void initialize_devfreq(void)
 diff --git a/src/perf/perf_bundle.cpp b/src/perf/perf_bundle.cpp
 index b0e982b..cf1ae11 100644
 --- a/src/perf/perf_bundle.cpp
 +++ b/src/perf/perf_bundle.cpp
 @@ -142,8 +142,10 @@ static void parse_event_format(const char *event_name)

 buf = read_file(file);
 free(file);
 -   if (!buf)
 +   if (!buf) {
 +   free(name);
 return;
 +   }

 pevent_parse_event(perf_event::pevent, buf, strlen(buf), sys);
 free(name);
 diff --git a/src/tuning/bluetooth.cpp b/src/tuning/bluetooth.cpp
 index e0bdf12..5100a8a 100644
 --- a/src/tuning/bluetooth.cpp
 +++ b/src/tuning/bluetooth.cpp
 @@ -144,8 +144,10 @@ int bt_tunable::good_bad(void)
 if (file) {
 char line[2048];
 /* first line is standard header */
 -   if (fgets(line, 2047, file) == NULL)
 +   if (fgets(line, 2047, file) == NULL) {
 +   pclose(file);
 goto out;
 +   }
 memset(line, 0, 2048);
 if (fgets(line, 2047, file) == NULL) {
 result = last_check_result = TUNE_GOOD;



 --
 Thanks,
 -Meraj

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-30 Thread Amit Kucheria
On Wed, Jun 25, 2014 at 9:48 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Pass hotplug_cpu_start=0 to make check like
 these examples below:

 sudo make -C cpuhotplug hotplug_cpu_start=0 check
 sudo make hotplug_cpu_start=0 check

 to enable cpuhotplug to run on cpu0 to N.

This description doesn't match the behaviour of the scripts below i.e.
It isn't behaving as the start cpu for all the hotplug tests. The
current implementation only checks that if the hotplug_cpu_start is
non-zero it allows hotplugging on all cpus.

So please rename the variable to hotplug_allow_cpu0 with a boolean
(0/1 or yes/no) behaviour.

 The hotplug_cpu_start variable will take the default
 value of 1 if no value is passed so cpuhotplug will
 run on cpu1 to N.

 This fixes bug #49:
 https://bugs.linaro.org/show_bug.cgi?id=49

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  Makefile|4 +++-
  cpuhotplug/Makefile |2 +-
  cpuhotplug/cpuhotplug_02.sh |2 +-
  cpuhotplug/cpuhotplug_03.sh |2 +-
  cpuhotplug/cpuhotplug_04.sh |2 +-
  cpuhotplug/cpuhotplug_05.sh |2 +-
  cpuhotplug/cpuhotplug_06.sh |2 +-
  cpuhotplug/cpuhotplug_07.sh |2 +-
  cpuhotplug/cpuhotplug_08.sh |6 +-
  9 files changed, 15 insertions(+), 9 deletions(-)

 diff --git a/Makefile b/Makefile
 index 731619d..24bbd59 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -22,13 +22,15 @@
  #   - initial API and implementation
  #

 +hotplug_cpu_start?=1
 +

If the semantics are changed as described above, this will become

hotplug_allow_cpu0?=0

  all:
 @(cd utils; $(MAKE))

  check:
 @(cd utils; $(MAKE) check)
 @(cd cpufreq; $(MAKE) check)
 -   @(cd cpuhotplug; $(MAKE) check)
 +   @(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check)
 @(cd cpuidle; $(MAKE) check)
  #  @(cd suspend; $(MAKE) check)
 @(cd thermal; $(MAKE) check)
 diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
 index df0b8f4..a6670c3 100644
 --- a/cpuhotplug/Makefile
 +++ b/cpuhotplug/Makefile
 @@ -21,5 +21,5 @@
  # Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +export hotplug_cpu_start?=1
  include ../Test.mk
 diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
 index 3157307..3f678b9 100755
 --- a/cpuhotplug/cpuhotplug_02.sh
 +++ b/cpuhotplug/cpuhotplug_02.sh
 @@ -33,7 +33,7 @@ check_state() {
  local state=
  shift 1

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then

and this becomes

+if [[ $cpu == cpu0  $hotplug_allow_cpu0 -eq 0 ]]; then

And while you're at it, can you please consolidate this check into a
small library function so we don't have to change it 8 different
scripts in the future?

 return 0
  fi

 diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
 index 13a0ce9..57ff40e 100755
 --- a/cpuhotplug/cpuhotplug_03.sh
 +++ b/cpuhotplug/cpuhotplug_03.sh
 @@ -33,7 +33,7 @@ check_affinity_fails() {
  local dirpath=$CPU_PATH/$1
  local ret=

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then
 return 0
  fi



 diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
 index 394a512..9c08fba 100755
 --- a/cpuhotplug/cpuhotplug_04.sh
 +++ b/cpuhotplug/cpuhotplug_04.sh
 @@ -36,7 +36,7 @@ check_task_migrate() {
  local pid=
  local ret=

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then
 return 0
  fi

 diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
 index a8eb312..f5eb994 100755
 --- a/cpuhotplug/cpuhotplug_05.sh
 +++ b/cpuhotplug/cpuhotplug_05.sh
 @@ -32,7 +32,7 @@ check_procinfo() {
  local cpuid=${cpu:3}
  local ret=

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then
 return 0
  fi

 diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
 index 347906d..93fbadd 100755
 --- a/cpuhotplug/cpuhotplug_06.sh
 +++ b/cpuhotplug/cpuhotplug_06.sh
 @@ -32,7 +32,7 @@ check_procinfo() {
  local cpuid=${cpu:3}
  local ret=

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then
 return 0
  fi

 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
 index eaeba77..2457891 100755
 --- a/cpuhotplug/cpuhotplug_07.sh
 +++ b/cpuhotplug/cpuhotplug_07.sh
 @@ -34,7 +34,7 @@ check_notification() {
  local pid=
  local ret=

 -if [ $cpu == cpu0 ]; then
 +if [[ $cpu == cpu0  $hotplug_cpu_start -ne 0 ]]; then
 return 0
  fi

 diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh
 index 9e2c355..52e1fc2 100755
 --- a/cpuhotplug/cpuhotplug_08.sh
 +++ b/cpuhotplug/cpuhotplug_08.sh
 @@ -28,7 +28,11 @@
  source ../include/functions.sh

  function randomize() {
 -

Re: [PATCH v2] pm-qa/cpuhotplug: Run cpuhotplug on all cpus

2014-06-30 Thread Amit Kucheria
Some nits below:

On Tue, Jul 1, 2014 at 5:35 AM, Lisa Nguyen lisa.ngu...@linaro.org wrote:
 Run the cpuhotplug test suite on all cpus including cpu0. If we wish
 to skip cpu0, pass the parameter, hotplug_allow_cpu0=1, to make check
 like in these examples:

Umm, this description is the opposite of what the default code does.

cpuhotplug testsuite does *not* run on cpu0 by default. If we wish to
*allow* cpu0, we set hotplug_allow_cpu0 to 1.

 sudo make -C cpuhotplug hotplug_allow_cpu0=1 check
 sudo make hotplug_allow_cpu0=1 check

 Changes from v1 to v2:
 - Rename the parameter from hotplug_cpu_start to hotplug_allow_cpu0
 - Add is_cpu0_allowed() function to check if we want to start running
 test scripts from cpu0..cpuN

 Signed-off-by: Lisa Nguyen lisa.ngu...@linaro.org
 ---
  Makefile|3 ++-
  cpuhotplug/Makefile |2 +-
  cpuhotplug/cpuhotplug_02.sh |3 +--
  cpuhotplug/cpuhotplug_03.sh |2 +-
  cpuhotplug/cpuhotplug_04.sh |2 +-
  cpuhotplug/cpuhotplug_05.sh |4 ++--
  cpuhotplug/cpuhotplug_06.sh |4 ++--
  cpuhotplug/cpuhotplug_07.sh |2 +-
  cpuhotplug/cpuhotplug_08.sh |7 ++-
  include/functions.sh|   12 
  10 files changed, 29 insertions(+), 12 deletions(-)

 diff --git a/Makefile b/Makefile
 index 731619d..9f26fd3 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -21,6 +21,7 @@
  # Torez Smith torez.sm...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 +hotplug_allow_cpu0?=0

  all:
 @(cd utils; $(MAKE))
 @@ -28,7 +29,7 @@ all:
  check:
 @(cd utils; $(MAKE) check)
 @(cd cpufreq; $(MAKE) check)
 -   @(cd cpuhotplug; $(MAKE) check)
 +   @(cd cpuhotplug; $(MAKE) hotplug_allow_cpu0=${hotplug_allow_cpu0} 
 check)
 @(cd cpuidle; $(MAKE) check)
  #  @(cd suspend; $(MAKE) check)
 @(cd thermal; $(MAKE) check)
 diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
 index df0b8f4..6ee600d 100644
 --- a/cpuhotplug/Makefile
 +++ b/cpuhotplug/Makefile
 @@ -21,5 +21,5 @@
  # Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
  #   - initial API and implementation
  #
 -
 +export hotplug_allow_cpu0?=0
  include ../Test.mk
 diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
 index 3157307..58e1f02 100755
 --- a/cpuhotplug/cpuhotplug_02.sh
 +++ b/cpuhotplug/cpuhotplug_02.sh
 @@ -24,7 +24,6 @@
  #

  # URL : 
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cpuhotplug_02
 -
  source ../include/functions.sh

  check_state() {
 @@ -34,7 +33,7 @@ check_state() {
  shift 1

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_allowed $cpu $hotplug_allow_cpu0 || return 0

Since is_cpu0_allowed has cpu0 in its name, why pass it $cpu as a
parameter? You are already checking for cpu0 in the if statement. This
can be simplified as

if [ $cpu == cpu0 ]; then
  is_cpu0_allowed $hotplug_allow_cpu0 || return 0

  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
 index 13a0ce9..b29ff8e 100755
 --- a/cpuhotplug/cpuhotplug_03.sh
 +++ b/cpuhotplug/cpuhotplug_03.sh
 @@ -34,7 +34,7 @@ check_affinity_fails() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +   is_cpu0_allowed $cpu $hotplug_allow_cpu0 || return 0
  fi

  set_offline $cpu
 diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
 index 394a512..543853f 100755
 --- a/cpuhotplug/cpuhotplug_04.sh
 +++ b/cpuhotplug/cpuhotplug_04.sh
 @@ -37,7 +37,7 @@ check_task_migrate() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +is_cpu0_allowed $cpu $hotplug_allow_cpu0 || return 0
  fi

  taskset 0x$cpumask $CPUBURN $cpu 
 diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
 index a8eb312..2f33a0c 100755
 --- a/cpuhotplug/cpuhotplug_05.sh
 +++ b/cpuhotplug/cpuhotplug_05.sh
 @@ -33,9 +33,9 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +is_cpu0_allowed $cpu $hotplug_allow_cpu0 || return 0
  fi
 -
 +
  set_offline $cpu

  TAB=$(printf \t); grep processor$TAB: $cpuid /proc/cpuinfo
 diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
 index 347906d..528aeca 100755
 --- a/cpuhotplug/cpuhotplug_06.sh
 +++ b/cpuhotplug/cpuhotplug_06.sh
 @@ -33,9 +33,9 @@ check_procinfo() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +is_cpu0_allowed $cpu $hotplug_allow_cpu0 || return 0
  fi
 -
 +
  set_offline $cpu

  grep CPU$cpuid /proc/interrupts
 diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
 index eaeba77..00fd009 100755
 --- a/cpuhotplug/cpuhotplug_07.sh
 +++ b/cpuhotplug/cpuhotplug_07.sh
 @@ -35,7 +35,7 @@ check_notification() {
  local ret=

  if [ $cpu == cpu0 ]; then
 -   return 0
 +is_cpu0_allowed $cpu 

Re: [PATCH] pm-qa/cpuhotplug: Enable cpuhotplug on cpu0

2014-06-25 Thread Amit Kucheria
On Wed, Jun 25, 2014 at 8:21 PM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 Milosz,

 Yes i meant that. Hmm, i think i am missing the understanding here. So now
 all cpu are hotpluggable?

Technically any cpu can be hotpluggable. But you need to have atleast
one plugged in at anytime else there won't be a kernel left ;)

But some platforms had constraints preventing cpu0 from being
hotplugged, hence the initial constraint in the scripts. We now want
to allow cpu0 to be hotplugged as well so that we can test platforms
where such a constraint no longer exists.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Idlestat output question

2014-06-20 Thread Amit Kucheria
On Fri, Jun 20, 2014 at 4:01 PM, Salman Ahmed salman...@yahoo.com wrote:
 Hello Amit,

 Actually, I ran it on the same machine with the same command again and these 
 time the output has frequency information-

 $ sudo ./idlestat --trace -t 5 -f /tmp/myoutput -- top

 Log is 4.999547 secs long with 710 events
 clusterA@state  hits  total(us) avg(us) min(us) max(us)
  C6-SNB 174  4953094.0028466.06 0.00183909.00
   cpu0@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   1630.00  630.00 630.00  630.00
C6-SNB   111  4995205.0045001.85 8.00279064.00
   cpu0 wakeups  namecount
irq040   eth050
   cpu1@statehits  total(us) avg(us) min(us) max(us)
C6-SNB   54   4997809.0092552.02 125.00  323888.00
   cpu1 wakeups  namecount
irq018   ata_piix10
   cpu2@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   35 19993.00  571.23 121.00  11699.00
C6-SNB   48   4957068.00   103272.25 51.00   323891.00
3101 8487.00   60.88 1.00291.00
1600 78 14303.00  183.37 1.006144.00
   cpu2 wakeups  namecount
   cpu3@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   4379.00   94.75 25.00   128.00
C6-SNB   59   4997441.0084702.39 60.00   323878.00
   cpu3 wakeups  namecount

 So, output sometimes contains frequency information and sometimes it doesn't 
 with the same command. When it does not, trace file does not contain any 
 cpu_frequency entry. So, the problem may not be with idlestat tool since it 
 just parses trace file. Is it possible there is any bug in kernel tracing 
 code?


Does this happen when you run for longer than 5 seconds? Try running
it for 15 seconds 10 times. I wonder if your platform isn't
transitioning P-states in 5 seconds.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Idlestat output question

2014-06-20 Thread Amit Kucheria
Can you try changing your workload?

On Fri, Jun 20, 2014 at 4:57 PM, Salman Ahmed salman...@yahoo.com wrote:
 I tried 10 times running 15 seconds and out of that 3 times I got output 
 without any P-state information.

 --
 Thanks,
 Salman Ahmed



 On Friday, 20 June 2014, 16:49, Amit Kucheria amit.kuche...@linaro.org 
 wrote:
 On Fri, Jun 20, 2014 at 4:01 PM, Salman Ahmed salman...@yahoo.com wrote:



 Hello Amit,

 Actually, I ran it on the same machine with the same command again and these 
 time the output has frequency information-

 $ sudo ./idlestat --trace -t 5 -f /tmp/myoutput -- top

 Log is 4.999547 secs long with 710 events
 clusterA@state  hits  total(us) avg(us) min(us) max(us)
  C6-SNB 174  4953094.0028466.06 0.00183909.00
  cpu0@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   1630.00  630.00 630.00  630.00
C6-SNB   111  4995205.0045001.85 8.00279064.00
   cpu0 wakeups  namecount
irq040   eth050
  cpu1@statehits  total(us) avg(us) min(us) max(us)
C6-SNB   54   4997809.0092552.02 125.00  323888.00
   cpu1 wakeups  namecount
irq018   ata_piix10
  cpu2@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   35 19993.00  571.23 121.00  11699.00
C6-SNB   48   4957068.00   103272.25 51.00   323891.00
3101 8487.00   60.88 1.00291.00
1600 78 14303.00  183.37 1.006144.00
   cpu2 wakeups  namecount
  cpu3@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   4379.00   94.75 25.00   128.00
C6-SNB   59   4997441.0084702.39 60.00   323878.00
   cpu3 wakeups  namecount

 So, output sometimes contains frequency information and sometimes it doesn't 
 with the same command. When it does not, trace file does not contain any 
 cpu_frequency entry. So, the problem may not be with idlestat tool since it 
 just parses trace file. Is it possible there is any bug in kernel tracing 
 code?


 Does this happen when you run for longer than 5 seconds? Try running
 it for 15 seconds 10 times. I wonder if your platform isn't
 transitioning P-states in 5 seconds.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Idlestat output question

2014-06-19 Thread Amit Kucheria
Hi Salman,

On Thu, Jun 19, 2014 at 1:36 PM, Salman Ahmed salman...@yahoo.com wrote:
 Hello,
 Running top command with idlestat tool doesn't show any frequency
 information sometimes. I have run the program with the following
 command -
 # sudo idlestat --trace -t 5 -f /tmp/myoutput /usr/bin/top
 and it ended up with the following output where there is no frequency
 state information. The file myoutput doesn't have any cpu_frequency
 entry either.

There was a bug in the waitpid logic, a fix for which was committed to
the git tree.

Please try this again with the new code.

Also, you might want to use it as such:

sudo idlestat --trace -t 5 -f /tmp/myoutput -- /usr/bin/top

(note the --) to ensure that idlestat doesn't get confused about the
command being another commandline parameter.

 Total trace buffer: 153896 kB
 Log is 4.999488 secs long with 675 events
 clusterA@state  hits  total(us) avg(us) min(us) max(us)
  C6-SNB 163  4955450.0030401.53 0.00141946.00
   cpu0@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   1912.00  912.00 912.00  912.00
C6-SNB   115  4996270.0043445.83 67.00   211819.00
   cpu0 wakeups  namecount
irq040   eth050
   cpu1@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   3  10809.00 3603.00 27.00   10742.00
C6-SNB   62   4985746.0080415.26 59.00   223952.00
   cpu1 wakeups  namecount
irq018   ata_piix6
   cpu2@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   3  10800.00 3600.00 26.00   10745.00
C6-SNB   52   4986684.0095897.77 5724.00 223957.00
   cpu2 wakeups  namecount
   cpu3@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   20 15123.00  756.15 121.00  10895.00
C6-SNB   47   4962591.00   105587.04 1.00223950.00
   cpu3 wakeups  namecount
 Does that mean processors spent all time in idle state and none in active 
 state?

 --
 Best Regards
 Salman Ahmed

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Idlestat output question

2014-06-19 Thread Amit Kucheria
On Fri, Jun 20, 2014 at 9:47 AM, Salman Ahmed salman...@yahoo.com wrote:
 Hello Amit,

 I have pulled changes and run with your suggested following command
 sudo ./idlestat --trace -t 5 -f /tmp/myoutput -- top

 But still it came up with the output without any frequency information.

What platform are you running this on? Is cpufreq enabled? What is the
output of 'cat 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'
?

 Total trace buffer: 153896 kB
 Log is 4.999537 secs long with 702 events
 clusterA@state  hits  total(us) avg(us) min(us) max(us)
  C6-SNB 175  4964449.0028368.28 0.00183908.00
   cpu0@statehits  total(us) avg(us) min(us) max(us)
C6-SNB   105  4995794.0047578.99 49.00   223927.00
   cpu0 wakeups  namecount
irq040   eth039
   cpu1@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   5852.00  170.40 41.00   446.00
C6-SNB   64   4996275.0078066.80 113.00  323886.00
   cpu1 wakeups  namecount
irq018   ata_piix14
   cpu2@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   35  9158.00  261.66 121.00  1396.00
C6-SNB   51   4969643.0097443.98 51.00   323897.00
   cpu2 wakeups  namecount
   cpu3@statehits  total(us) avg(us) min(us) max(us)
C1-SNB   4383.00   95.75 26.00   129.00
C6-SNB   49   4997267.00   101985.04 67.00   319905.00
   cpu3 wakeups  namecount

 The problem probably is not in idlestat tool. There is no cpu_frequency line 
 in the trace file.

 --
 Best Regards
 Salman Ahmed

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH IDLESTAT] minor fixes

2014-06-08 Thread Amit Kucheria
Thanks for the fixes Mohammad.

On Mon, Jun 9, 2014 at 8:57 AM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 Patch to fix some minor issues in idlestat tool -

- use USEC_PER_SEC instead of hardcoded value
- replace 'f' with 'stderr'
- check for root only if idlestat is run in trace mode
- increase MAXCSTATE  MAXPSTATE to 16 as per Daniel's suggestion.
 Needs to be dynamically determined in future.

I've split these up into three different patches, made some cosmetic
changes and pushed to the git tree.


 diff --git a/idlestat.c b/idlestat.c
 index 787d7b0..e9f556b 100644
 --- a/idlestat.c
 +++ b/idlestat.c
 @@ -47,6 +47,7 @@
  #include topology.h

  #define IDLESTAT_VERSION 0.3
 +#define USEC_PER_SEC 100

  static char irq_type_name[][8] = {
   irq,
 @@ -193,7 +194,7 @@ static struct cpuidle_data *intersection(struct
 cpuidle_data *data1,
   data-begin = begin;
   data-end = end;
   data-duration = end - begin;
 - data-duration *= 100;
 + data-duration *= USEC_PER_SEC;

   return data;
  }
 @@ -510,7 +511,6 @@ static void open_next_pstate(struct
 cpufreq_pstates *ps, int s, double time)
   open_current_pstate(ps, time);
  }

 -#define USEC_PER_SEC 100
  static void close_current_pstate(struct cpufreq_pstates *ps, double time)
  {
   int c = ps-current;
 @@ -617,7 +617,7 @@ static int store_data(double time, int state, int cpu,
   return 0;

   /* convert to us */
 - data-duration *= 100;
 + data-duration *= USEC_PER_SEC;

   cstate-min_time = MIN(cstate-min_time, data-duration);

 @@ -1110,7 +1110,7 @@ static int idlestat_store(const char *path)
   f = fopen(path, w+);

   if (!f) {
 - fprintf(f, %s: failed to open '%s': %m\n, __func__, path);
 + fprintf(stderr, %s: failed to open '%s': %m\n, __func__, path);
   return -1;
   }

 @@ -1230,7 +1230,7 @@ int main(int argc, char *argv[], char *const envp[])
   return 1;

   /* We have to manipulate some files only accessible to root */
 - if (getuid()) {
 + if ((options.mode == TRACE)  getuid()) {
   fprintf(stderr, must be root to run the tool\n);
   return -1;
   }
 diff --git a/idlestat.h b/idlestat.h
 index 74238ff..1977ab4 100644
 --- a/idlestat.h
 +++ b/idlestat.h
 @@ -29,8 +29,8 @@

  #define BUFSIZE 256
  #define NAMELEN 16
 -#define MAXCSTATE 8
 -#define MAXPSTATE 8
 +#define MAXCSTATE 16
 +#define MAXPSTATE 16
  #define MAX(A, B) (A  B ? A : B)
  #define MIN(A, B) (A  B ? A : B)
  #define AVG(A, B, I) ((A) + ((B - A) / (I)))

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [idlestat 0/6] More cleanups

2014-06-03 Thread Amit Kucheria
Thanks. Pushed out to git.

On Tue, Jun 3, 2014 at 6:08 PM, Daniel Lezcano
daniel.lezc...@linaro.org wrote:
 On 06/02/2014 02:49 PM, Amit Kucheria wrote:

 From: Amit Kucheria amit.kuche...@linaro.org

 More cleanups to the command-line options to make idlestat easier to use
 and
 separate the two modes: tracing and reporting.

 Regards,
 Amit

 Amit Kucheria (6):
Use the correct version in the log file
Print more details when fopen fails
kick the dump option off to use -z and release -m for later
-o stands for output file when idlestat can take an input file as well
Introduce --trace and --import mode
Lots of changes related to usage, bump the version to 0.3

   README | 10 -
   idlestat.c | 71
 +++---
   2 files changed, 54 insertions(+), 27 deletions(-)


 For the whole series:

 Acked-by: Daniel Lezcano daniel.lezc...@linaro.org


 --
  http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs

 Follow Linaro:  http://www.facebook.com/pages/Linaro Facebook |
 http://twitter.com/#!/linaroorg Twitter |
 http://www.linaro.org/linaro-blog/ Blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: idlestat: possible bug?

2014-06-02 Thread Amit Kucheria
Hi Mohammad,

Yes, I found and fixed that bug in my local tree. Will push it out later today.

In the meanwhile, please use the -t option (it is compulsory) to take
traces on the local machine.

Regards,
Amit

On Mon, Jun 2, 2014 at 2:03 PM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 Hi

 I was trying to run idlestat and with the below command output is -

 # sudo ./idlestat -o /tmp/myoutput
 fopen: No such file or directory

 I looked into the source and it looks like its not entering in the if
 condition in main -

 1212 /* Acquisition time specified means we will get the traces */
 1213 if (options.duration || args  argc) {
 1214
 1215 /* Read cpu topology info from sysfs */
 1216 read_sysfs_cpu_topo();

  ...

 1260  if (idlestat_store(options.filename))
 1261 return -1;
   }

 Since duration argument is not given and args is actually equal to argc, if
 condition is evaluated false.

 So idlestat_store() is not creating the file /tmp/myoutput or storing any
 info there.

 As a result, call to idlestat_load is issues above error message.

 1264 /* Load the idle states information */
 1265 datas = idlestat_load(options.filename);
 1266 if (!datas)
 1267 return 1;

 I think the fix is simply to change the if condition above and make it -

 1212 /* Acquisition time specified means we will get the traces */
 1213 if (options.duration || args = argc) {
 1214
  }



 --
 Thanks,
 -Meraj





___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 5/6] Introduce --trace and --import mode

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

--trace will create a local trace and use that for the report
--import will import an existing trace

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 README | 10 --
 idlestat.c | 36 +++-
 2 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/README b/README
index 1a917b4..3bd48ed 100644
--- a/README
+++ b/README
@@ -35,10 +35,8 @@ Help
 Example Usage
 -
 
-./idlestat -f /tmp/myoutput -t 10
-
-where,
-
--f : output file to store the traces
--t : the duration in seconds
+Trace mode:
+sudo ./idlestat --trace -f /tmp/myoutput -t 10
 
+Reporing mode (/tmp/mytrace already contains traces):
+sudo ./idlestat --import -f /tmp/mytrace
diff --git a/idlestat.c b/idlestat.c
index 5320155..a5619a9 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -948,12 +948,18 @@ struct cpuidle_cstates *physical_cluster_data(struct 
cpu_physical *s_phy)
 static void help(const char *cmd)
 {
fprintf(stderr,
-   \nUsage:\n%s -f|--trace-file file [-z|--dump]
-[-t|--duration seconds] [-i|--iterations number]
-[-d|--debug]\n,
+   \nUsage:\nTrace mode: %s --trace -f|--trace-file filename
+-t|--duration seconds 
+   [-z|--dump] [-i|--iterations number] [-d|--debug]\n,
basename(cmd));
fprintf(stderr,
-   \nExample:\n%s -f /tmp/myoutput -t 30\n, basename(cmd));
+   \nReporting mode: %s --import -f|--trace-file filename
+   [-z|--dump] [-i|--iterations number] [-d|--debug]\n,
+   basename(cmd));
+   fprintf(stderr,
+   \nExample:\n%s --trace -f /tmp/myoutput -t 30\n, 
basename(cmd));
+   fprintf(stderr,
+   \nExample:\n%s --import -f /tmp/mytrace\n, basename(cmd));
 }
 
 static void version(const char *cmd)
@@ -961,10 +967,16 @@ static void version(const char *cmd)
printf(%s version %s\n, basename(cmd), IDLESTAT_VERSION);
 }
 
+enum modes {
+  TRACE=1,
+  IMPORT
+};
+
 struct program_options {
bool debug;
bool dump;
int iterations;
+   int mode;
unsigned int duration;
char *filename;
 };
@@ -972,6 +984,8 @@ struct program_options {
 int getoptions(int argc, char *argv[], struct program_options *options)
 {
struct option long_options[] = {
+   { trace,   no_argument,   options-mode, TRACE },
+   { import,  no_argument,   options-mode, IMPORT },
{ debug,   no_argument,   NULL, 'd' },
{ trace-file,  required_argument, NULL, 'f' },
{ help,no_argument,   NULL, 'h' },
@@ -1037,11 +1051,23 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
if (options-iterations  0)
fprintf(stderr, dump values must be a positive value\n);
 
+   if (options-mode = 0) {
+   fprintf(stderr, select a mode: --trace or --import\n);
+   return -1;
+   }
+
if (NULL == options-filename) {
fprintf(stderr, expected -f trace filename\n);
return -1;
}
 
+   if (options-mode == TRACE) {
+   if (options-duration = 0) {
+   fprintf(stderr, expected -t seconds\n);
+   return -1;
+   }
+   }
+
return optind;
 }
 
@@ -1213,7 +1239,7 @@ int main(int argc, char *argv[], char *const envp[])
init_cpu_topo_info();
 
/* Acquisition time specified means we will get the traces */
-   if (options.duration || args  argc) {
+   if ((options.mode == TRACE) || args  argc) {
 
/* Read cpu topology info from sysfs */
read_sysfs_cpu_topo();
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 3/6] kick the dump option off to use -z and release -m for later

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 998f62d..233d554 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -948,7 +948,7 @@ struct cpuidle_cstates *physical_cluster_data(struct 
cpu_physical *s_phy)
 static void help(const char *cmd)
 {
fprintf(stderr,
-   \nUsage:\n%s -o|--output-file file [-m|--dump]
+   \nUsage:\n%s -o|--output-file file [-z|--dump]
 [-t|--duration seconds] [-i|--iterations number]
 [-d|--debug]\n,
basename(cmd));
@@ -975,10 +975,10 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
{ debug,   no_argument,   NULL, 'd' },
{ help,no_argument,   NULL, 'h' },
{ iterations,  required_argument, NULL, 'i' },
-   { dump,no_argument,   NULL, 'm' },
{ output-file, required_argument, NULL, 'o' },
{ duration,required_argument, NULL, 't' },
{ version, no_argument,   NULL, 'V' },
+   { dump,no_argument,   NULL, 'z' },
{ 0, 0, 0, 0 }
};
int c;
@@ -990,7 +990,7 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, :dhi:mo:t:V,
+   c = getopt_long(argc, argv, :dhi:o:t:Vz,
long_options, optindex);
if (c == -1)
break;
@@ -1006,9 +1006,6 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
case 'i':
options-iterations = atoi(optarg);
break;
-   case 'm':
-   options-dump = true;
-   break;
case 'o':
options-filename = optarg;
break;
@@ -1019,6 +1016,9 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
version(argv[0]);
exit(0);
break;
+   case 'z':
+   options-dump = true;
+   break;
case 0: /* getopt_long() set a variable, just keep going */
break;
case ':':   /* missing option argument */
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 6/6] Lots of changes related to usage, bump the version to 0.3

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/idlestat.c b/idlestat.c
index a5619a9..787d7b0 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -46,7 +46,7 @@
 #include list.h
 #include topology.h
 
-#define IDLESTAT_VERSION 0.3-rc2
+#define IDLESTAT_VERSION 0.3
 
 static char irq_type_name[][8] = {
irq,
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 4/6] -o stands for output file when idlestat can take an input file as well

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

idlestat can take a pre-created tracefile as input or create one itself. The
-o option is confusing for an input file. Change it to -f in preparation for a
new option to signify what the file name is to be used for.

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 README |  4 ++--
 idlestat.c | 16 
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 24485c5..1a917b4 100644
--- a/README
+++ b/README
@@ -35,10 +35,10 @@ Help
 Example Usage
 -
 
-./idlestat -o /tmp/myoutput -t 10
+./idlestat -f /tmp/myoutput -t 10
 
 where,
 
--o : output file to store the traces
+-f : output file to store the traces
 -t : the duration in seconds
 
diff --git a/idlestat.c b/idlestat.c
index 233d554..5320155 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -948,12 +948,12 @@ struct cpuidle_cstates *physical_cluster_data(struct 
cpu_physical *s_phy)
 static void help(const char *cmd)
 {
fprintf(stderr,
-   \nUsage:\n%s -o|--output-file file [-z|--dump]
+   \nUsage:\n%s -f|--trace-file file [-z|--dump]
 [-t|--duration seconds] [-i|--iterations number]
 [-d|--debug]\n,
basename(cmd));
fprintf(stderr,
-   \nExample:\n%s -o /tmp/myoutput -t 30\n, basename(cmd));
+   \nExample:\n%s -f /tmp/myoutput -t 30\n, basename(cmd));
 }
 
 static void version(const char *cmd)
@@ -973,9 +973,9 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
 {
struct option long_options[] = {
{ debug,   no_argument,   NULL, 'd' },
+   { trace-file,  required_argument, NULL, 'f' },
{ help,no_argument,   NULL, 'h' },
{ iterations,  required_argument, NULL, 'i' },
-   { output-file, required_argument, NULL, 'o' },
{ duration,required_argument, NULL, 't' },
{ version, no_argument,   NULL, 'V' },
{ dump,no_argument,   NULL, 'z' },
@@ -990,7 +990,7 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, :dhi:o:t:Vz,
+   c = getopt_long(argc, argv, :df:hi:t:Vz,
long_options, optindex);
if (c == -1)
break;
@@ -999,6 +999,9 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
case 'd':
options-debug = true;
break;
+   case 'f':
+   options-filename = optarg;
+   break;
case 'h':
help(argv[0]);
exit(0);
@@ -1006,9 +1009,6 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
case 'i':
options-iterations = atoi(optarg);
break;
-   case 'o':
-   options-filename = optarg;
-   break;
case 't':
options-duration = atoi(optarg);
break;
@@ -1038,7 +1038,7 @@ int getoptions(int argc, char *argv[], struct 
program_options *options)
fprintf(stderr, dump values must be a positive value\n);
 
if (NULL == options-filename) {
-   fprintf(stderr, expected -o filename\n);
+   fprintf(stderr, expected -f trace filename\n);
return -1;
}
 
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 2/6] Print more details when fopen fails

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

Useful for tracking down why the following command fails:
sudo ./idlestat -o /tmp/newfile

where, newfile doesn't already exist

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 9d88ee9..998f62d 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -749,8 +749,10 @@ static struct cpuidle_datas *idlestat_load(const char 
*path)
int ret;
 
f = fopen(path, r);
-   if (!f)
-   return ptrerror(fopen);
+   if (!f) {
+   fprintf(stderr, %s: failed to open '%s': %m\n, __func__, 
path);
+   return NULL;
+   }
 
/* version line */
fgets(buffer, BUFSIZE, f);
@@ -1055,7 +1057,7 @@ static int idlestat_file_for_each_line(const char *path, 
void *data,
f = fopen(path, r);
 
if (!f) {
-   fprintf(stderr, failed to open '%s': %m\n, path);
+   fprintf(stderr, %s: failed to open '%s': %m\n, __func__, 
path);
return -1;
}
 
@@ -1080,8 +1082,9 @@ static int idlestat_store(const char *path)
return -1;
 
f = fopen(path, w+);
+
if (!f) {
-   fprintf(f, failed to open '%s': %m\n, path);
+   fprintf(f, %s: failed to open '%s': %m\n, __func__, path);
return -1;
}
 
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 1/6] Use the correct version in the log file

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/idlestat.c b/idlestat.c
index 9228618..9d88ee9 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -1085,7 +1085,7 @@ static int idlestat_store(const char *path)
return -1;
}
 
-   fprintf(f, version = 1\n);
+   fprintf(f, version = %s\n, IDLESTAT_VERSION);
fprintf(f, cpus=%d\n, ret);
 
/* output topology information */
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[idlestat 0/6] More cleanups

2014-06-02 Thread Amit Kucheria
From: Amit Kucheria amit.kuche...@linaro.org

More cleanups to the command-line options to make idlestat easier to use and
separate the two modes: tracing and reporting.

Regards,
Amit

Amit Kucheria (6):
  Use the correct version in the log file
  Print more details when fopen fails
  kick the dump option off to use -z and release -m for later
  -o stands for output file when idlestat can take an input file as well
  Introduce --trace and --import mode
  Lots of changes related to usage, bump the version to 0.3

 README | 10 -
 idlestat.c | 71 +++---
 2 files changed, 54 insertions(+), 27 deletions(-)

-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 7/9] struct option long_options doesn't need to be global

2014-06-01 Thread Amit Kucheria
Thank for the review. I've made the requested change and pushed all
these fixes with your Ack.

On Fri, May 30, 2014 at 1:13 PM, Daniel Lezcano
daniel.lezc...@linaro.org wrote:
 On 05/29/2014 12:17 AM, Amit Kucheria wrote:

 Change the flag field to NULL while we're at it

 Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
 ---
   idlestat.c | 21 ++---
   1 file changed, 10 insertions(+), 11 deletions(-)

 diff --git a/idlestat.c b/idlestat.c
 index 96fc1f2..c4a405a 100644
 --- a/idlestat.c
 +++ b/idlestat.c
 @@ -955,17 +955,6 @@ static void version(const char *cmd)
 printf(%s version %s\n, basename(cmd), IDLESTAT_VERSION);
   }

 -static struct option long_options[] = {
 -   { debug,   no_argument,   0, 'd' },
 -   { help,no_argument,   0, 'h' },
 -   { iterations,  required_argument, 0, 'i' },
 -   { dump,no_argument,   0, 'm' },
 -   { output-file, required_argument, 0, 'o' },
 -   { duration,required_argument, 0, 't' },
 -   { version, no_argument,   0, 'V' },
 -   { 0, 0, 0, 0 }
 -};
 -
   struct idledebug_options {
 bool debug;
 bool dump;
 @@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct
 idledebug_options *options)

 while (1) {

 +   static struct option long_options[] = {
 +   { debug,   no_argument,   NULL, 'd' },
 +   { help,no_argument,   NULL, 'h' },
 +   { iterations,  required_argument, NULL, 'i' },
 +   { dump,no_argument,   NULL, 'm' },
 +   { output-file, required_argument, NULL, 'o' },
 +   { duration,required_argument, NULL, 't' },
 +   { version, no_argument,   NULL, 'V' },
 +   { 0, 0, 0, 0 }
 +   };



 Why not move this declaration at the beginning of the function and remove
 the 'static' ?


 int optindex = 0;

 c = getopt_long(argc, argv, :dhi:mo:t:V,



 --
  http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs

 Follow Linaro:  http://www.facebook.com/pages/Linaro Facebook |
 http://twitter.com/#!/linaroorg Twitter |
 http://www.linaro.org/linaro-blog/ Blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 6/9] Make getopt_long handling more robust

2014-05-28 Thread Amit Kucheria
Adding ':' as first character of optstring to getopt_long allows separating
error message for invalid option and invalid option arguments

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index a3b9363..96fc1f2 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -985,7 +985,7 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, dhi:mo:t:V,
+   c = getopt_long(argc, argv, :dhi:mo:t:V,
long_options, optindex);
if (c == -1)
break;
@@ -1014,11 +1014,16 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
version(argv[0]);
exit(0);
break;
-   case '?':
-   fprintf(stderr, %s: Unknown option %c'.\n,
+   case 0: /* getopt_long() set a variable, just keep going */
+   break;
+   case ':':   /* missing option argument */
+   fprintf(stderr, %s: option `-%c' requires an 
argument\n,
argv[0], optopt);
-   /* fall through */
+   return -1;
+   case '?':   /* invalid option */
default:
+   fprintf(stderr, %s: Unknown option `-%c'.\n,
+   argv[0], optopt);
return -1;
}
}
@@ -1027,7 +1032,7 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
fprintf(stderr, dump values must be a positive value\n);
 
if (NULL == options-filename) {
-   fprintf(stderr, expected filename\n);
+   fprintf(stderr, expected -o filename\n);
return -1;
}
 
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 4/9] Specify which options need arguments and which don't to help getopt_long()

2014-05-28 Thread Amit Kucheria
Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 7de9c1d..48e4166 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -956,14 +956,14 @@ static void version(const char *cmd)
 }
 
 static struct option long_options[] = {
-   { dump,0, 0, 'd' },
-   { debug,   0, 0, 'g' },
-   { help,0, 0, 'h' },
-   { iterations,  0, 0, 'i' },
-   { output-file, 0, 0, 'o' },
-   { duration,0, 0, 't' },
-   { version, 0, 0, 'V' },
-   { 0, 0, 0, 0   }
+   { dump,no_argument,   0, 'd' },
+   { debug,   no_argument,   0, 'g' },
+   { help,no_argument,   0, 'h' },
+   { iterations,  required_argument, 0, 'i' },
+   { output-file, required_argument, 0, 'o' },
+   { duration,required_argument, 0, 't' },
+   { version, no_argument,   0, 'V' },
+   { 0, 0, 0, 0 }
 };
 
 struct idledebug_options {
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 1/9] 'verbose' option isn't used anywhere, remove it

2014-05-28 Thread Amit Kucheria
Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 3b4bd17..27000aa 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -960,7 +960,6 @@ static struct option long_options[] = {
{ iterations,  0, 0, 'i' },
{ debug,   0, 0, 'g' },
{ output-file, 0, 0, 'o' },
-   { verbose, 0, 0, 'v' },
{ version, 0, 0, 'V' },
{ help,0, 0, 'h' },
{ 0, 0, 0, 0   }
@@ -985,7 +984,7 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, gdvVho:i:t:,
+   c = getopt_long(argc, argv, gdVho:i:t:,
long_options, optindex);
if (c == -1)
break;
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 3/9] Adding missing 'duration' option in long_options

2014-05-28 Thread Amit Kucheria
commit 1e80e5eaf71b606405cbdf6751aa7446533d8b3a (idlestat: get ride of
trace-cmd) seems to have missed adding this

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/idlestat.c b/idlestat.c
index 8e3cec0..7de9c1d 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -961,6 +961,7 @@ static struct option long_options[] = {
{ help,0, 0, 'h' },
{ iterations,  0, 0, 'i' },
{ output-file, 0, 0, 'o' },
+   { duration,0, 0, 't' },
{ version, 0, 0, 'V' },
{ 0, 0, 0, 0   }
 };
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 0/9] idlestat trivial cleanups

2014-05-28 Thread Amit Kucheria
Hi,

These are a few cleanups around idlestat commandline options while I was
working on reformating the report.

Regards,
Amit

Amit Kucheria (9):
  'verbose' option isn't used anywhere, remove it
  Sort options in alphabetic order of the single-char options
  Adding missing 'duration' option in long_options
  Specify which options need arguments and which don't to help
getopt_long()
  Stick to -d for debug according to widely used convention
  Make getopt_long handling more robust
  struct option long_options doesn't need to be global
  improve help - show all available options
  idledebug? When did we ever call it that?

 README |  7 +--
 idlestat.c | 71 +++---
 2 files changed, 45 insertions(+), 33 deletions(-)

-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 8/9] improve help - show all available options

2014-05-28 Thread Amit Kucheria
Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 README |  7 +--
 idlestat.c | 11 ---
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 3a8eb49..24485c5 100644
--- a/README
+++ b/README
@@ -28,14 +28,17 @@ Requirements
 1. It must be run as root in order to access /sys/kernel/debug.
 2. It requires tracing to be enabled in the kernel
 
+Help
+
+./idlestat -h will show all the options
+
 Example Usage
 -
 
-./idlestat -d -o myoutput -t 10
+./idlestat -o /tmp/myoutput -t 10
 
 where,
 
--d : dump the states at the end
 -o : output file to store the traces
 -t : the duration in seconds
 
diff --git a/idlestat.c b/idlestat.c
index c4a405a..849b6dd 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -946,8 +946,12 @@ struct cpuidle_cstates *physical_cluster_data(struct 
cpu_physical *s_phy)
 static void help(const char *cmd)
 {
fprintf(stderr,
-   %s [-m|--dump] [-t seconds] -o|--output-file file\n,
+   \nUsage:\n%s -o|--output-file file [-m|--dump]
+[-t|--duration seconds] [-i|--iterations number]
+[-d|--debug]\n,
basename(cmd));
+   fprintf(stderr,
+   \nExample:\n%s -o /tmp/myoutput -t 30\n, basename(cmd));
 }
 
 static void version(const char *cmd)
@@ -1017,12 +1021,13 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
break;
case ':':   /* missing option argument */
fprintf(stderr, %s: option `-%c' requires an 
argument\n,
-   argv[0], optopt);
+   basename(argv[0]), optopt);
return -1;
case '?':   /* invalid option */
default:
fprintf(stderr, %s: Unknown option `-%c'.\n,
-   argv[0], optopt);
+   basename(argv[0]), optopt);
+   help(argv[0]);
return -1;
}
}
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 5/9] Stick to -d for debug according to widely used convention

2014-05-28 Thread Amit Kucheria
Switch the dump option (which might be used infrequently) to use -m

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 48e4166..a3b9363 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -946,7 +946,7 @@ struct cpuidle_cstates *physical_cluster_data(struct 
cpu_physical *s_phy)
 static void help(const char *cmd)
 {
fprintf(stderr,
-   %s [-d|--dump] [-t seconds] -o|--output-file file\n,
+   %s [-m|--dump] [-t seconds] -o|--output-file file\n,
basename(cmd));
 }
 
@@ -956,10 +956,10 @@ static void version(const char *cmd)
 }
 
 static struct option long_options[] = {
-   { dump,no_argument,   0, 'd' },
-   { debug,   no_argument,   0, 'g' },
+   { debug,   no_argument,   0, 'd' },
{ help,no_argument,   0, 'h' },
{ iterations,  required_argument, 0, 'i' },
+   { dump,no_argument,   0, 'm' },
{ output-file, required_argument, 0, 'o' },
{ duration,required_argument, 0, 't' },
{ version, no_argument,   0, 'V' },
@@ -985,16 +985,13 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, dghi:o:t:V,
+   c = getopt_long(argc, argv, dhi:mo:t:V,
long_options, optindex);
if (c == -1)
break;
 
switch (c) {
case 'd':
-   options-dump = true;
-   break;
-   case 'g':
options-debug = true;
break;
case 'h':
@@ -1004,6 +1001,9 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
case 'i':
options-iterations = atoi(optarg);
break;
+   case 'm':
+   options-dump = true;
+   break;
case 'o':
options-filename = optarg;
break;
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 2/9] Sort options in alphabetic order of the single-char options

2014-05-28 Thread Amit Kucheria
Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 27000aa..8e3cec0 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -957,11 +957,11 @@ static void version(const char *cmd)
 
 static struct option long_options[] = {
{ dump,0, 0, 'd' },
-   { iterations,  0, 0, 'i' },
{ debug,   0, 0, 'g' },
+   { help,0, 0, 'h' },
+   { iterations,  0, 0, 'i' },
{ output-file, 0, 0, 'o' },
{ version, 0, 0, 'V' },
-   { help,0, 0, 'h' },
{ 0, 0, 0, 0   }
 };
 
@@ -969,8 +969,8 @@ struct idledebug_options {
bool debug;
bool dump;
int iterations;
-   char *filename;
unsigned int duration;
+   char *filename;
 };
 
 int getoptions(int argc, char *argv[], struct idledebug_options *options)
@@ -984,30 +984,30 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
 
int optindex = 0;
 
-   c = getopt_long(argc, argv, gdVho:i:t:,
+   c = getopt_long(argc, argv, dghi:o:t:V,
long_options, optindex);
if (c == -1)
break;
 
switch (c) {
+   case 'd':
+   options-dump = true;
+   break;
case 'g':
options-debug = true;
break;
-   case 'd':
-   options-dump = true;
+   case 'h':
+   help(argv[0]);
+   exit(0);
break;
case 'i':
options-iterations = atoi(optarg);
break;
-   case 't':
-   options-duration = atoi(optarg);
-   break;
case 'o':
options-filename = optarg;
break;
-   case 'h':
-   help(argv[0]);
-   exit(0);
+   case 't':
+   options-duration = atoi(optarg);
break;
case 'V':
version(argv[0]);
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH 7/9] struct option long_options doesn't need to be global

2014-05-28 Thread Amit Kucheria
Change the flag field to NULL while we're at it

Signed-off-by: Amit Kucheria amit.kuche...@linaro.org
---
 idlestat.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/idlestat.c b/idlestat.c
index 96fc1f2..c4a405a 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -955,17 +955,6 @@ static void version(const char *cmd)
printf(%s version %s\n, basename(cmd), IDLESTAT_VERSION);
 }
 
-static struct option long_options[] = {
-   { debug,   no_argument,   0, 'd' },
-   { help,no_argument,   0, 'h' },
-   { iterations,  required_argument, 0, 'i' },
-   { dump,no_argument,   0, 'm' },
-   { output-file, required_argument, 0, 'o' },
-   { duration,required_argument, 0, 't' },
-   { version, no_argument,   0, 'V' },
-   { 0, 0, 0, 0 }
-};
-
 struct idledebug_options {
bool debug;
bool dump;
@@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct 
idledebug_options *options)
 
while (1) {
 
+   static struct option long_options[] = {
+   { debug,   no_argument,   NULL, 'd' },
+   { help,no_argument,   NULL, 'h' },
+   { iterations,  required_argument, NULL, 'i' },
+   { dump,no_argument,   NULL, 'm' },
+   { output-file, required_argument, NULL, 'o' },
+   { duration,required_argument, NULL, 't' },
+   { version, no_argument,   NULL, 'V' },
+   { 0, 0, 0, 0 }
+   };
int optindex = 0;
 
c = getopt_long(argc, argv, :dhi:mo:t:V,
-- 
1.9.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Powertop Bugs on ARM [1311381, 1316096]

2014-05-06 Thread Amit Kucheria
Hi Mohammad,

Thanks for investigating. Care to send this patch as a diff?

Also, we'll need to come up with a better solution that to add the
Samsung string in there before we submit this upstream.

Regards,
Amit

On Tue, May 6, 2014 at 11:06 AM, Mohammad Merajul Islam Molla
meraj.eni...@gmail.com wrote:
 Hello,

 I tested powertop on Samsung Arndale Board with Ubuntu Saucy Server 14.01
 with custom kernel (config file attached, powertop config options enabled),
 and reported a bug 1316096. Also, I found the other bug 1316096 happening on
 arndale board.

 In short, bug 1316096 - Powertop displays nan on top [summary] where it
 should show legal value.
  Summary: nan wakeups/second, nan
 GPU ops/seconds, nan VFS ops/sec and -0.0% CPU use --- displays nan
 instead of valid value

bug 1316096 - Idle stats  Frequency stats pages are empty.

 I did some debugging and it seems that the root cause of both the bugs may
 be same. It looks like the parsing code enumerate_cpus()[src/cpu/cpu.cpp]
 called from main.cpp, is expecting /proc/cpuinfo file in a particular format
 which works on Intel but not on ARM.

 On Intel, it gets the file in the format expected. However, on ARM on
 Arndale board with saucy server, the file looks as below -

 processor   : 0
 model name  : ARMv7 Processor rev 4 (v7l)
 Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4
 idiva idivt vfpd32 lpae evtstrm
 CPU implementer : 0x41
 CPU architecture: 7
 CPU variant : 0x0
 CPU part: 0xc0f
 CPU revision: 4

 processor   : 1
 model name  : ARMv7 Processor rev 4 (v7l)
 Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4
 idiva idivt vfpd32 lpae evtstrm
 CPU implementer : 0x41
 CPU architecture: 7
 CPU variant : 0x0
 CPU part: 0xc0f
 CPU revision: 4

 Hardware: SAMSUNG EXYNOS5 (Flattened Device Tree)
 Revision: 
 Serial  : 

 The parsing code which gathers information about cpus, fails to parse this
 file and as a result the vector all_cpus remains empty.

 I played with it a bit more and added a few lines to get a work around as
 follows -

 in function enumarate_cpus():

  if (strncmp(line, processor\t,10) == 0) {
  char *c;
  c = strchr(line, ':');
 if (c) {
  c++;
  number = strtoull(c, NULL, 10);
  handle_one_cpu(number, Samsung, 0, 0); [
 line added]
  set_max_cpu(number); [ line added]
  }
}

 With this changes, idle stat and frequency pages were populated and summary
 was shown properly as noted below -

 Summary: 392.6 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and
 4.0% CPU use

 I think due to this bug, the information shown on summary page was also not
 correct and some other info displayed by powertop may be incorrect too.

 Please comment.

 --
 Thanks,
 -Meraj







___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] Output format of powerdebug is messed up on Samsung Arndale Board

2014-04-21 Thread Amit Kucheria
Thanks for the patch Mohammad.

Sanjay, I thought we detect terminal size at startup. Can we change this
dynamically?


On Mon, Apr 21, 2014 at 1:44 PM, Mohammad Merajul Islam Molla 
meraj.eni...@gmail.com wrote:

 Hello,

 This is for launchpad bug 1307896 (
 https://bugs.launchpad.net/linaro-powerdebug/+bug/1307896).

 While displaying information about Regulators output becomes really
 messy (zig zag) on Samsung Arndale Board (Exynos 5250, Cortex A-15). It
 looks like the output field size 11 for printing regulator name is not
 enough. Some regulators have longer names. Hence proposing to increase
 this field size to a higher value, i.e. 25.

 Patch goes here -
 

 diff --git a/regulator.c b/regulator.c

 index 9cd89fd..045cceb 100644

 --- a/regulator.c

 +++ b/regulator.c

 @@ -127,7 +127,7 @@ static int regulator_display_cb(struct tree *t, void
 *data)

 if (!strlen(reg-name))

 return 0;


 -   if (asprintf(buf, %-11s %-11s %-11s %-11s %-11d %-11d %-11d
 %-12d,

 +   if (asprintf(buf, %-25s %-11s %-11s %-11s %-11d %-11d %-11d
 %-12d,

  reg-name, reg-status, reg-state, reg-type,

  reg-num_users, reg-microvolts, reg-min_microvolts,

  reg-max_microvolts)  0)

 @@ -147,7 +147,7 @@ static int regulator_print_header(void)

 char *buf;

 int ret;


 -   if (asprintf(buf, %-11s %-11s %-11s %-11s %-11s %-11s %-11s
 %-12s,

 +   if (asprintf(buf, %-25s %-11s %-11s %-11s %-11s %-11s %-11s
 %-12s,

  Name, Status, State, Type, Users,
 Microvolts,

  Min u-volts, Max u-volts)  0)

 return -1;


 ​--
 Thanks,
 -Meraj

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] Produce a situation where L1 cache flush missing vs cpu power down hangs the system

2014-04-08 Thread Amit Kucheria
Hi Daniel,

Have you noticed this on any platform yet with this test?

Regards,
Amit


On Tue, Apr 8, 2014 at 4:05 PM, Daniel Lezcano daniel.lezc...@linaro.orgwrote:

 As pointed by Lorenzo, when a cpu powers down, the L1 cache must be flushed
 before, otherwise:

  * data cachelines are not empty and the other cpu may fetch data
  * cpu will lost some data leading to a memory corruption

 Note this bug is very difficult to reproduce and this test will not spot
 the
 issue everytime.

 Signed-off-by: Daniel Lezcano daniel.lezc...@linaro.org
 ---
  cpuidle/cpuidle-l1.c   |   72
 
  cpuidle/cpuidle_05.sh  |   42 
  cpuidle/cpuidle_05.txt |1 +
  3 files changed, 115 insertions(+)
  create mode 100644 cpuidle/cpuidle-l1.c
  create mode 100755 cpuidle/cpuidle_05.sh
  create mode 100644 cpuidle/cpuidle_05.txt

 diff --git a/cpuidle/cpuidle-l1.c b/cpuidle/cpuidle-l1.c
 new file mode 100644
 index 000..bbcde28
 --- /dev/null
 +++ b/cpuidle/cpuidle-l1.c
 @@ -0,0 +1,72 @@
 +#include stdio.h
 +#include stdlib.h
 +#include sys/types.h
 +#include sys/wait.h
 +#include unistd.h
 +#include pthread.h
 +#define BUFSIZE (4*1024)
 +#define DEADBEEF 0xDEADBEEF
 +static int buffer[BUFSIZE];
 +
 +static pthread_t threads[64];
 +
 +void *thread_routine(void *arg)
 +{
 +   int i, display = *(int *)arg;
 +   int dummy;
 +
 +   for (i = 0; i  100; i++) {
 +
 +   int j;
 +
 +   for (j = 0; j  BUFSIZE * 1000; j++) {
 +   dummy = buffer[j % BUFSIZE];
 +   dummy++;
 +   }
 +
 +   usleep(20);
 +
 +   if (buffer[i] != DEADBEEF) {
 +   fprintf(stderr, memory corruption\n);
 +   return (void *)-1;
 +   }
 +
 +   if (display == 0)
 +   printf(%d%%%s, i, i  10 ? \b\b : \b\b\b);
 +   }
 +
 +   if (display == 0)
 +   printf(\b\b\b\b);
 +
 +   return NULL;
 +}
 +
 +int main(int argc, char *argv[])
 +{
 +   int i, ret = 0;
 +   int nrcpus = sysconf(_SC_NPROCESSORS_ONLN);
 +
 +   for (i = 0; i  BUFSIZE; i++)
 +   buffer[i] = DEADBEEF;
 +
 +   setbuf(stdout, NULL);
 +
 +   for(i = 0; i  nrcpus; i++) {
 +
 +   if (pthread_create(threads[i], NULL, thread_routine, i))
 {
 +   perror(pthread_create);
 +   return 1;
 +   }
 +
 +   }
 +
 +   for (i = 0; i  nrcpus; i++) {
 +   void *result;
 +   pthread_join(threads[i], result);
 +
 +   if (result == (void *)-1)
 +   ret = 1;
 +   }
 +
 +   return ret;
 +}
 diff --git a/cpuidle/cpuidle_05.sh b/cpuidle/cpuidle_05.sh
 new file mode 100755
 index 000..679439d
 --- /dev/null
 +++ b/cpuidle/cpuidle_05.sh
 @@ -0,0 +1,42 @@
 +#!/bin/bash
 +#
 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2011, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  02110-1301, USA.
 +#
 +# Contributors:
 +# Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
 +#   - initial API and implementation
 +#
 +
 +# URL :
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/PmQaSpecification#cpuidle_05
 +
 +source ../include/functions.sh
 +
 +CPUIDLE_L1=./cpuidle-l1
 +
 +if [ $(id -u) -ne 0 ]; then
 +log_skip run as non-root
 +exit 0
 +fi
 +
 +check_cpuidle_l1() {
 +check Fill L1 cache and sleep ./$CPUIDLE_L1
 +}
 +
 +check_cpuidle_l1
 +test_status_show
 diff --git a/cpuidle/cpuidle_05.txt b/cpuidle/cpuidle_05.txt
 new file mode 100644
 index 000..1f80e36
 --- /dev/null
 +++ b/cpuidle/cpuidle_05.txt
 @@ -0,0 +1 @@
 +Run cpuidle L1 test program to catch L1 flush missing vs cpu power down
 --
 1.7.9.5


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [tool recommendation] tmate terminal sharing

2013-10-17 Thread Amit Kucheria
On Thu, Oct 17, 2013 at 6:39 AM, Christoffer Dall
christoffer.d...@linaro.org wrote:
 Hi all,

 [apologies in advance for the spam nature of this message]

 I have been using a tool for remote collaboration and problem solving
 that I find perfect in the context of remote collaboration.  It allows
 you to very easily share a terminal session even behind most firewalls
 etc.

 If you're interested, take a look at http://tmate.io/

 It's based on tmux keymappings and configuration so if you already use
 that, you will be extra happy.


This looks quite useful. Thanks for sharing.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Beaglebone Black Core temperature

2013-10-01 Thread Amit Kucheria
On Tue, Oct 1, 2013 at 7:53 PM, Dave Pigott dave.pig...@linaro.org wrote:

 On 1 Oct 2013, at 14:50, Sanjay Singh Rawat sanjay.ra...@linaro.org wrote:

 On Tuesday 01 October 2013 06:45 PM, Gaurang Shastri wrote:
 Hi,

 Do you mean to say something like lm-sensor kind of utility?? May be
 from this package you will get to know what you want :-)

 //Gaurang Shastri


 On Tue, Oct 1, 2013 at 5:32 PM, Dave Pigott dave.pig...@linaro.org
 mailto:dave.pig...@linaro.org wrote:

Hi all,

Does anyone know how we can get the current temperature of the CPU
on a beaglebone black?

 default path for such hardware is at /sys/class/hwmon/hwmon* (mostly it will 
 be associated with CPU only). You can trying cat temp*_input file at this 
 path

 Already tried looking in there, and various other potential places, but don't 
 seem to have anything.


Hmm, the am335x SoC in the beaglebone seems to have a bandgap sensor
to measure case temperature[1]. Is the bandgap driver enabled in the
kernel? Adding Eduardo (maintainer) to shed some light on whether the
bandgap driver in mainline already has am335x support.

/Amit

[1] 
http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Tiny BL switcher compatibility issue with PMU on non-BL SoC

2013-05-30 Thread Amit Kucheria
On Thu, May 30, 2013 at 7:36 AM, Andy Green andy.gr...@linaro.org wrote:
 Hi -

 We're using one kernel binary with BL Switcher enabled in config, but able
 to work on SoC without Big Little.

 This is OK except where the BL patches touch the PMU driver.  It makes an
 assumption about BL configured == in use which is not true.  PMU init fails
 and when you try to use perf list later, it blows chunks.

 I worked around it with the hack below, so it can fail out from the
 bigLITTLE path when it doesn't see the cluster property in DT, but there's
 presumably a better way to do that which more directly checks if we care
 about BL in this execution environment.

 -Andy


This is Dave's area but Nico ought to weigh in whether the presence of
the DT property is the best place for this. It seems OK to me.



 Author: Andy Green andy.gr...@linaro.org
 Date:   Thu May 30 09:44:17 2013 +0800

 bl switcher fix dont assume bl active in pmu probe

 Signed-off-by: Andy Green andy.gr...@linaro.org

 diff --git a/arch/arm/kernel/perf_event_cpu.c
 b/arch/arm/kernel/perf_event_cpu.c
 index b3ae24f..c02ea21 100644
 --- a/arch/arm/kernel/perf_event_cpu.c
 +++ b/arch/arm/kernel/perf_event_cpu.c
 @@ -440,6 +440,9 @@ static int cpu_pmu_device_probe(struct platform_device
 *pdev)
 hwid = of_get_property(ncluster, reg, len);
 if (hwid  len == 4)
 cluster = be32_to_cpup(hwid);
 +   } else {
 +   ret = probe_current_pmu(pmu);
 +   goto bail;
 }
 /* set sibling mask to all cpu mask if socket is not
 specified */
 /*
 @@ -501,7 +504,7 @@ static int cpu_pmu_device_probe(struct platform_device
 *pdev)
 } else {
 ret = probe_current_pmu(pmu);
 }
 -
 +bail:
 if (ret)
 goto error;



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [RELEASE] big-LITTLE-MP-upstream-v3

2013-05-20 Thread Amit Kucheria
Viresh,

Thanks!

Do you also have a tree based on linux-linaro where the reference MP
patches are removed and this branch applied so Naresh and Vincent can
continue their benchmarking experiments? Or will we wait until Andrey
has finalised the linux-linaro tree before you create this?

Regards,
Amit


On Mon, May 20, 2013 at 3:30 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 Hi Guys,

 V3 [1] of latest upstream effort for big LITTLE Architecture is ready for
 release. It is based of 3.10-rc1.

 Updates:
 ---
 - Stats: Total distinct patches: 28
 - New branch: master-wq-migration-v5 (Queued for 3.11)
 - New versions of branches: upstream-config-fragments
   upstream-runnable-load-avg-in-load-balance-v5
   upstream-sched-pack-small-tasks-v4-fixed-v3.10-rc1
   upstream-sched-use-LB_MIN-feature-v2-v3.10-rc1
   upstream-task-placement-on-mixed-cpu-power-systems-v1


 @Andrey: You don't need to pull this one :)

 --
 viresh

 [1]: 
 https://git.linaro.org/gitweb?p=arm/big.LITTLE/mp.git;a=shortlog;h=refs/heads/big-LITTLE-MP-upstream-v3

 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Deadline scheduler inclusion in linux-linaro?

2013-05-20 Thread Amit Kucheria
Ola,

Are you concerned with lower system-wide scheduling latency or with
predictable response times for a particular task?

I believe SCHED_DEADLINE with help with the later.

/Amit

On Mon, May 20, 2013 at 1:10 PM, Ola Liljedahl ola.liljed...@arm.com wrote:
 In my experience, networking is moving away from realtime  scheduling (and
 thus RTOS’es). There are some lingering requirements for some of the
 processing in the wireless stack but the main difficulty here is getting the
 scheduling latency down to acceptable levels, e.g. five microseconds or so.
 Will SCHED_DEADLINE help here?



 -- Ola



 Ola Liljedahl, Networking System Architect, ARM

 Telephone: +46 706 866 373Skype: ola.liljedahl



 From: Amit Kucheria [mailto:amit.kuche...@linaro.org]
 Sent: 19 May 2013 11:51
 To: Mark Orvek
 Cc: Patrick MacCartee; Mike Holmes; linaro-networking; Lists linaro-dev;
 j.le...@sssup.it; linaro-enterpr...@linaro.org; lng...@linaro.org
 Subject: Re: Deadline scheduler inclusion in linux-linaro?



 Similarly, the SCHED_DEADLINE patches shouldn't affect default runtime
 scheduler behaviour unless a task uses the DEADLINE policy.



 However, I haven't studied the intersection of the Preempt RT and
 SCHED_DEADLINE patches in source form yet. If they touch common pieces of
 code, merging both in might be an ongoing effort. Juri, do you know?



 On Fri, May 17, 2013 at 8:11 PM, Mark Orvek mark.or...@linaro.org wrote:

 The PREEMPT_RT patchset is configurable.  I believe the default is
 PREEMPT_DESKTOP which is what most MV CGE customers use.  Another config
 options is PREEMPT_NONE but I believe its usage is rare.



 Mark



 On Fri, May 17, 2013 at 7:25 AM, Patrick MacCartee pmaccar...@mvista.com
 wrote:

 Will these be added in a way that makes them easy to remove? Many, 95%
 don't use Preempt RT in Linux as it impacts network performance and makes
 things very temperamental.  You would think people would just disable this
 RT, but when trying to isolate issues it adds another variable to the mix. I
 believe Yocto has a way of adding and removing RT patches that is some what
 straight forward and preferable based on feedback from OEM's.



 Just a thought,

 Patrick



 On Fri, May 17, 2013 at 6:34 AM, Mike Holmes mike.hol...@linaro.org wrote:

 In LNG you could end up with an interesting mix of preempt RT and deadline
 patches making the analysis and benchmarking interesting to interpret.
 In addition there are discussions about adding zero overhead linux (ZOL)
 like features.

 Mike




 On Friday, May 17, 2013 6:08:20 AM UTC-4, David Rusling wrote:

 Amit,
 an interesting proposal.  I think that most of the LNG steering
 committee is on this alias, but just in case, I'm adding them to it...
 Dave

 Amit Kucheria

 17 May 2013 10:15

 Hi all,

 As part of our investigations into the Linux scheduler we've
 interacted with Juri Lelli at the University of Pisa (cc'ed) who is
 part of a group that is working on a DEADLINE scheduler[1] for
 Linux[2].

 While we're coming at this from a power managment angle[3], I suspect
 that LEG and LNG already have real-world usecases that would benefit
 from deadline scheduler found in other RTOSes.

 So I think it makes sense to merge Juri's tree into linux-linaro going
 forward to allow easier experimentation. Does LEG and LNG have any
 interest in this at this point?

 Juri has expressed an interest in maintaining a current branch of the
 code that could be merged into our monthly release. In return, real
 world usecases will improve his chances of getting the code merged
 into mainline.

 Regards,
 Amit

 [1] http://retis.sssup.it/?q=node/35
 [2] https://lkml.org/lkml/2013/2/11/373
 [3] Mostly involving discussions at this point, no real engineering
 effort invested yet

 ___
 linaro-dev mailing list

 linar...@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev



 --
 David Rusling
 CTO
 Linaro Ltd

 e.  david@linaro.org


 w.  http://www.linaro.org
 Linaro: The future of Linux on ARM





 --
 Patrick J. MacCartee
 Director of Product Management
 MontaVista Software LLC
 fone: 408-572-7937
 mobile: 415-637-0257
 pmaccar...@mvista.com





 --

 Mark Orvek



 mark.or...@linaro.org



 VP, Engineering



 M: +1.408.313.6988 IRC: morvek Skype: morvek

 linaro.org │ Open source software for ARM SoCs






 -- IMPORTANT NOTICE: The contents of this email and any attachments are
 confidential and may also be privileged. If you are not the intended
 recipient, please notify the sender immediately and do not disclose the
 contents to any other person, use it for any purpose, or store or copy the
 information in any medium. Thank you.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [RELEASE] big-LITTLE-MP-upstream-v3

2013-05-20 Thread Amit Kucheria
On Mon, May 20, 2013 at 3:45 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 On 20 May 2013 15:42, Amit Kucheria amit.kuche...@linaro.org wrote:
 Do you also have a tree based on linux-linaro where the reference MP
 patches are removed and this branch applied so Naresh and Vincent can
 continue their benchmarking experiments? Or will we wait until Andrey
 has finalised the linux-linaro tree before you create this?

 I haven't created it yet. Probably better to wait for release?

OK

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Deadline scheduler inclusion in linux-linaro?

2013-05-20 Thread Amit Kucheria
On Mon, May 20, 2013 at 5:48 PM, Juri Lelli juri.le...@gmail.com wrote:
 On 05/20/2013 12:27 PM, Ola Liljedahl wrote:

 Predictable response times for specific threads. In the use cases I
 am aware of, these threads would probably belong to the same process
 and run core-affine on a specific core where as few as possible other
 (kernel and user) threads and interrupts etc would also run. A number
 of cores would follow this real-time model while other cores
 preferably would keep the original Linux scheduling and
 characteristics (to avoid introducing unexpected behaviour).

 What benefits does SCHED_DEADLINE give in addition to stuff in
 PREEMPT_RT?


 Predictable response times are what SCHED_DEADLINE is about.

 With SCHED_DEADLINE you can provide temporal guarantees up to 100% CPU
 utilization that are not possibile with default real-time policies
 (e.g. SCHED_FIFO/RR). This comes from the fact that SCHED_DEADLINE
 achieves strong temporal isolation between tasks. You can reserve a
 fraction of CPU time to your activities and be assured that no one else
 can interfere with them. And this is critical also in a low loaded
 system, if you want to be really safe against unexpected interferences.

 Basically, with SCHED_DEADLINE you can make a feasibility study (no
 deadline will be missed) of the system under development beforehand,
 and be sure, at run-time, that the timing requirements will be met
 under any circumstance. You can't do the same using only stuff already
 in PREEMPT_RT.

 Best,

 - Juri

Over and above what Juri explained, you probably want to keep an eye
on the Adaptive Tickless work[1]. It allows cpu isolation so that only
the designated task will run on the 'tickless' cores - no scheduling,
no interrupts or timers. PMWG has been tracking for its cpu isolation
properties and Kevin Hilman landed 32-bit ARM support for the
underlying context tracking in 3.10 [2].

Regards,
Amit

[1] https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/AdaptiveTickless
[2] 64-bit support still WIP

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Deadline scheduler inclusion in linux-linaro?

2013-05-20 Thread Amit Kucheria
Please refer to my earlier comment about Adaptive Tickless. I think
you'll find it useful for the usecase you outlined below.

On Mon, May 20, 2013 at 6:07 PM, Ola Liljedahl ola.liljed...@arm.com wrote:
 Interesting. But SCHED_DEADLINE doesn't depend on the PREEMPT_RT 
 modifications? Are these solutions overlapping in some areas?

 For the relevant use cases, I don't know if strict CPU allocation (a fraction 
 of the total CPU cycles)  is needed. Instead these apps (we are talking 
 legacy SW) are designed so that specific threads must start to execute very 
 quickly (within 5-10 microseconds with an almost 100% guarantee, this is also 
 a bound of the overhead of the wakeup and scheduling operations) when some 
 event occurs (timer or possibly some other type of interrupt). The biggest 
 problem to this today in Linux is the kernel itself (e.g. interrupt 
 disabling, locks). How does SCHED_DEADLINE handle this?

 -- Ola

 Ola Liljedahl, Networking System Architect, ARM
 Telephone: +46 706 866 373Skype: ola.liljedahl


 -Original Message-
 From: Juri Lelli [mailto:juri.le...@gmail.com]
 Sent: 20 May 2013 14:19
 To: Ola Liljedahl
 Cc: Amit Kucheria; Mark Orvek; Patrick MacCartee; Mike Holmes; 
 linaro-networking; Lists linaro-dev; linaro-enterpr...@linaro.org
 Subject: Re: Deadline scheduler inclusion in linux-linaro?

 On 05/20/2013 12:27 PM, Ola Liljedahl wrote:
 Predictable response times for specific threads. In the use cases I
 am aware of, these threads would probably belong to the same process
 and run core-affine on a specific core where as few as possible other
 (kernel and user) threads and interrupts etc would also run. A number
 of cores would follow this real-time model while other cores
 preferably would keep the original Linux scheduling and
 characteristics (to avoid introducing unexpected behaviour).

 What benefits does SCHED_DEADLINE give in addition to stuff in
 PREEMPT_RT?


 Predictable response times are what SCHED_DEADLINE is about.

 With SCHED_DEADLINE you can provide temporal guarantees up to 100% CPU
 utilization that are not possibile with default real-time policies
 (e.g. SCHED_FIFO/RR). This comes from the fact that SCHED_DEADLINE
 achieves strong temporal isolation between tasks. You can reserve a
 fraction of CPU time to your activities and be assured that no one else
 can interfere with them. And this is critical also in a low loaded
 system, if you want to be really safe against unexpected interferences.

 Basically, with SCHED_DEADLINE you can make a feasibility study (no
 deadline will be missed) of the system under development beforehand,
 and be sure, at run-time, that the timing requirements will be met
 under any circumstance. You can't do the same using only stuff already
 in PREEMPT_RT.

 Best,

 - Juri

 -- Ola

 Ola Liljedahl, Networking System Architect, ARM Telephone: +46 706
 866 373Skype: ola.liljedahl

 -Original Message- From: Amit Kucheria
 [mailto:amit.kuche...@linaro.org] Sent: 20 May 2013 12:16 To: Ola
 Liljedahl Cc: Mark Orvek; Patrick MacCartee; Mike Holmes;
 linaro-networking; Lists linaro-dev; j.le...@sssup.it;
 linaro-enterpr...@linaro.org; lng...@linaro.org Subject: Re: Deadline
 scheduler inclusion in linux-linaro?

 Ola,

 Are you concerned with lower system-wide scheduling latency or with
 predictable response times for a particular task?

 I believe SCHED_DEADLINE with help with the later.

 /Amit

 On Mon, May 20, 2013 at 1:10 PM, Ola Liljedahl
 ola.liljed...@arm.com wrote:
 In my experience, networking is moving away from realtime
 scheduling (and thus RTOS’es). There are some lingering
 requirements for some of the processing in the wireless stack but
 the main difficulty here is getting the scheduling latency down to
 acceptable levels, e.g. five microseconds or so. Will
 SCHED_DEADLINE help here?



 -- Ola



 Ola Liljedahl, Networking System Architect, ARM

 Telephone: +46 706 866 373Skype: ola.liljedahl



 From: Amit Kucheria [mailto:amit.kuche...@linaro.org] Sent: 19 May
 2013 11:51 To: Mark Orvek Cc: Patrick MacCartee; Mike Holmes;
 linaro-networking; Lists linaro-dev; j.le...@sssup.it;
 linaro-enterpr...@linaro.org; lng...@linaro.org Subject: Re:
 Deadline scheduler inclusion in linux-linaro?



 Similarly, the SCHED_DEADLINE patches shouldn't affect default
 runtime scheduler behaviour unless a task uses the DEADLINE
 policy.



 However, I haven't studied the intersection of the Preempt RT and
 SCHED_DEADLINE patches in source form yet. If they touch common
 pieces of code, merging both in might be an ongoing effort. Juri,
 do you know?



 On Fri, May 17, 2013 at 8:11 PM, Mark Orvek mark.or...@linaro.org
 wrote:

 The PREEMPT_RT patchset is configurable.  I believe the default is
 PREEMPT_DESKTOP which is what most MV CGE customers use.  Another
 config options is PREEMPT_NONE but I believe its usage is rare.



 Mark



 On Fri, May 17, 2013 at 7:25 AM, Patrick MacCartee
 pmaccar...@mvista.com

Re: [RFC PATCH 0/6] ARM: cpuhotplug: move generic functions to core

2013-05-19 Thread Amit Kucheria
Sanjay,

This deserves to be posted to LAKML and even LKML I think.

/Amit

On Sun, May 19, 2013 at 12:38 AM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 Various SoCs with arm processors define their own platform hotplug related
 functions. These functions can be defined as part of the core cpu hotplug
 functions, this will avoid the duplication. This patchset is intended to
 address this issue.

 This patchset covers arm-Cortex-A9. Not having h/w, the patch is not tested.

 Sanjay Singh Rawat (6):
   ARM: cpuhotplug: add common hotplug related functions
   ARM: imx: use the core cpu hotplug functions
   ARM: RealView: use the core cpu hotplug functions
   ARM: spear: use the core cpu hotplug functions
   ARM: vexpress: use the core cpu hotplug functions
   ARM: EXYNOS: use the core cpu hotplug functions

  arch/arm/include/asm/hotplug.h   |   19 +++
  arch/arm/kernel/Makefile |1 +
  arch/arm/kernel/cpuhotplug.c |   64 
 ++
  arch/arm/mach-exynos/hotplug.c   |   40 ++--
  arch/arm/mach-imx/hotplug.c  |   22 +
  arch/arm/mach-realview/hotplug.c |   37 +-
  arch/arm/mach-spear/hotplug.c|   37 +-
  arch/arm/mach-vexpress/hotplug.c |   38 +-
  8 files changed, 90 insertions(+), 168 deletions(-)
  create mode 100644 arch/arm/include/asm/hotplug.h
  create mode 100644 arch/arm/kernel/cpuhotplug.c

 --
 1.7.9.5


 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Deadline scheduler inclusion in linux-linaro?

2013-05-19 Thread Amit Kucheria
Similarly, the SCHED_DEADLINE patches shouldn't affect default runtime
scheduler behaviour unless a task uses the DEADLINE policy.

However, I haven't studied the intersection of the Preempt RT and
SCHED_DEADLINE patches in source form yet. If they touch common pieces of
code, merging both in might be an ongoing effort. Juri, do you know?


On Fri, May 17, 2013 at 8:11 PM, Mark Orvek mark.or...@linaro.org wrote:

 The PREEMPT_RT patchset is configurable.  I believe the default is
 PREEMPT_DESKTOP which is what most MV CGE customers use.  Another config
 options is PREEMPT_NONE but I believe its usage is rare.

 Mark


 On Fri, May 17, 2013 at 7:25 AM, Patrick MacCartee 
 pmaccar...@mvista.comwrote:

 Will these be added in a way that makes them easy to remove? Many, 95%
 don't use Preempt RT in Linux as it impacts network performance and makes
 things very temperamental.  You would think people would just disable this
 RT, but when trying to isolate issues it adds another variable to the mix.
 I believe Yocto has a way of adding and removing RT patches that is some
 what straight forward and preferable based on feedback from OEM's.

 Just a thought,
 Patrick


 On Fri, May 17, 2013 at 6:34 AM, Mike Holmes mike.hol...@linaro.orgwrote:

 In LNG you could end up with an interesting mix of preempt RT and
 deadline patches making the analysis and benchmarking interesting to
 interpret.
 In addition there are discussions about adding zero overhead linux (ZOL)
 like features.

 Mike



 On Friday, May 17, 2013 6:08:20 AM UTC-4, David Rusling wrote:

 Amit,
 an interesting proposal.  I think that most of the LNG steering
 committee is on this alias, but just in case, I'm adding them to it...
 Dave

   Amit Kucheria
  17 May 2013 10:15
 Hi all,

 As part of our investigations into the Linux scheduler we've
 interacted with Juri Lelli at the University of Pisa (cc'ed) who is
 part of a group that is working on a DEADLINE scheduler[1] for
 Linux[2].

 While we're coming at this from a power managment angle[3], I suspect
 that LEG and LNG already have real-world usecases that would benefit
 from deadline scheduler found in other RTOSes.

 So I think it makes sense to merge Juri's tree into linux-linaro going
 forward to allow easier experimentation. Does LEG and LNG have any
 interest in this at this point?

 Juri has expressed an interest in maintaining a current branch of the
 code that could be merged into our monthly release. In return, real
 world usecases will improve his chances of getting the code merged
 into mainline.

 Regards,
 Amit

 [1] http://retis.sssup.it/?q=node/**35http://retis.sssup.it/?q=node/35
 [2] 
 https://lkml.org/lkml/2013/2/**11/373https://lkml.org/lkml/2013/2/11/373
 [3] Mostly involving discussions at this point, no real engineering
 effort invested yet

 __**_
 linaro-dev mailing list
 linar...@lists.linaro.org
 http://lists.linaro.org/**mailman/listinfo/linaro-devhttp://lists.linaro.org/mailman/listinfo/linaro-dev


 --
 David Rusling
 CTO
 Linaro Ltd
 e.  david@linaro.org

 w.  http://www.linaro.org
 Linaro: The future of Linux on ARM




 --
 Patrick J. MacCartee
 Director of Product Management
 MontaVista Software LLC
 fone: 408-572-7937
 mobile: 415-637-0257
 pmaccar...@mvista.com




 --
 Mark Orvek

 mark.or...@linaro.org

 VP, Engineering

 *M*: +1.408.313.6988 *IRC:* morvek *Skype:* morvek
 linaro.org │ Open source software for ARM SoCs



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Deadline scheduler inclusion in linux-linaro?

2013-05-17 Thread Amit Kucheria
Hi all,

As part of our investigations into the Linux scheduler we've
interacted with Juri Lelli at the University of Pisa (cc'ed) who is
part of a group that is working on a DEADLINE scheduler[1] for
Linux[2].

While we're coming at this from a power managment angle[3], I suspect
that LEG and LNG already have real-world usecases that would benefit
from deadline scheduler found in other RTOSes.

So I think it makes sense to merge Juri's tree into linux-linaro going
forward to allow easier experimentation. Does LEG and LNG have any
interest in this at this point?

Juri has expressed an interest in maintaining a current branch of the
code that could be merged into our monthly release. In return, real
world usecases will improve his chances of getting the code merged
into mainline.

Regards,
Amit

[1] http://retis.sssup.it/?q=node/35
[2] https://lkml.org/lkml/2013/2/11/373
[3] Mostly involving discussions at this point, no real engineering
effort invested yet

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH powerdebug] clock: show only active clocks

2013-05-06 Thread Amit Kucheria
Sebastian,

Could you help Sanjay with verification of this feature?

Regards,
Amit


On Sun, May 5, 2013 at 1:57 AM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 - use the clk_summary file of CCF for showing clocks
 - add option to show active or all clocks

 Signed-off-by: Sanjay Singh Rawat sanjay.ra...@linaro.org
 ---
  clocks.c  |   62 
 +
  display.c |3 +++
  display.h |1 +
  3 files changed, 54 insertions(+), 12 deletions(-)

 diff --git a/clocks.c b/clocks.c
 index 95acf57..a0510b4 100644
 --- a/clocks.c
 +++ b/clocks.c
 @@ -287,9 +287,8 @@ static int clock_print_header(void)
 int ret;

 if(clock_fw == CCF) {
 -   if (asprintf(buf, %-35s %-10s %-12s %-10s %-11s %-15s %-14s 
 %-14s,
 -Name, Flags, Rate, Usecount, Children, 
 Prepare_Count,
 -Enable_Count, Notifier_Count)  0)
 +   if (asprintf(buf, %-30s %-10s %-12s %-10s (clock toggle 
 key-'c'),
 +Name, Enable_Count, Prepare_Count, Rate)  0)
 return -1;
 }
 else {
 @@ -297,23 +296,57 @@ static int clock_print_header(void)
  Name, Flags, Rate, Usecount, Children)  0)
 return -1;
 }
 -
 ret = display_column_name(buf);
 -
 free(buf);

 return ret;
  }

 +/*
 + * Display clocks by refering the clk_summary file of CCF
 + */
 +static int display_clk_summary()
 +{
 +FILE *fp;
 +char line[256];
 +int afterheader;
 +char clock[30];
 +int enable_cnt,prepare_cnt,rate;
 +
 +afterheader = 0;
 +fp = fopen(/sys/kernel/debug/clk/clk_summary,r);
 +if (fp == NULL) {
 +printf(error: failed to open clock tree file\n);
 +return -1;
 +}
 +
 +while (NULL != fgets(line,256,fp)) {
 +if (afterheader  1) {
 +sscanf(line,%s %d %d 
 %d,clock,enable_cnt,prepare_cnt,rate);
 +if (active_clks) {
 +   if (enable_cnt)
 +   display_print_line(CLOCK,afterheader,
 +   line,0,clock_tree);
 +   }
 +   else
 +   
 display_print_line(CLOCK,afterheader,line,1,clock_tree);
 +}
 +afterheader++;
 +}
 +   return 0;
 +}
 +
  static int clock_print_info(struct tree *tree)
  {
 int ret, line = 0;

 display_reset_cursor(CLOCK);
 -
 clock_print_header();

 -   ret = tree_for_each(tree, clock_print_info_cb, line);
 +   if (clock_fw == CCF)
 +   ret = display_clk_summary();
 +   else
 +   ret = tree_for_each(tree, clock_print_info_cb, line);

 display_refresh_pad(CLOCK);

 @@ -426,8 +459,10 @@ int clock_init(void)

 sprintf(clk_dir_path[CCF], %s/clk, clk_dir_path[CCF]);
 sprintf(clk_dir_path[OCF], %s/clock, clk_dir_path[OCF]);
 +
 if (!access(clk_dir_path[CCF], F_OK)) {
 clock_fw = CCF;
 +   active_clks = true;
 strcpy(clk_dir_path[MAX],clk_dir_path[CCF]);
 }
 else if(!access(clk_dir_path[OCF], F_OK)) {
 @@ -437,12 +472,15 @@ int clock_init(void)
 else
 return -1;

 -   clock_tree = tree_load(clk_dir_path[MAX], NULL, false);
 -   if (!clock_tree)
 -   return -1;
 +   /* Not preparing tree for CCF, will use the clk_summary file */
 +   if(clock_fw != CCF) {
 +   clock_tree = tree_load(clk_dir_path[MAX], NULL, false);
 +   if (!clock_tree)
 +   return -1;

 -   if (fill_clock_tree())
 -   return -1;
 +   if (fill_clock_tree())
 +   return -1;
 +   }

 return display_register(CLOCK, clock_ops);
  }
 diff --git a/display.c b/display.c
 index e9f4bf6..98544e6 100644
 --- a/display.c
 +++ b/display.c
 @@ -416,6 +416,9 @@ static int display_keystroke(int fd, void *data)
 case 'r':
 case 'R':
 return display_refresh(current_win, true);
 +   case 'c':
 +   active_clks = active_clks ? false : true;
 +   return display_refresh(current_win, true);
 default:
 return 0;
 }
 diff --git a/display.h b/display.h
 index 6362a48..24c9d59 100644
 --- a/display.h
 +++ b/display.h
 @@ -33,4 +33,5 @@ extern int display_init(int wdefault);
  extern int display_register(int win, struct display_ops *ops);
  extern int display_column_name(const char *line);

 +bool active_clks;
  #define NAME_MAX 255
 --
 1.7.9.5


 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: panda board suspend/resume broken

2013-04-24 Thread Amit Kucheria
cc'ing linaro-dev

On Tue, Apr 23, 2013 at 5:52 AM, zoran markovic
zoran.marko...@linaro.org wrote:
 Hi,
 Working as a newbie in the PMWG, I noticed I'm not able to resume my
 pandaboard-es with the latest 3.9 kernel from Linus (configuration file
 omap2plus_defconfig). Suspend/resume appears to work with the Linaro 12.11
 release; I managed to wake it up with a USB keyboard. There is also
 launchpad bug 989547 that is still open. Any updates on this issue?

 Thanks,
 Zoran


 ___
 linaro-kernel mailing list
 linaro-ker...@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-kernel


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH pmqa] pm-qa: change the out dir in data partition

2013-04-09 Thread Amit Kucheria
Hi Sanjay,

Both patches look OK. You should mention the bug number in your commit
message to show that it solves an open bug.

Regards,
Amit

On Mon, Apr 8, 2013 at 5:39 PM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 pmqa should be on a RW permission partition. Need to change the path
 in lava pm-qa script too.

 Signed-off-by: Sanjay Singh Rawat sanjay.ra...@linaro.org
 ---
  cpufreq/Android.mk|2 +-
  cpuhotplug/Android.mk |4 ++--
  cpuidle/Android.mk|4 ++--
  include/Android.mk|2 +-
  sched_mc/Android.mk   |2 +-
  suspend/Android.mk|2 +-
  thermal/Android.mk|2 +-
  utils/Android.mk  |2 +-
  8 files changed, 10 insertions(+), 10 deletions(-)

 diff --git a/cpufreq/Android.mk b/cpufreq/Android.mk
 index 2fa747f..2da6056 100644
 --- a/cpufreq/Android.mk
 +++ b/cpufreq/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 diff --git a/cpuhotplug/Android.mk b/cpuhotplug/Android.mk
 index fda35a9..c0e5694 100644
 --- a/cpuhotplug/Android.mk
 +++ b/cpuhotplug/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 @@ -24,7 +24,7 @@ define $(module_name)_etc_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 diff --git a/cpuidle/Android.mk b/cpuidle/Android.mk
 index d85d0c0..2f302d7 100644
 --- a/cpuidle/Android.mk
 +++ b/cpuidle/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 @@ -23,5 +23,5 @@ systemtarball: cpuidle_killer
  LOCAL_SRC_FILES:= cpuidle_killer.c
  LOCAL_STATIC_LIBRARIES := libcutils libc
  LOCAL_MODULE_TAGS := tests
 -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_EXECUTABLE)
 diff --git a/include/Android.mk b/include/Android.mk
 index ec1e704..9560fc1 100644
 --- a/include/Android.mk
 +++ b/include/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_etc_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 diff --git a/sched_mc/Android.mk b/sched_mc/Android.mk
 index f9f9d90..69032e8 100644
 --- a/sched_mc/Android.mk
 +++ b/sched_mc/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)_mc
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)_mc
  include $(BUILD_PREBUILT)
  endef

 diff --git a/suspend/Android.mk b/suspend/Android.mk
 index 096e551..d394401 100644
 --- a/suspend/Android.mk
 +++ b/suspend/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 diff --git a/thermal/Android.mk b/thermal/Android.mk
 index 3f0b958..d950a14 100644
 --- a/thermal/Android.mk
 +++ b/thermal/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_add_executable
  LOCAL_MODULE := $1.sh
  systemtarball: $1.sh
  LOCAL_SRC_FILES := $1.sh
 -LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/benchmark/pm-qa/$(module_name)
  include $(BUILD_PREBUILT)
  endef

 diff --git a/utils/Android.mk b/utils/Android.mk
 index 272a70c..b49fa45 100644
 --- a/utils/Android.mk
 +++ b/utils/Android.mk
 @@ -10,7 +10,7 @@ define $(module_name)_etc_add_executable

Re: [PATCH pmqa] pm-qa: add test for cpu topology attributes

2013-03-25 Thread Amit Kucheria
On Mon, Mar 25, 2013 at 5:37 PM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 From: Daniel Lezcano daniel.lezc...@linaro.org

 test checks for topology attributes of cpus

 Signed-off-by: Sanjay Singh Rawat sanjay.ra...@linaro.org

Ack modulo one comment below.

 ---
  cputopology/Android.mk |   18 ++
  cputopology/Makefile   |   25 +
  cputopology/cputopology_01.sh  |   38 ++
  cputopology/cputopology_01.txt |1 +
  cputopology/cputopology_02.sh  |   33 +
  cputopology/cputopology_02.txt |1 +
  6 files changed, 116 insertions(+)
  create mode 100644 cputopology/Android.mk
  create mode 100644 cputopology/Makefile
  create mode 100755 cputopology/cputopology_01.sh
  create mode 100644 cputopology/cputopology_01.txt
  create mode 100755 cputopology/cputopology_02.sh
  create mode 100644 cputopology/cputopology_02.txt

 diff --git a/cputopology/Android.mk b/cputopology/Android.mk
 new file mode 100644
 index 000..7f2c1ef
 --- /dev/null
 +++ b/cputopology/Android.mk
 @@ -0,0 +1,18 @@
 +include $(call all-subdir-makefiles)
 +LOCAL_PATH:= $(call my-dir)
 +
 +module_name = cputopology
 +
 +define $(module_name)_add_executable
 +include $(CLEAR_VARS)
 +LOCAL_MODULE_TAGS := optional
 +LOCAL_MODULE_CLASS := tests
 +LOCAL_MODULE := $1.sh
 +systemtarball: $1.sh
 +LOCAL_SRC_FILES := $1.sh
 +LOCAL_MODULE_PATH := 
 $(TARGET_OUT_OPTIONAL_EXECUTABLES)/pm-qa/$(module_name)
 +include $(BUILD_PREBUILT)
 +endef
 +
 +test_num := 01 02
 +$(foreach item,$(test_num),$(eval $(call $(module_name)_add_executable, 
 $(module_name)_$(item
 diff --git a/cputopology/Makefile b/cputopology/Makefile
 new file mode 100644
 index 000..a90620c
 --- /dev/null
 +++ b/cputopology/Makefile
 @@ -0,0 +1,25 @@
 +#
 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2011, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 +#
 +# Contributors:
 +# Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
 +#   - initial API and implementation
 +#
 +
 +include ../Test.mk
 \ No newline at end of file
 diff --git a/cputopology/cputopology_01.sh b/cputopology/cputopology_01.sh
 new file mode 100755
 index 000..c7cbc26
 --- /dev/null
 +++ b/cputopology/cputopology_01.sh
 @@ -0,0 +1,38 @@
 +#!/bin/bash
 +#
 +# PM-QA validation test suite for the power management on Linux
 +#
 +# Copyright (C) 2011, Linaro Limited.
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License
 +# as published by the Free Software Foundation; either version 2
 +# of the License, or (at your option) any later version.
 +#
 +# This program is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details.
 +#
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 USA.
 +#
 +# Contributors:
 +# Daniel Lezcano daniel.lezc...@linaro.org (IBM Corporation)
 +#   - initial API and implementation
 +#
 +
 +# URL : 
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#sched_mc_02

The wiki page needs to be updated to change all instances of sched_mc

 +
 +source ../include/functions.sh
 +
 +check_physical_package_id() {
 +
 +local package_id=$CPU_PATH/$1/topology/physical_package_id
 +local val=$(cat $package_id)
 +
 +check topology is enabled test \$val\ != \-1\
 +}
 +
 +for_each_cpu check_physical_package_id || exit 1
 diff --git a/cputopology/cputopology_01.txt b/cputopology/cputopology_01.txt
 new file mode 100644
 index 000..5493610
 --- /dev/null
 +++ b/cputopology/cputopology_01.txt
 @@ -0,0 +1 @@
 +test the topology is implemented in the kernel
 diff --git a/cputopology/cputopology_02.sh b/cputopology/cputopology_02.sh
 new file mode 100755
 index 000..6520ce5
 --- /dev/null
 +++ b/cputopology/cputopology_02.sh
 @@ -0,0 +1,33 

Re: LCA13: Video: Scheduler Internals by: Vincent Guittot

2013-03-10 Thread Amit Kucheria
On Sun, Mar 10, 2013 at 8:38 AM, Viresh Kumar viresh.ku...@linaro.org wrote:
 Hi Guys,

 Below are hangout upstreams of Scheduler Internals by Vincent Guittot
 done in LCA13.

 We have got another version of this recording that is done by some
 other cameras, but
 its size was 30 GB and so hard to upstream. In case you need that
 please contact me.

'Hard to upstream' - I like our razor-sharp focus on upstreaming :)

 Day 1: http://www.youtube.com/watch?v=2yzelou80JE
 Day 2: http://www.youtube.com/watch?v=fN11Lltx1nQ

 Thanks to Naresh for arranging for hangouts.


Yes, thanks to Naresh and Viresh for getting this all recorded. And a
big thanks to Vincent was taking the time to walk the team through the
scheduler.

/Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Power Management WG schedule for LCA13

2013-02-28 Thread Amit Kucheria
Hi,

Please find a link[1] to some of the things we plan to discuss and
work on in Hong Kong next week.

If you're interested in some of these topics and are attending in
person, please come and say hello.

See you in Hong Kong!

Regards,
Amit
---
PMWG Tech Lead, Linaro

[1] https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/HK_LCA2013

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Power Management WG schedule for LCA13

2013-02-28 Thread Amit Kucheria
On Thu, Feb 28, 2013 at 4:56 PM, Amit Kucheria amit.kuche...@linaro.org wrote:
 Hi,

 Please find a link[1] to some of the things we plan to discuss and
 work on in Hong Kong next week.

 If you're interested in some of these topics and are attending in
 person, please come and say hello.

And in case you aren't able to make it in person, please make sure to
participate remotely[2]. :)

 See you in Hong Kong!

 Regards,
 Amit
 ---
 PMWG Tech Lead, Linaro

 [1] https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/HK_LCA2013

[2] http://www.linaro.org/connect/remote-participation

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: suggestion: move kernel patches off linaro-dev

2013-02-21 Thread Amit Kucheria
On Thu, Feb 21, 2013 at 4:27 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 On 18 February 2013 23:50, Serge Broslavsky serge.broslav...@linaro.org 
 wrote:
 On 18.02.13 12:20 -0500, Nicolas Pitre wrote:
 For the record, I think what Peter is suggesting is reasonable. There
 must be better ways for people to find out what Linaro is participating in
 other than scaring them away from linaro-dev when they have no
 interest in the patch details.

 I second that.

 Any consensus on this? I have already stated mailing to people (who
 send their patches
 to linaro-dev) to use linaro-kernel. :)


I don't have a strong preference one way or another about switching
from linaro-dev to linaro-kernel.

Don't forget to update https://wiki.linaro.org/Resources/HowTo/Git/GitSendEmail

/Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [pmqa,1/1] cpuidle: add function to log cpuidle stats

2013-02-20 Thread Amit Kucheria
On Tue, Feb 19, 2013 at 10:11 AM, Sanjay Singh Rawat
sanjay.ra...@linaro.org wrote:
 Add functionality to record the overall and current runtime cpuidle
 statistics.

I'd like the output to be something list this:

[state1]: [number of times entered]: [average residency]: [std.
deviation(residency)]: [variance]
[state2]: [number of times entered]: [average residency]: [std.
deviation(residency)]: [variance]
.
.
[Total transitions (sum of all states entered)]

This could then be compared with results from previous runs (scripted)
to flag any major changes. Of course, the environment in which this
test is run will have to be rigidly controlled for the results to be
comparable.

I'm not sure if capturing the 'to' and 'from' states is required here.
It should reflect in the number of times a particular state is entered
above.

Is it possible to come up with a single 'idleness' number that tells
us at a glance if idleness has decreased or increased on that SoC due
to changes in the environment (kernel, userspace)? This calculation
would presumably give much higher weight to a C3 compared to a C1. The
weight could even be the power draw of the SoC at that state. That
way, if we suddenly start staying in shallower states, our idleness
number should go down.

Daniel?


 Signed-off-by: Sanjay Singh Rawat sanjay.ra...@linaro.com
 ---
  cpuidle/Readme.txt  |9 +
  cpuidle/cpuidle_03.sh   |9 +
  cpuidle/cpuidle_stats.c |  443 
 +++
  3 files changed, 461 insertions(+)
  create mode 100644 cpuidle/Readme.txt
  create mode 100644 cpuidle/cpuidle_stats.c

 diff --git a/cpuidle/Readme.txt b/cpuidle/Readme.txt
 new file mode 100644
 index 000..9eacae0
 --- /dev/null
 +++ b/cpuidle/Readme.txt
 @@ -0,0 +1,9 @@
 +# cpuidle_stats execution:
 + - can compile and run separately.
 + - can run as part of cpuidle test : sudo make -C cpuidle check
 +
 +# info:
 +- Need sudo permission to run.
 +- saves trace in cpuidle/cpuidle_trace.log.
 +- Gives complete and current sampling time(in/out and timespent) cpuidle
 +state information.
 diff --git a/cpuidle/cpuidle_03.sh b/cpuidle/cpuidle_03.sh
 index 22bca10..029 100755
 --- a/cpuidle/cpuidle_03.sh
 +++ b/cpuidle/cpuidle_03.sh
 @@ -56,5 +56,14 @@ fi

  trap restore_cpus; sigtrap SIGHUP SIGINT SIGTERM

 +check_cpuidle_trace() {
 +   echo ### cpuidle state transition check:
 +   echo ## Collect the overall and current runtime cpuidle stats


What environment does this test run in? We probably want to run this
on a stock ubuntu devel root filesystem and android after allowing it
to idle for 30 seconds or so. It is probably worth discarding several
seconds on data and the beginning and end of the capture too.

It would also be useful to pass a command-line parameter to control
how long to run this measurement.


 +   check cpuidle stats execution ./cpuidle_stats
 +   return 0
 +}
 +
  for_each_cpu check_cpuidle_kill
  restore_cpus
 +
 +check_cpuidle_trace
 diff --git a/cpuidle/cpuidle_stats.c b/cpuidle/cpuidle_stats.c
 new file mode 100644
 index 000..8cc5436
 --- /dev/null
 +++ b/cpuidle/cpuidle_stats.c
 @@ -0,0 +1,443 @@
 +#include stdio.h
 +#include unistd.h
 +#include string.h
 +#include stdlib.h
 +#include sys/types.h
 +#include fcntl.h
 +#include getopt.h
 +#include sched.h
 +#include linux/unistd.h
 +#include signal.h
 +#include time.h
 +
 +#define path ./cpuidle_trace.log
 +
 +unsigned int num_of_cpus;
 +int signal_handled = 0;
 +struct timeval start_time, stop_time;
 +FILE *log_file;
 +struct cpu_idle_stats {
 +   int num_states, exit,active_state;
 +   struct state_stats{
 +   char name[25],desc[25],latency[25];
 +   char power[25],time[25], usage[25];
 +   int in;
 +   double time_spent, entry_time;
 +   } **state;
 +   double exit_time;
 +} **cpuidle_stats;
 +
 +double traceline_time_stamp(char *line)
 +{
 +   char *ptr;
 +   char time_stamp[14];
 +
 +   ptr = strchr(line,'.');
 +   if( ptr == NULL) {
 +   printf(Funtion-%s : error, line format not 
 recognized\n,__func__);
 +   return -1; //todo - proper return value
 +   }
 +   strncpy(time_stamp,(ptr-6),13); //6 digits before and after decimal
 +   time_stamp[14]=0; //set EOS
 +
 +   return atof(time_stamp);
 +}
 +
 +void print_stat()
 +{
 +   int cpu,state;
 +
 +   fprintf(log_file,=== Current cpuidle statistics 
 \n);
 +
 +   for(cpu=0 ; cpu4 ; cpu++) {
 +   fprintf(log_file,cpu-%d : [State][In-Count]  
   [Time Spent]\n,cpu);
 +   for(state=0 ; state5 ; state++) {
 +   fprintf(log_file,\t[states-%d] in-count = %d 
   time-spent = %lf\n,
 +   state, cpuidle_stats[cpu]-state[state]-in,
 +   cpuidle_stats[cpu]-state[state]-time_spent);
 +   

Re: Test Result Summary of Calendar Week 8, 2013 for Linux Linaro ubuntu Quantal.

2013-02-20 Thread Amit Kucheria
On Thu, Feb 21, 2013 at 11:24 AM, Botao Sun botao@linaro.org wrote:
 Calendar Week 8, 2013: Here is test result summary for Linux Linaro ubuntu
 Quantal image on following boards:

 1) ARM Versatile Express A9;
 2) Samsung Arndale;
 3) TI Panda 4430;
 4) TI Panda 4460;
 5) ST Ericsson Snowball.

 Synopsis: Kernel version on TI Panda platform has been upgraded to
 3.8.0-1-linaro-omap, but many issues occurred on TI Panda 4430 and even
 boot failed on TI Panda 4460. Boot loader on STE Snowball has been upgraded
 to U-Boot 2013.01.-rc1.

 1. ARM Versatile Express A9 + Linux Linaro Quantal (Column L):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdFNmV3gyZWRGVS12YUhqeW9rdkVZdmc#gid=1

 It keeps exactly same status from calendar week 50 last year: only Halt 
 Device Tree test failed, all other features work well.

 2. Samsung Arndale + Linux Linaro Quantal (Column F):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AgB-fT5LL31CdGZJSFdTUWFFYVdhZl8wMFpxLXd2TXc#gid=0

 Ethernet backs to work and DS-5 works well too. A kernel panic is occurred
 during the Power Management test, HDMI display is still unavailable. All
 other features work well.

Is there a bug filed to track the problem?

 3. TI Panda 4430 + Linux Linaro Quantal (Column L):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=3

 Kernel has been upgraded from 3.4 to 3.8 but this causes many issues. HDMI,
 DVI-D, Ethernet, WiFi and USB Host failed. Also, there is a kernel panic
 occurred during the power management test. ARM DS-5 test is blocked since
 network is unavailable.

Same.

 4. TI Panda 4460 + Linux Linaro Quantal (Column L):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=4

 Kernel has been upgraded from 3.4 to 3.8 but this causes boot failed on TI
 Panda 4460 board. All rest test is blocked.

 5. ST Ericsson Snowball + Linux Linaro Quantal (Column L):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdFJ4X0NjWjJteVlXLVJFSHFuOHo1c2c#gid=1

 Boot loader has been upgraded to the latest version U-Boot 2013.01.-rc1
 and this upgrade fixed Ethernet and Device Tree. Now we have SD MMC, HDMI
 display, Reboot and Power Management test failed.

Can you provide some information on how pm-qa failed?

/Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [Query]: Can people post to this mailing list without subscription?

2013-02-19 Thread Amit Kucheria
On Wed, Feb 20, 2013 at 10:35 AM, Viresh Kumar viresh.ku...@linaro.org wrote:
 Hi Guys,

 I really don't know whom to direct this mail to and hence the wide spread.

 Problem: When we send a mail to kernel mailing lists with linaro-dev
 or linaro-kernel
 in cc, and we get replies to those mails, sometimes the mails from
 outside people
 doesn't reach us back on linaro mailing lists. And i hope the reason
 behind that is
 those people aren't subscribed to these lists.

Yes that is the reason

 For me it makes some sense to allow anyone to send mails to this list. Can 
 that
 request be considered?

 I believe the idea behind blocking such use is for protecting against
 spam mails, but
 these mails/replies are really important and we certainly need them
 delivered to us.

 One solution (don't know if its possible) would be to monitor mails
 from non-subscribers
 and few people from Linaro can permit them on daily/hourly basis, so
 that we don't get any
 spam mails, but that would be a burden.

Yes, the moderator lets these emails in and whitelists known upstream
developers upon request. Please let Anmar or Philip know any such
email addresses.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: suggestion: move kernel patches off linaro-dev

2013-02-18 Thread Amit Kucheria
Since Peter and I were discussing this on IRC that led to this email,
here is a bit of context on the current behaviour:

On Mon, Feb 18, 2013 at 8:16 PM, Peter Maydell peter.mayd...@linaro.org wrote:
 Hi; does anybody else think it would be a good idea to move all
 the kernel patch email traffic off linaro-dev and onto a more
 kernel-specific mailing list (eg, linaro-kernel, maybe) ?

 A quick eyeball of a few pages of my gmail folder for linaro-dev
 shows that something like 75% of it is kernel devs patchbombing
 the list. You don't see huge floods of patches here for gcc or
 QEMU or any of the many other projects Linaro contributes to,
 so why all the kernel patches?

linaro-dev was supposed to be how we kept track of all development
activity that Linaro was involved in - it wasn't supposed to be
restricted only to kernel. IOW, someone could subscribe to this one
list to find out everything that Linaro was participating in.

So much so that it was baked into our guidelines for how to use git to
send patches to upstream projects[1]

Admittedly, those were early days and our contributions to upstream
projects have grown significantly since then. So it might be time to
revisit that policy.

 I think that moving these off to their own list would allow
 those who have a genuine interest in kernel internals to read
 and review these patches, and reduce the noise level on this
 (Linaro's most generic list) for everybody else.

 NB: I'm not suggesting no kernel discussion here; I just
 would like actual patchmail to go elsewhere...

 thanks
 -- PMM


[1] https://wiki.linaro.org/Resources/HowTo/Git/GitSendEmail

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH 0/4] CPUFreq: Implement per policy instances of governors

2013-02-06 Thread Amit Kucheria
On Wed, Feb 6, 2013 at 3:28 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 On 5 February 2013 21:51, Viresh Kumar viresh.ku...@linaro.org wrote:
 commit 15b5548c9ccfb8088270f7574710d9d67edfe33b
 Author: Viresh Kumar viresh.ku...@linaro.org
 Date:   Tue Feb 5 21:29:05 2013 +0530

 cpufreq: Make governors directory sysfs location based on
 have_multiple_policies

 Until now directory for governors tunables was getting created in
 cpu/cpufreq/gov-name. With the introduction of following patch:
 cpufreq: governor: Implement per policy instances of governors

 this directory would be created in
 cpu/cpunum/cpufreq/gov-name. This might
 break userspace of existing platforms. Lets do this change only
 for platforms
 which need support for multiple policies and thus above mentioned patch.

 From now on, such platforms would be require to do following from
 their init()
 routines:

 policy-have_multiple_policies = true;

 Signed-off-by: Viresh Kumar viresh.ku...@linaro.org
 ---
  drivers/cpufreq/cpufreq_governor.c |  2 +-
  include/linux/cpufreq.h| 14 ++
  2 files changed, 15 insertions(+), 1 deletion(-)

 Hi Rafael,

 Because this patch was quite big (317 insertions(+), 238 deletions(-)), i was
 planning a detailed self review to capture any mistakes and luckily i found
 one for above patch :)

 diff --git a/drivers/cpufreq/cpufreq_governor.c
 b/drivers/cpufreq/cpufreq_governor.c
 index 41ee86f..fe037c0 100644
 --- a/drivers/cpufreq/cpufreq_governor.c
 +++ b/drivers/cpufreq/cpufreq_governor.c
 @@ -342,7 +342,8 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,
 mutex_lock(dbs_data-mutex);
 mutex_destroy(cpu_cdbs-timer_mutex);

 -   sysfs_remove_group(policy-kobj, 
 dbs_data-cdata-attr_group);
 +   sysfs_remove_group(get_governor_parent_kobj(policy),
 +   dbs_data-cdata-attr_group);
 if (dbs_data-cdata-governor == GOV_CONSERVATIVE)
 cpufreq_unregister_notifier(cs_ops-notifier_block,
 CPUFREQ_TRANSITION_NOTIFIER);

 I have pushed the complete patchset here:

 http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/cpufreq-updates


Viresh, perhaps you should ask Stephen Rothwell to pull in your tree
to get some more testing before Rafael pulls it in for 3.10?

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: kernel NULL pointer dereference

2013-01-29 Thread Amit Kucheria
 Hi -

 We added a bunch of thermal-related bits (different from the thermal bits
 that Linaro PM guys got upstream) to the tilt- kernels.  It's support for
 their thermal sensor and TI's thermal framework which monitors it and
 messes with the cpu frequency limit.

tangent

:) Upstreamed and seen working in practice on member hardware:

http://www.anandtech.com/show/6536/arm-vs-x86-the-real-showdown/13

Now, on to making it smarter about TDP.

/tangent

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V2 Resend 3/4] workqueue: Schedule work on non-idle cpu instead of current one

2013-01-07 Thread Amit Kucheria
On Mon, Jan 7, 2013 at 8:34 PM, Tejun Heo t...@kernel.org wrote:
 Hello, Viresh.

 On Mon, Jan 07, 2013 at 03:28:33PM +0530, Viresh Kumar wrote:
 Firstly the root cause of this patchset.

 Myself and some others in Linaro are working on ARM future cores:
 big.LITTLE systems.
 Here we have few very powerful, high power consuming cores (big,
 currently A15's) and
 few very efficient ones (LITTLE, currently A7's).

 The ultimate goal is to save as much power as possible without compromising
 much with performance. For, that we wanted most of the stuff to run on LITTLE
 cores and some performance-demanding stuff on big Cores. There are
 multiple things
 going around in this direction. Now, we thought A15's or big cores
 shouldn't be used
 for running small tasks like timers/workqueues and hence this patch is
 an attempt
 towards reaching that goal.

 I see.  My understanding of big.little is very superficial so there
 are very good chances that I'm utterly wrong, but to me it seems like
 more of a stop-gap solution than something which will have staying
 power in the sense that the complexity doesn't seem to have any
 inherent reason other than the failure to make the big ones power
 efficient enough while idle or under minor load.

The two processors use different manufacturing processes - one
optimised for performance, the other for really low power. So the
reason is physics at this point. Other architectures are known to be
playing with similar schemes. ARM's big.LITTLE is just the first one
to the market.

 Maybe this isn't specific to big.little and heterogeneous cores will
 be the way of future with big.little being just a forefront of the
 trend.  And even if that's not the case, it definitely doesn't mean
 that we can't accomodate big.little, but, at this point, it does make
 me a bit more reluctant to make wholesale changes specifically for
 big.little.

The patches aren't targeted to benefit only b.L systems though it was
definitely the trigger for our investigations. Our hope is that after
presenting more analysis results from our side we'll be able to
convince the community of the general usefulness of this feature.

Here are a few short introductions to big.LITTLE in case you're
interested.[1][2]

[1] http://www.arm.com/files/downloads/big.LITTLE_Final.pdf
[2] http://lwn.net/Articles/481055/

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Test Result Summary of Linaro 12.12 Release for Linux Linaro ubuntu Quantal.

2012-12-20 Thread Amit Kucheria
Hi Botao,


 2. Samsung Origen + Linux Linaro Quantal (Column E):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEowNWhZRi1zbDNNVUw1amhXTUdPcVE#gid=1

 Exactly same test result as last week: network connection is unavailable,
 reboot  halt test failed.. Power Management test would hang system when
 run test cpuhotplug_02.

PM-QA tests are documented here:
https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts

Are any bugs filed against the kernel or pm-qa after analysis of what is wrong?

 3. TI Panda 4430 + Linux Linaro Quantal (Column E):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=3

 ARM DS-5 backs to work. All 3 tests, data streaming, remote SSH connection
 and on target application debug passed. Device Tree is unavailable, the
 directory /proc/device-tree is empty. A new issue here is power management
 test cpuhotplug_07 failed. However, this test passed on TI Panda 4460.

Ditto.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Test Result Summary of Linaro 12.12 Release for Linux Linaro ubuntu Quantal.

2012-12-20 Thread Amit Kucheria
On Thu, Dec 20, 2012 at 4:49 PM, Alexander Sack a...@linaro.org wrote:
 On Thu, Dec 20, 2012 at 11:35 AM, Amit Kucheria
 amit.kuche...@linaro.org wrote:
 Hi Botao,


 2. Samsung Origen + Linux Linaro Quantal (Column E):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEowNWhZRi1zbDNNVUw1amhXTUdPcVE#gid=1

 Exactly same test result as last week: network connection is unavailable,
 reboot  halt test failed.. Power Management test would hang system when
 run test cpuhotplug_02.

 PM-QA tests are documented here:
 https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts

 Are any bugs filed against the kernel or pm-qa after analysis of what is 
 wrong?

 For all bugs, except a kernel hang/oops/panic, we should be able to
 establish a procedure that bugs get sanitized by distro engineers to
 rule out the majority of platform induced problems and give more
 details.

That'd be appreciated. Basic stuff like check against mainline,
compare against standard Linux rootfs, check for last known working
version, git bisect the kernel to where the problem started seems like
things that could be added to that procedure.

 However, we don't have strong kernel know how, so if we see a hang
 or oops, filing a but with clear instructions on how to reproduce
 it, is more or less where our ability to help debugging ends. We could
 try to make an even more minimal test case, but I would assume that in
 this case the unit tests in PMQA are minimal enough for you to act on?

PM-QA tests are mostly shell-scripts. And they're as minimal as
functional tests can be.

I'd like to work with the QA team to get to a point where they gain a
bit more understanding of the  subsystem being tested and its expected
behaviour. This would allow them to fix some bugs and help us improve
our tests too. Sometimes, it is a simple matter of kernel interfaces
changing that require updates to the tests. Other times it is missing
Kconfig options. And if someone expresses a desire to dig deeper in
the kernel in order to learn new things, we're willing to walk them
through the basics of debugging.


 3. TI Panda 4430 + Linux Linaro Quantal (Column E):

 https://docs.google.com/a/linaro.org/spreadsheet/ccc?key=0AroPySpr4FnEdEwwZkhrZ1VYUEg2LTlQZzR0RlhzM3c#gid=3

 ARM DS-5 backs to work. All 3 tests, data streaming, remote SSH connection
 and on target application debug passed. Device Tree is unavailable, the
 directory /proc/device-tree is empty. A new issue here is power management
 test cpuhotplug_07 failed. However, this test passed on TI Panda 4460.

 Ditto.


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [HMP][PATCH 0/1] Global balance

2012-12-07 Thread Amit Kucheria
On Fri, Dec 7, 2012 at 5:33 PM, Morten Rasmussen
morten.rasmus...@arm.com wrote:
 Hi Viresh,

 Here is a patch that introduces global load balancing on top of the existing 
 HMP
 patch set. It depends on the HMP patches already present in your 
 task-placement-v2
 branch. It can be applied on top of the HMP sysfs patches if needed. The fix 
 should
 be trivial.

 Could you include in the MP branch for the 12.12 release? Testing with 
 sysbench and
 coremark show significant performance improvements for parallel workloads as 
 all
 cpus can now be used for cpu intensive tasks.

Morten,

Can you share some performance number improvements and/or
kernelshark-type graphs with and without this patch? It'd be very
interesting to see the changes.

Monday is the deadline to get this merged into the MP tree to make it
to the release. It is end of week now. Not sure how much testing and
review can be done before Monday. Your numbers might make a compelling
argument.

Regards,
Amit

 Thanks,
 Morten

 Morten Rasmussen (1):
   sched: Basic global balancing support for HMP

  kernel/sched/fair.c |  101 
 +--
  1 file changed, 97 insertions(+), 4 deletions(-)

 --
 1.7.9.5



 ___
 linaro-dev mailing list
 linaro-dev@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/linaro-dev

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: HMP patches v2

2012-12-06 Thread Amit Kucheria
On Thu, Dec 6, 2012 at 5:36 PM, Liviu Dudau liviu.du...@arm.com wrote:

 On Thu, Dec 06, 2012 at 11:50:15AM +, Vincent Guittot wrote:
  On 6 December 2012 11:27, Liviu Dudau liviu.du...@arm.com wrote:
   On Thu, Dec 06, 2012 at 09:32:11AM +, Viresh Kumar wrote:
   Hi Vincent,
  
   On 6 December 2012 14:50, Vincent Guittot vincent.guit...@linaro.org
 wrote:
It's look like you have disabled packing small task in your v13
 with 4a29297
  
   It looks like you are referring to an older version of this branch as
   the commit id's
   don't match. Can you please check that again?
  
In addition, I don't fully understand why you absolutely want to
revert 39b0e77. In the worst case, it will not fully solve what it
should have solved but it doesn't add any regression.
  
   I don't want to, but Liviu and Morten do :)
   @Liviu/Morten: Your comments
  
   Hi Vincent,
  
   I was just a messenger here, but this is my understanding of where
 things are:
  
   - Morten has reviewed your patch and had provided comments, mainly
 pointing
 towards the fact that the guarantees that the code is trying to
 provide are
 not met.
   - You have replied/promised to review and update the patch (is that
 correct?)
   - Nothing has happened since in this area (is that true?)
 
  both are true
 
  
   To us, looking at the code (mainly the while loop in the
 is_buddy_busy()
   function), is seem that you are trying to guarantee that the
 runnable_avg_sum
   and the runnable_avg_period that you read from the runqueue have not
 been
   updated before deciding if that cpu is busy. But there is no reason*
 why
   another thread could not update the runnable_avg_sum and then get
 preempted
   before updating the runnable_avg_period, which means you will still
 use the
   wrong values when doing the greater than check in the return
 statement.
  
 
  No, I don't want to ensure that values have not been updated before I
  use them but that both values are coherent.

 But that to me and others seems to be false. I've suggested a way that the
 values might not be coherent and yet your while loop will exit.

 
   The other point is that even if your code is broken (i.e. you read
 stale
   values that still get you out of the while loop) the code works but
   your estimate of a CPU being busy is off by  10% ? In other words,
   having that while loop in is_buddy_busy() does not change the
 behaviour of
   the rest of the code. So the objection is on having the while loop and
   trying to claim guarantees that are not met. Why not removing the loop?
 
  So if it doesn't change the behavior why removing it ? It make the
  maintenance of patches series more complex.

 Because we don't like adding code that doesn't work as claimed and then
 justify
 its presence by arguing that even if it's broken it doesn't change
 behaviour.

 Why having that code in the first place?

 All we are suggesting here is that the while loop is broken in its
 assumptions
 and that you get the same behaviour if you remove it. If you agree then
 push
 a patch that removes the while loop and we are going to be likely in favor
 of the new patch being included. If you really want to have the values
 coherent
 then you need a better mechanism for ensuring that.


Even if that is the case, I'm afraid I don't quite like the way this was
done. IMHO, you shouldn't just revert bits of another author's patches that
you don't agree with.

If there are issues regarding the the patches from Vincent, I'd do the
following things in order of priority:
 1. Prove to him that the race exists, preferably with a reproducible test
case
 2. Give him a chance to convince you otherwise
 3. Share test results that show bad things happen as a result of some code
 4. Ask _him_ to separate out that bit from the original patch so you can
only pick the bits you like

I haven't seen this happen. All I've seen is one side claim it can happen
and the other claim that it can't. *shrug*

Viresh, as an experienced maintainer, I hope you see the value of this
approach rather than just pull in the tree.

I realise we're all under pressure here. So let's take a deep breath, step
back and do it the right way.

/Amit
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [GIT PULL] cpufreq-interactive-gov-master-v1

2012-12-04 Thread Amit Kucheria
On Sat, Dec 1, 2012 at 8:36 AM, Anton Vorontsov
anton.voront...@linaro.org wrote:
 On Fri, Nov 30, 2012 at 05:30:03PM +0400, Andrey Konovalov wrote:
 [...]
 How do you suggest to solve these issues?
 
 That you, Andrey and
 the 'the guy maintaining the Android topic'

 Deepak, is that ^^^ John, Anton, or someone else? :)

 Same question. :)

 I can easily pull branch into my Android git tree on infradead.org, but I
 believe this would be not The Right Thing to do, since it was just a
 temporary measure.

 Thanks,
 Anton.

Hey guys,

Any conclusion to this discussion? I'd really like the latest version
of interactive governor to be carried in all Linaro releases (Android
and Ubuntu). The one from the Android tree isn't the latest.

Regards,
Amit

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [GIT PULL]: big LITTLE MP v11

2012-11-06 Thread Amit Kucheria
On Tue, Nov 6, 2012 at 1:13 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 Hi Andrey,

 Please PULL b.L MP V11 branch from my tree. Pull request is generated
 against v3.7-rc3:

Thanks Viresh.

 Updates:
 ---
 - Based on v3.7-rc3
 - Stats:
  - Total Patches: 70
  - New Patches: 22
- per-task-load-average-v3-merged: 1 by Peter Z.
- per-entity-load-tracking-with-core-sched-v1: 15 by Preeti

My understanding was that this patchset by Preeti wasn't well received
by the maintainers and is being reworked. Do we have an ETA from
Preeti for the updates? I'm a little concerned that since this
patchset isn't mandatory for the b.L MP solution, we might get
distracted by it.

Having said that, we should still pay close attention to it since we
obviously care about the changes.

- sched-pack-small-tasks-v1:6 by Vincent

My suggestion is to add a list of patchsets (with branch names) for
things that might be of interest to the audience but haven't been
merged yet e.g. your patches for timer/workqueue migration.

Kevin and I have also spoken regarding resurrecting the Adaptive NO HZ
port for ARM. Kevin will maintain that going forward. So we should
look at getting that merged too in the next cycle.

  - Dropped patches/branches (as they are already merged in 3.7): 24
- arm-asymmetric-support-v3-v3.6-rc1: 1
- per-cpu-thread-hotplug-v3-fixed: 8
- rcu-hotplug-v1: 4
- scheduler-misc-v1: 1
- arm-multi_pmu_v2: 10 (out of 24 merged)
  - Updated Patches: 16
- per-task-load-average-v3-merged updated with patches applied to
 sched/core tip

 8

 The following changes since commit 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64:

   Linux 3.7-rc3 (2012-10-28 12:24:48 -0700)

 are available in the git repository at:

   git://git.linaro.org/arm/big.LITTLE/mp.git big-LITTLE-MP-v11

 for you to fetch changes up to 0c44ec0c38e97e404d0f9921f5cbeb7deb1dfc8b:

   Merge branches 'arm-multi_pmu_v2', 'hw-bkp-v7.1-debug-v1',
 'task-placement-v2', 'per-entity-load-tracking-with-core-sched-v1',
 'config-fragments' and 'sched-pack-small-tasks-v1' into big-LITTLE-MP-v11
 (2012-11-05 15:11:02 +0530)

 

 Ben Segall (1):
   sched: Maintain per-rq runnable averages

 Dietmar Eggemann (1):
   ARM: hw_breakpoint: v7.1 self-hosted debug powerdown support

 Jon Medhurst (6):
   configs: Initial core configs
   configs: Make CONFIG_MODULES part of linaro-base
   configs: Replace CONFIG_PERF_COUNTERS with CONFIG_PERF_EVENTS
   configs: android: Enable FB_EARLYSUSPEND
   configs: android: Enable CONFIG_INPUT_UINPUT to get aidb working
   ARM: sched: Avoid empty 'slow' HMP domain

 Lorenzo Pieralisi (1):
   ARM: kernel: provide cluster to logical cpu mask mapping API

 Marc Zyngier (1):
   ARM: perf: add guest vs host discrimination

 Mark Rutland (1):
   ARM: perf: register cpu_notifier at driver init

 Morten Rasmussen (13):
   linaro/configs: Enable HMP priority filter by default
   sched: entity load-tracking load_avg_ratio
   sched: Task placement for heterogeneous systems based on task
 load-tracking
   sched: Forced task migration on heterogeneous systems
   sched: Introduce priority-based task migration filter
   ARM: Add HMP scheduling support for ARM architecture
   ARM: sched: Use device-tree to provide fast/slow CPU list for HMP
   ARM: sched: Setup SCHED_HMP domains
   sched: Add ftrace events for entity load-tracking
   sched: Add HMP task migration ftrace event
   sched: SCHED_HMP multi-domain task migration control
   sched: Enable HMP priority filter by default
   sched: Only down migrate low priority tasks if allowed by affinity
 mask

 Paul Turner (15):
   sched: Track the runnable average on a per-task entity basis
   sched: Aggregate load contributed by task entities on parenting cfs_rq
   sched: Maintain the load contribution of blocked entities
   sched: Add an rq migration call-back to sched_class
   sched: Account for blocked load waking back up
   sched: Aggregate total task_group load
   sched: Compute load contribution by a group entity
   sched: Normalize tg load contributions against runnable time
   sched: Maintain runnable averages across throttled periods
   sched: Replace update_shares weight distribution with per-entity
 computation
   sched: Refactor update_shares_cpu() - update_blocked_avgs()
   sched: Update_cfs_shares at period edge
   sched: Make __update_entity_runnable_avg() fast
   sched: Introduce temporary FAIR_GROUP_SCHED dependency for
 load-tracking
   sched: implement usage tracking

 Peter Zijlstra (1):
   sched: Describe CFS load-balancer

 Preeti U Murthy (14):
   sched:Prevent movement of short running tasks 

Re: [GIT PULL]: big LITTLE MP v11

2012-11-06 Thread Amit Kucheria
On Tue, Nov 6, 2012 at 1:48 PM, Viresh Kumar viresh.ku...@linaro.org wrote:
 On 6 November 2012 13:42, Amit Kucheria amit.kuche...@linaro.org wrote:

 On Tue, Nov 6, 2012 at 1:13 PM, Viresh Kumar viresh.ku...@linaro.org
 wrote:



 - per-entity-load-tracking-with-core-sched-v1: 15 by Preeti

 My understanding was that this patchset by Preeti wasn't well received
 by the maintainers and is being reworked. Do we have an ETA from
 Preeti for the updates? I'm a little concerned that since this
 patchset isn't mandatory for the b.L MP solution, we might get
 distracted by it.

 Having said that, we should still pay close attention to it since we
 obviously care about the changes.


 I added it on request from Paul M. And i believe preeti is going to
 send a new version soon.

Fair enough.


 - sched-pack-small-tasks-v1:6 by Vincent

 My suggestion is to add a list of patchsets (with branch names) for
 things that might be of interest to the audience but haven't been
 merged yet e.g. your patches for timer/workqueue migration.


 Didn't get that completely :(
 You want me to mention them where? In merge commit log?? Process
 page??

 Because they aren't part of v11 (for e.g.), mentioning them there wouldn't
 be a good idea.

Then let's put it in your wiki page and link to that page from this
announcement. There are several folks who are interested in those
patches. :)

The perfect story of course would be to see if we can get the
maintainers to review them and get them merged into your tree.


 Kevin and I have also spoken regarding resurrecting the Adaptive NO HZ
 port for ARM. Kevin will maintain that going forward. So we should
 look at getting that merged too in the next cycle.


 Great.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


  1   2   3   >