mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
more indentation cleanup
This commit is contained in:
parent
aebbdbe6c6
commit
7006e1a062
108
inxi
108
inxi
|
@ -1486,72 +1486,72 @@ get_cpu_ht_multicore_smp_data()
|
||||||
if [[ $B_CPUINFO == 'true' ]]; then
|
if [[ $B_CPUINFO == 'true' ]]; then
|
||||||
{
|
{
|
||||||
A_CPU_TYPE_PCNT_CCNT=( $(gawk '
|
A_CPU_TYPE_PCNT_CCNT=( $(gawk '
|
||||||
BEGIN { FS=": "; i = 0 } {IGNORECASE = 1}
|
BEGIN { FS=": "; i = 0 } {IGNORECASE = 1}
|
||||||
/^processor/ { num_of_processors = $NF + 1 } # counts logical processors, both HT and physical
|
/^processor/ { num_of_processors = $NF + 1 } # counts logical processors, both HT and physical
|
||||||
/^cpu cores/ { num_of_cores = $NF } # counts physical cores
|
/^cpu cores/ { num_of_cores = $NF } # counts physical cores
|
||||||
/^physical/ { physical_id[i] = $NF } # array of physical cpus ids
|
/^physical/ { physical_id[i] = $NF } # array of physical cpus ids
|
||||||
/^core id/ { core_id[i] = $NF; i++ } # array of core ids
|
/^core id/ { core_id[i] = $NF; i++ } # array of core ids
|
||||||
|
{
|
||||||
|
processors = 1
|
||||||
|
cores = 1 # single cores are obviously a Uni-processor
|
||||||
|
type = "UP"
|
||||||
|
cpu_temp = 0
|
||||||
|
core_temp = 0
|
||||||
|
|
||||||
|
# look for the largest id number, and assign it
|
||||||
|
for ( j = 0; j <= num_of_processors; j++)
|
||||||
|
{
|
||||||
|
if ( physical[j] > cpu_temp )
|
||||||
{
|
{
|
||||||
processors = 1
|
cpu_temp = physical[j]
|
||||||
cores = 1 # single cores are obviously a Uni-processor
|
}
|
||||||
type = "UP"
|
if ( core_id[j] > core_temp )
|
||||||
cpu_temp = 0
|
{
|
||||||
core_temp = 0
|
core_temp = core_id[j]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# look for the largest id number, and assign it
|
physical_cpu_count = cpu_temp + 1
|
||||||
for ( j = 0; j <= num_of_processors; j++)
|
core_count = core_temp + 1
|
||||||
|
|
||||||
|
# looking at logical processor counts over 1, which means either HT, SMP or MCP
|
||||||
|
if ( num_of_processors > 1 )
|
||||||
|
{
|
||||||
|
if ( physical_cpu_count == 1 )
|
||||||
|
{
|
||||||
|
if ( physical_cpu_count == core_count )
|
||||||
{
|
{
|
||||||
if ( physical[j] > cpu_temp )
|
type = "HT" # this is more than likely a P4 w/HT or an Atom 270
|
||||||
{
|
|
||||||
cpu_temp = physical[j]
|
|
||||||
}
|
|
||||||
if ( core_id[j] > core_temp )
|
|
||||||
{
|
|
||||||
core_temp = core_id[j]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
physical_cpu_count = cpu_temp + 1
|
|
||||||
core_count = core_temp + 1
|
|
||||||
|
|
||||||
# looking at logical processor counts over 1, which means either HT, SMP or MCP
|
|
||||||
if ( num_of_processors > 1 )
|
|
||||||
{
|
{
|
||||||
if ( physical_cpu_count == 1 )
|
if ( core_count == num_of_cores && core_count == num_of_processors)
|
||||||
{
|
{
|
||||||
if ( physical_cpu_count == core_count )
|
type = "MCP"
|
||||||
{
|
cores = core_count
|
||||||
type = "HT" # this is more than likely a P4 w/HT or an Atom 270
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( core_count == num_of_cores && core_count == num_of_processors)
|
|
||||||
{
|
|
||||||
type = "MCP"
|
|
||||||
cores = core_count
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
type = "HT" # this is i7 or Atom 330
|
|
||||||
cores = core_count
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
type = "SMP"
|
type = "HT" # this is i7 or Atom 330
|
||||||
processors = physical_cpu_count
|
cores = core_count
|
||||||
|
|
||||||
if ( num_of_cores > 1 )
|
|
||||||
{
|
|
||||||
type = "SMPMC" # processors could be both MCP and SMP
|
|
||||||
cores = core_count
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
END { print type " " processors " " cores }
|
else
|
||||||
' $DIR_CPUINFO ))
|
{
|
||||||
|
type = "SMP"
|
||||||
|
processors = physical_cpu_count
|
||||||
|
|
||||||
|
if ( num_of_cores > 1 )
|
||||||
|
{
|
||||||
|
type = "SMPMC" # processors could be both MCP and SMP
|
||||||
|
cores = core_count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END { print type " " processors " " cores }
|
||||||
|
' $DIR_CPUINFO ))
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue