• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2#
3# Copyright (c) International Business Machines  Corp., 2001
4# Author: Nageswara R Sastry <nasastry@in.ibm.com>
5#
6# This program is free software;  you can redistribute it and#or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14# for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program;  if not, write to the Free Software Foundation,
18# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19#
20
21export TCID="Power_Management05"
22export TST_TOTAL=2
23
24. test.sh
25. pm_include.sh
26
27# Checking test environment
28check_kervel_arch
29
30if tst_kvcmp -gt "2.6.29"; then
31	max_sched_mc=2
32	max_sched_smt=2
33else
34	max_sched_mc=1
35	max_sched_smt=1
36fi
37
38tst_test_cmds python
39
40if ! grep sched_debug -qw /proc/cmdline ; then
41	tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \
42		"CPU Consolidation test cannot run"
43fi
44
45hyper_threaded=$(is_hyper_threaded)
46if [ ! -f /sys/devices/system/cpu/sched_mc_power_savings \
47	-o $hyper_threaded -ne 0 ] ; then
48	tst_brkm TCONF "Required kernel configuration for SCHED_MC" \
49		"NOT set, or sched_mc_power_savings interface in system" \
50		"which is not hyper-threaded"
51fi
52
53# sched_domain test
54echo "max sched mc $max_sched_mc"
55RC=0
56for sched_mc in `seq 0 $max_sched_mc`; do
57	pm_sched_domain.py -c $sched_mc; ret=$?
58	analyze_sched_domain_result $sched_mc $ret; RC=$?
59done
60if [ $RC -eq 0 ]; then
61	tst_resm TPASS "Sched_domain test for sched_mc"
62else
63	tst_resm TFAIL "Sched_domain test for sched_mc"
64fi
65
66# Testcase to validate sched_domain tree
67RC=0
68for sched_mc in `seq 0 $max_sched_mc`; do
69	pm_get_sched_values sched_smt; max_sched_smt=$?
70	for sched_smt in `seq 0 $max_sched_smt`; do
71		pm_sched_domain.py -c $sched_mc -t $sched_smt; ret=$?
72		analyze_sched_domain_result $sched_mc $ret $sched_smt; RC=$?
73	done
74done
75if [ $RC -eq 0 ]; then
76	tst_resm TPASS "Sched_domain test for sched_mc & sched_smt"
77else
78	tst_resm TFAIL "Sched_domain test for sched_mc & sched_smt"
79fi
80
81tst_exit
82