runspec运行 cpu2006测试时,报错
Loading runspec modules...............
Locating benchmarks...found 31 benchmarks in 12 benchsets.
Locating output formats: ASCII, config, CSV, flags, HTML, mail, PDF, PostScript, raw, Screen, Submission Check
Reading config file '/home/cpu2006/config/ding-riscv.cfg'
LOCK ERROR: Could not lock log lock file "/home/cpu2006/result/CPU2006.lock".
Perl said
-------
Permission denied
-------
It is not safe to attempt to generate a run number, so I'll bail now.
There is no log file for this run.
查看bin/util.pl中的lock_file函数,调用的是flock的系统函数。
sub lock_file {
my ($fh) = @_;
my $rc = undef;
my $tries = 0;
my $max_tries = 10;
return (undef, 'badfh') unless defined($fh);
while($tries < $max_tries && !(defined($rc) && $rc)) {
eval '$rc = flock($fh, LOCK_EX);';
return (undef, 'unimplemented', $@) if $@;
if ($rc) {
return($rc, 'ok');
} else {
Log(170, "LOCK ERROR: flock($fh, LOCK_EX) returned \"$!\"\n");
sleep int(rand(5)) + 1;
}
$tries++;
}
return(undef, 'error', $!);
}
确定是内核不支持。
搜索google找到2个对文件加锁有影响的配置项:
重新编译内核解决问题。
如果不重新编译内核的话,可以修改SPEC中对log.pl中对lock失败的错误处理,不return即可,理论上不lock并不会产生什么影响,log写入还是可以的。
open_log函数体:
if (!$rc) {
Log(0, "Couldn't open $lockfile for update:\n $!\nThis makes selecting a run number impossible, so I'm going to bail now.\n");
return 0;
} else {
($rc, $what, $stuff) = lock_file($fh);
if (!defined($rc) || $what ne 'ok') {
if ($what eq 'unimplemented') {
Log(0, "LOCK ERROR: Your system doesn't seem to implement file locking. Perl said\n");
Log(0, "-------\n$stuff\n-------\n");
Log(0, "Because of this, it is not possible to guarantee that the run number (which\n");
Log(0, "determines the names of the log and results files) will be unique. This is\n");
Log(0, "only an issue if there are concurrent runs happening using this copy of the\n");
Log(0, "benchmark tree.\n");
$locked = 0;
} elsif ($what eq 'error') {
Log(0, "LOCK ERROR: Could not lock log lock file \"$lockfile\".\n");
Log(0, "Perl said\n-------\n$stuff\n-------\n");
Log(0, " It is not safe to attempt to generate a run number, so I'll bail now.\n");
#return 0;
}
} else {
$locked = 1;
}
}