1#!/bin/sh 2################################################################################ 3## ## 4## This program is free software; you can redistribute it and#or modify ## 5## it under the terms of the GNU General Public License as published by ## 6## the Free Software Foundation; either version 2 of the License, or ## 7## (at your option) any later version. ## 8## ## 9## This program is distributed in the hope that it will be useful, but ## 10## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## 11## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## 12## for more details. ## 13## ## 14## You should have received a copy of the GNU General Public License ## 15## along with this program; if not, write to the Free Software ## 16## Foundation, Inc., 59 Tiemple Place, Suite 330, Boston, MA 02111-1307 USA ## 17## ## 18################################################################################ 19# 20# File: smt_smp_enabled.sh 21# 22# Description: This program tests whether HT/SMP is supported or not. 23# 24# Author: Rohit Verma, rohit.170309@gmail.com 25# 26# History: May 21 2009 - Created. - Rohit Verma 27 28export TST_TOTAL=1 29export TCID=smt_smp_enabled 30export TST_COUNT=1 31TFAILCNT=0 32RC=0 33 34 35# check for SMT/SMP System 36tst_resm TINFO "Begin: SMT/SMP Enabled" 37if [ -f ./ht_enabled ];then 38 ./ht_enabled 39 ret_value=$? 40 41 if [ $ret_value -ne 0 ];then 42 tst_resm TCONF "SMT/SMP is not supported" 43 tst_resm TINFO "End: SMT/SMP Enabled" 44 exit 0 45 fi 46else 47 tst_resm TBROK "ht_enabled:File not found" 48 tst_resm TINFO "End: SMT/SMP Enabled" 49 TFAILCNT=$(( $TFAILCNT+1 )) 50 exit $TFAILCNT 51fi 52 53no_of_processor=`tst_ncpus` 54no_of_cpu=`tst_ncpus_conf` 55 56if [ $no_of_processor -lt $no_of_cpu ];then 57 test_op="Enable:/sys/devices/system/cpu/cpuX/online" 58 tst_resm TCONF "$test_op" 59 tst_resm TINFO "End: SMT/SMP Enabled" 60 TFAILCNT=$(( $TFAILCNT+1 )) 61 exit $TFAILCNT 62else 63cpu_cores=`cat /proc/cpuinfo | grep "cpu cores" | cut -f 2 -d ':'\ 64 | sed 's/ //' | uniq` 65 66 if [ $cpu_cores -eq 1 ];then 67 tst_resm TPASS "SMT is enable" 68 elif [ $cpu_cores -ge 2 ];then 69 tst_resm TPASS "SMP System" 70 else 71 tst_resm TCONF "TBD" 72 fi 73fi 74 75tst_resm TINFO "End: SMT/SMP Enabled" 76 77exit 78