On 24 Feb 15 21:53, Vincent Guittot wrote:
> On 8 February 2015 at 01:08, Larry Bassel <larry.bas...@linaro.org> wrote:
> > +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
> > +
> > +    is_flag_set $val  0x80  "domain$domain_num share cpu capacity flag"
> > +    is_flag_set $val  0x100  "domain$domain_num share power domain flag"
> > +    is_flag_set $val  0x200  "domain$domain_num share cpu package 
> > resources flag"
> 
> could you use a list of masks to be tested against $val instead of
> hard coding them ? the number of flags to be tested should increase
> with eas patchset
> 

Yes, this is a good idea. What is the best (i.e. cleanest/most
maintainable/most portable) way of doing this in a shell script?
Arrays of masks and corresponding strings? I think I remember
Lisa telling me that arrays aren't portable as they are not in
all shells.

Thanks.

Larry

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

Reply via email to