Errors: Print a URL with a hash of the format string to find more information about an error.
This commit is contained in:
parent
35a85a4e86
commit
f4291aac25
7 changed files with 47 additions and 21 deletions
|
@ -78,10 +78,10 @@ def run(options, root, testsys, cpu_class):
|
||||||
cptdir = getcwd()
|
cptdir = getcwd()
|
||||||
|
|
||||||
if options.fast_forward and options.checkpoint_restore != None:
|
if options.fast_forward and options.checkpoint_restore != None:
|
||||||
m5.panic("Error: Can't specify both --fast-forward and --checkpoint-restore")
|
m5.fatal("Error: Can't specify both --fast-forward and --checkpoint-restore")
|
||||||
|
|
||||||
if options.standard_switch and not options.caches:
|
if options.standard_switch and not options.caches:
|
||||||
m5.panic("Error: Must specify --caches when using --standard-switch")
|
m5.fatal("Error: Must specify --caches when using --standard-switch")
|
||||||
|
|
||||||
np = options.num_cpus
|
np = options.num_cpus
|
||||||
max_checkpoints = options.max_checkpoints
|
max_checkpoints = options.max_checkpoints
|
||||||
|
@ -129,7 +129,7 @@ def run(options, root, testsys, cpu_class):
|
||||||
# Fast forward to a simpoint (warning: time consuming)
|
# Fast forward to a simpoint (warning: time consuming)
|
||||||
elif options.simpoint:
|
elif options.simpoint:
|
||||||
if testsys.cpu[i].workload[0].simpoint == 0:
|
if testsys.cpu[i].workload[0].simpoint == 0:
|
||||||
m5.panic('simpoint not found')
|
m5.fatal('simpoint not found')
|
||||||
testsys.cpu[i].max_insts_any_thread = \
|
testsys.cpu[i].max_insts_any_thread = \
|
||||||
testsys.cpu[i].workload[0].simpoint
|
testsys.cpu[i].workload[0].simpoint
|
||||||
# No distance specified, just switch
|
# No distance specified, just switch
|
||||||
|
@ -163,7 +163,7 @@ def run(options, root, testsys, cpu_class):
|
||||||
if options.simpoint:
|
if options.simpoint:
|
||||||
for i in xrange(np):
|
for i in xrange(np):
|
||||||
if testsys.cpu[i].workload[0].simpoint == 0:
|
if testsys.cpu[i].workload[0].simpoint == 0:
|
||||||
m5.panic('no simpoint for testsys.cpu[%d].workload[0]' % i)
|
m5.fatal('no simpoint for testsys.cpu[%d].workload[0]', i)
|
||||||
checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
|
checkpoint_inst = int(testsys.cpu[i].workload[0].simpoint) + offset
|
||||||
testsys.cpu[i].max_insts_any_thread = checkpoint_inst
|
testsys.cpu[i].max_insts_any_thread = checkpoint_inst
|
||||||
# used for output below
|
# used for output below
|
||||||
|
@ -183,13 +183,13 @@ def run(options, root, testsys, cpu_class):
|
||||||
import re
|
import re
|
||||||
|
|
||||||
if not isdir(cptdir):
|
if not isdir(cptdir):
|
||||||
m5.panic("checkpoint dir %s does not exist!" % cptdir)
|
m5.fatal("checkpoint dir %s does not exist!", cptdir)
|
||||||
|
|
||||||
if options.at_instruction:
|
if options.at_instruction:
|
||||||
checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
|
checkpoint_dir = joinpath(cptdir, "cpt.%s.%s" % \
|
||||||
(options.bench, options.checkpoint_restore))
|
(options.bench, options.checkpoint_restore))
|
||||||
if not exists(checkpoint_dir):
|
if not exists(checkpoint_dir):
|
||||||
m5.panic("Unable to find checkpoint directory %s" % \
|
m5.fatal("Unable to find checkpoint directory %s",
|
||||||
checkpoint_dir)
|
checkpoint_dir)
|
||||||
|
|
||||||
print "Restoring checkpoint ..."
|
print "Restoring checkpoint ..."
|
||||||
|
@ -198,7 +198,7 @@ def run(options, root, testsys, cpu_class):
|
||||||
elif options.simpoint:
|
elif options.simpoint:
|
||||||
# assume workload 0 has the simpoint
|
# assume workload 0 has the simpoint
|
||||||
if testsys.cpu[0].workload[0].simpoint == 0:
|
if testsys.cpu[0].workload[0].simpoint == 0:
|
||||||
m5.panic('Unable to find simpoint')
|
m5.fatal('Unable to find simpoint')
|
||||||
|
|
||||||
options.checkpoint_restore += \
|
options.checkpoint_restore += \
|
||||||
int(testsys.cpu[0].workload[0].simpoint)
|
int(testsys.cpu[0].workload[0].simpoint)
|
||||||
|
@ -206,8 +206,8 @@ def run(options, root, testsys, cpu_class):
|
||||||
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
|
checkpoint_dir = joinpath(cptdir, "cpt.%s.%d" % \
|
||||||
(options.bench, options.checkpoint_restore))
|
(options.bench, options.checkpoint_restore))
|
||||||
if not exists(checkpoint_dir):
|
if not exists(checkpoint_dir):
|
||||||
m5.panic("Unable to find checkpoint directory %s.%s" % \
|
m5.fatal("Unable to find checkpoint directory %s.%s",
|
||||||
(options.bench, options.checkpoint_restore))
|
options.bench, options.checkpoint_restore)
|
||||||
|
|
||||||
print "Restoring checkpoint ..."
|
print "Restoring checkpoint ..."
|
||||||
m5.restoreCheckpoint(root,checkpoint_dir)
|
m5.restoreCheckpoint(root,checkpoint_dir)
|
||||||
|
@ -226,7 +226,7 @@ def run(options, root, testsys, cpu_class):
|
||||||
cpt_num = options.checkpoint_restore
|
cpt_num = options.checkpoint_restore
|
||||||
|
|
||||||
if cpt_num > len(cpts):
|
if cpt_num > len(cpts):
|
||||||
m5.panic('Checkpoint %d not found' % cpt_num)
|
m5.fatal('Checkpoint %d not found', cpt_num)
|
||||||
|
|
||||||
## Adjust max tick based on our starting tick
|
## Adjust max tick based on our starting tick
|
||||||
maxtick = maxtick - int(cpts[cpt_num - 1])
|
maxtick = maxtick - int(cpts[cpt_num - 1])
|
||||||
|
|
|
@ -31,7 +31,7 @@ import optparse, os, sys
|
||||||
import m5
|
import m5
|
||||||
|
|
||||||
if not m5.build_env['FULL_SYSTEM']:
|
if not m5.build_env['FULL_SYSTEM']:
|
||||||
m5.panic("This script requires full-system mode (*_FS).")
|
m5.fatal("This script requires full-system mode (*_FS).")
|
||||||
|
|
||||||
from m5.objects import *
|
from m5.objects import *
|
||||||
m5.AddToPath('../common')
|
m5.AddToPath('../common')
|
||||||
|
@ -105,7 +105,7 @@ elif m5.build_env['TARGET_ISA'] == "sparc":
|
||||||
elif m5.build_env['TARGET_ISA'] == "x86":
|
elif m5.build_env['TARGET_ISA'] == "x86":
|
||||||
test_sys = makeLinuxX86System(test_mem_mode, bm[0])
|
test_sys = makeLinuxX86System(test_mem_mode, bm[0])
|
||||||
else:
|
else:
|
||||||
m5.panic("incapable of building non-alpha or non-sparc full system!")
|
m5.fatal("incapable of building non-alpha or non-sparc full system!")
|
||||||
|
|
||||||
if options.kernel is not None:
|
if options.kernel is not None:
|
||||||
test_sys.kernel = binary(options.kernel)
|
test_sys.kernel = binary(options.kernel)
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
import m5
|
import m5
|
||||||
|
|
||||||
if m5.build_env['FULL_SYSTEM']:
|
if m5.build_env['FULL_SYSTEM']:
|
||||||
m5.panic("This script requires syscall emulation mode (*_SE).")
|
m5.fatal("This script requires syscall emulation mode (*_SE).")
|
||||||
|
|
||||||
from m5.objects import *
|
from m5.objects import *
|
||||||
import os, optparse, sys
|
import os, optparse, sys
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <zlib.h>
|
||||||
|
|
||||||
#include "base/cprintf.hh"
|
#include "base/cprintf.hh"
|
||||||
#include "base/hostinfo.hh"
|
#include "base/hostinfo.hh"
|
||||||
|
@ -68,15 +69,20 @@ __exit_message(const char *prefix, int code,
|
||||||
default:
|
default:
|
||||||
format += "\n";
|
format += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt));
|
||||||
|
|
||||||
format += " @ cycle %d\n[%s:%s, line %d]\n";
|
format += " @ cycle %d\n[%s:%s, line %d]\n";
|
||||||
format += "Memory Usage: %ld KBytes\n";
|
format += "Memory Usage: %ld KBytes\n";
|
||||||
|
format += "For more information see: http://www.m5sim.org/%s/%x\n";
|
||||||
|
|
||||||
args.push_back(curTick);
|
args.push_back(curTick);
|
||||||
args.push_back(func);
|
args.push_back(func);
|
||||||
args.push_back(file);
|
args.push_back(file);
|
||||||
args.push_back(line);
|
args.push_back(line);
|
||||||
args.push_back(memUsage());
|
args.push_back(memUsage());
|
||||||
|
args.push_back(prefix);
|
||||||
|
args.push_back(crc);
|
||||||
|
|
||||||
ccprintf(cerr, format.c_str(), args);
|
ccprintf(cerr, format.c_str(), args);
|
||||||
|
|
||||||
|
@ -103,6 +109,8 @@ __base_message(std::ostream &stream, const char *prefix, bool verbose,
|
||||||
default:
|
default:
|
||||||
format += "\n";
|
format += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t crc = crc32(0, (const Bytef*)fmt, strlen(fmt));
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
format += " @ cycle %d\n[%s:%s, line %d]\n";
|
format += " @ cycle %d\n[%s:%s, line %d]\n";
|
||||||
|
@ -112,5 +120,11 @@ __base_message(std::ostream &stream, const char *prefix, bool verbose,
|
||||||
args.push_back(line);
|
args.push_back(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(prefix, "warn") == 0) {
|
||||||
|
format += "For more information see: http://www.m5sim.org/%s/%x\n";
|
||||||
|
args.push_back(prefix);
|
||||||
|
args.push_back(crc);
|
||||||
|
}
|
||||||
|
|
||||||
ccprintf(stream, format.c_str(), args);
|
ccprintf(stream, format.c_str(), args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,8 +748,8 @@ class SimObject(object):
|
||||||
for param in param_names:
|
for param in param_names:
|
||||||
value = self._values.get(param)
|
value = self._values.get(param)
|
||||||
if value is None:
|
if value is None:
|
||||||
m5.fatal("%s.%s without default or user set value" \
|
m5.fatal("%s.%s without default or user set value",
|
||||||
% (self.path(), param))
|
self.path(), param)
|
||||||
|
|
||||||
value = value.getValue()
|
value = value.getValue()
|
||||||
if isinstance(self._params[param], VectorParamDesc):
|
if isinstance(self._params[param], VectorParamDesc):
|
||||||
|
|
|
@ -37,18 +37,30 @@ MaxTick = 2**63 - 1
|
||||||
|
|
||||||
# define this here so we can use it right away if necessary
|
# define this here so we can use it right away if necessary
|
||||||
|
|
||||||
|
def errorURL(prefix, s):
|
||||||
|
try:
|
||||||
|
import zlib
|
||||||
|
hashstr = "%x" % zlib.crc32(s)
|
||||||
|
except:
|
||||||
|
hashstr = "UnableToHash"
|
||||||
|
return "For more information see: http://www.m5sim.org/%s/%s" % \
|
||||||
|
(prefix, hashstr)
|
||||||
|
|
||||||
|
|
||||||
# panic() should be called when something happens that should never
|
# panic() should be called when something happens that should never
|
||||||
# ever happen regardless of what the user does (i.e., an acutal m5
|
# ever happen regardless of what the user does (i.e., an acutal m5
|
||||||
# bug).
|
# bug).
|
||||||
def panic(string):
|
def panic(fmt, *args):
|
||||||
print >>sys.stderr, 'panic:', string
|
print >>sys.stderr, 'panic:', fmt % args
|
||||||
|
print >>sys.stderr, errorURL('panic',fmt)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# fatal() should be called when the simulation cannot continue due to
|
# fatal() should be called when the simulation cannot continue due to
|
||||||
# some condition that is the user's fault (bad configuration, invalid
|
# some condition that is the user's fault (bad configuration, invalid
|
||||||
# arguments, etc.) and not a simulator bug.
|
# arguments, etc.) and not a simulator bug.
|
||||||
def fatal(string):
|
def fatal(fmt, *args):
|
||||||
print >>sys.stderr, 'fatal:', string
|
print >>sys.stderr, 'fatal:', fmt % args
|
||||||
|
print >>sys.stderr, errorURL('fatal',fmt)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# force scalars to one-element lists for uniformity
|
# force scalars to one-element lists for uniformity
|
||||||
|
|
|
@ -327,8 +327,8 @@ class CheckedIntType(MetaParamValue):
|
||||||
if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
|
if not (hasattr(cls, 'min') and hasattr(cls, 'max')):
|
||||||
if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
|
if not (hasattr(cls, 'size') and hasattr(cls, 'unsigned')):
|
||||||
panic("CheckedInt subclass %s must define either\n" \
|
panic("CheckedInt subclass %s must define either\n" \
|
||||||
" 'min' and 'max' or 'size' and 'unsigned'\n" \
|
" 'min' and 'max' or 'size' and 'unsigned'\n",
|
||||||
% name);
|
name);
|
||||||
if cls.unsigned:
|
if cls.unsigned:
|
||||||
cls.min = 0
|
cls.min = 0
|
||||||
cls.max = 2 ** cls.size - 1
|
cls.max = 2 ** cls.size - 1
|
||||||
|
|
Loading…
Reference in a new issue