Revert "procfs cpuinfo: use sequence number as processor"

This reverts commit bb7e140655.

Change-Id: If0c1719986706511c1e57d06bc61923d1adfc0aa
This commit is contained in:
Balazs Gerofi
2020-04-22 09:33:49 +09:00
committed by Masamichi Takagi
parent 5f5b9f94d1
commit fd941dad44
6 changed files with 1 additions and 126 deletions

View File

@ -1279,7 +1279,7 @@ long ihk_mc_show_cpuinfo(char *buf, size_t buf_size, unsigned long read_off, int
/* generate strings */
loff += scnprintf(lbuf + loff, lbuf_size - loff,
"processor\t: %d\n", i);
"processor\t: %d\n", cpuinfo->hwid);
loff += scnprintf(lbuf + loff, lbuf_size - loff, "Features\t:");
for (j = 0; hwcap_str[j]; j++) {

View File

@ -1,63 +0,0 @@
#
# Test script for issue #1439
#
import os
import sys
import subprocess
def get_command_result(cmd):
results = subprocess.Popen(
cmd, stdout=subprocess.PIPE,
shell=True).stdout.readlines()
return [str(x).rstrip("\n") for x in results]
def enumerate_cpu(cpu_list):
allcpus = []
for ranged_cpu in cpu_list.split(','):
try:
cpu_begin, cpu_end = ranged_cpu.split('-')
except ValueError:
cpu_begin = cpu_end = ranged_cpu
for i in range(int(cpu_begin), int(cpu_end) + 1):
allcpus.append(i)
allcpus.sort()
return allcpus
def get_online_cpu():
online_file = open('/sys/devices/system/cpu/online', 'r')
return online_file.readlines()[0].strip()
def get_cpuinfo_processors():
processors = []
cpuinfo_file = open('/proc/cpuinfo', 'r')
for line in cpuinfo_file.readlines():
if line.startswith('processor'):
processor = int(line.strip().split()[-1])
processors.append(processor)
return processors
def main():
onlines = enumerate_cpu(get_online_cpu())
processors = get_cpuinfo_processors()
print '# of online cpus:', len(onlines)
print '# of cpuinfo processors:', len(processors)
if len(onlines) != len(processors):
print 'ERROR: # of processors is not equal to # of cpus'
print 'FAIL'
exit()
i = 0
for cpu in processors:
print i, 'processor:', cpu
if i != cpu:
print 'ERROR: processor number is not ordered'
print 'FAIL'
exit()
i = i + 1
print 'SUCCESS'
if __name__ == '__main__':
main()

View File

@ -1,7 +0,0 @@
#!/bin/bash
. ${HOME}/.mck_test_config
export MCK_DIR
sudo ${MCK_DIR}/sbin/mcreboot.sh 1,3,5,7,9-12,50-58
${MCK_DIR}/bin/mcexec python C1457.py
sudo ${MCK_DIR}/sbin/mcstop+release.sh

View File

@ -1,2 +0,0 @@
test::
./C1457.shy

View File

@ -1,22 +0,0 @@
□ テスト内容
arm64環境における/proc/cpuinfoについて、以下を確かめる。
(1) "processor" フィールドが/sys/devices/system/cpu/onlineファイルが示す
CPUの数だけ存在すること。
(2) "processor" フィールドの値が0からはじまる連番であること。
□ 実行手順
(1) $HOME/.mck_test_configを、MCK_DIRがMcKernelのインストール先を指すように編集する
(2) 以下を実行する
$ make test
□ 確認方法
標準出力にSUCCESSが出力されること

View File

@ -1,31 +0,0 @@
# of online cpus: 28
# of cpuinfo processors: 28
0 processor: 0
1 processor: 1
2 processor: 2
3 processor: 3
4 processor: 4
5 processor: 5
6 processor: 6
7 processor: 7
8 processor: 8
9 processor: 9
10 processor: 10
11 processor: 11
12 processor: 12
13 processor: 13
14 processor: 14
15 processor: 15
16 processor: 16
17 processor: 17
18 processor: 18
19 processor: 19
20 processor: 20
21 processor: 21
22 processor: 22
23 processor: 23
24 processor: 24
25 processor: 25
26 processor: 26
27 processor: 27
SUCCESS