Skip to content

Commit

Permalink
Repair HT Detect.
Browse files Browse the repository at this point in the history
Test Bash script:

#!/bin/sh
CPUFILE=/proc/cpuinfo
test -f $CPUFILE || exit 1
NUMPHY=`grep "physical id" $CPUFILE | sort -u | wc -l`
NUMLOG=`grep "processor" $CPUFILE | wc -l`
if [ $NUMPHY -eq 1 ]
  then
    echo This system has one physical CPU,
  else
    echo This system has $NUMPHY physical CPUs,
fi
if [ $NUMLOG -gt 1 ]
  then
    echo and $NUMLOG logical CPUs.
    NUMCORE=`grep "core id" $CPUFILE | sort -u | wc -l`
    if [ $NUMCORE -gt 1 ]
      then
        echo For every physical CPU there are $NUMCORE cores.
    fi
  else
    echo and one logical CPU.
fi
echo -n The CPU is a `grep "model name" $CPUFILE | sort -u | cut -d : -f 2-`
echo " with`grep "cache size" $CPUFILE | sort -u | cut -d : -f 2-` cache"
  • Loading branch information
eloaders committed Jan 2, 2013
1 parent e825149 commit b9401c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/i-nex/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SearchString=True

[OpenFile]
File[1]=".src/Finfosys.form"
File[2]=".src/Finfosys.class:197.37"
File[2]=".src/Finfosys.class:238.2"
File[3]=".src/Global.class:11.61"
File[4]=".src/About.form"
File[5]=".src/About.class:83.22"
Expand All @@ -40,8 +40,7 @@ File[16]=".src/Start_App_Args.form"
File[17]=".src/Start_App_Args.class:2.0"
File[18]=".src/ChkPrm.module:13.0"
File[19]=".src/BIOS_microcode_update_recommended.module:2.19"
Active=20
File[20]=".src/thermal_zone.module:53.2"
File[20]=".src/thermal_zone.module:45.38"
File[21]=".src/FModules.form"
File[22]=".src/FModules.class:4.30"
File[23]=".src/Input_Devices.module:8.1"
Expand All @@ -50,7 +49,8 @@ File[25]=".src/FinfosysNew.class:37.30"
File[26]=".src/net.module:49.66"
File[27]="Data/report-ng.sh:27.44"
File[28]=".src/Distribution_Detect.module:20.0"
File[29]=".src/FFlags.module:57.22"
Active=29
File[29]=".src/FFlags.module:78.22"
Count=29

[Watches]
Expand Down
24 changes: 19 additions & 5 deletions src/i-nex/.src/FFlags.module
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ Public Sub _init()
Else
Finfosys.ToolButton1.Picture = Picture["Data/check_false.png"]
Endif
If dec_instructions Like "*ht*" Then
Finfosys.ToolButton3.Picture = Picture["Data/check_true.png"]
Else
Finfosys.ToolButton3.Picture = Picture["Data/check_false.png"]
Endif
If dec_instructions Like "*svm*" Then
Finfosys.ToolButton2.Picture = Picture["Data/check_true.png"]
Else
Expand All @@ -64,4 +59,23 @@ Public Sub _init()
Else
Finfosys.ToolButton2.Picture = Picture["Data/check_false.png"]
Endif
ht()
End

Public Sub ht()
Dim NUMLOG, NUMPHY As String
Dim NUMLOGF, NUMPHYF As Float
Shell "grep 'physical id' /proc/cpuinfo | sort -u | wc -l" Wait To NUMPHY
Shell "grep 'processor' /proc/cpuinfo | wc -l" Wait To NUMLOG
NUMLOG = Replace(Replace(NUMLOG, " ", ""), "\n", "")
NUMPHY = Replace(Replace(NUMPHY, " ", ""), "\n", "")
NUMLOGF = CFloat(Val(NUMLOG))
NUMPHYF = CFloat(Val(NUMPHY))
If NUMPHY = NUMLOG Then
Finfosys.ToolButton3.Picture = Picture["Data/check_false.png"]
Debug "Not detect HT"
Else
Finfosys.ToolButton3.Picture = Picture["Data/check_true.png"]
Debug "Detected HT"
Endif
End

0 comments on commit b9401c3

Please sign in to comment.