summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-11-24 05:12:40 +0000
committerngie <ngie@FreeBSD.org>2015-11-24 05:12:40 +0000
commite98a8a4a446074eb86604afed77d96fe01a0b12b (patch)
tree395b4d46c3dd3e84d3f83fdb8b561eab1b82bec3 /tools
parentb923a91e2c985b47c61617b8287f43bce6c02e29 (diff)
parent7f4494e3bff2bd744f653c0506896eab083f5a6c (diff)
downloadFreeBSD-src-e98a8a4a446074eb86604afed77d96fe01a0b12b.zip
FreeBSD-src-e98a8a4a446074eb86604afed77d96fe01a0b12b.tar.gz
MFhead @ r291235
Diffstat (limited to 'tools')
-rw-r--r--tools/build/options/WITH_OPENSSH_NONE_CIPHER9
-rw-r--r--tools/debugscripts/kld_deb.py7
-rw-r--r--tools/regression/netinet/ip_id_period/ip_id_period.py1
-rw-r--r--tools/sched/schedgraph.py33
-rwxr-xr-xtools/tools/nanobsd/defaults.sh23
-rwxr-xr-xtools/tools/shlib-compat/shlib-compat.py67
6 files changed, 69 insertions, 71 deletions
diff --git a/tools/build/options/WITH_OPENSSH_NONE_CIPHER b/tools/build/options/WITH_OPENSSH_NONE_CIPHER
deleted file mode 100644
index 8d44cc0..0000000
--- a/tools/build/options/WITH_OPENSSH_NONE_CIPHER
+++ /dev/null
@@ -1,9 +0,0 @@
-.\" $FreeBSD$
-Set to include the "None" cipher support in OpenSSH and its libraries.
-Additional adjustments may need to be done to system configuration
-files, such as
-.Xr sshd_config 5 ,
-to enable this cipher.
-Please see
-.Pa /usr/src/crypto/openssh/README.hpn
-for full details.
diff --git a/tools/debugscripts/kld_deb.py b/tools/debugscripts/kld_deb.py
index 5cf0167..167b3dc 100644
--- a/tools/debugscripts/kld_deb.py
+++ b/tools/debugscripts/kld_deb.py
@@ -26,6 +26,7 @@
#
# $FreeBSD$
+from __future__ import print_function
import sys
import os
import popen2
@@ -42,7 +43,7 @@ printre = re.compile(r'\$\d+\s+=\s+')
kld_debug_paths = []
if len(sys.argv[1:]) < 2:
- print 'Usage: prog <kerncomp> <core> [<paths>]'
+ print('Usage: prog <kerncomp> <core> [<paths>]')
sys.exit(1)
#Get the base modules path
@@ -129,7 +130,7 @@ for i in addr[1:]:
#Tell our user that we couldn't find it.
a = i[1]
sys.stderr.write("Can't find module: %s (addr: %d + header)\n" % (i[0], a))
- print '#add-symbol-file <file>', a, '#add header'
+ print('#add-symbol-file <file>', a, '#add header')
continue
#j = popen2.popen4('objdump --section-headers /boot/kernel/%s | grep "\.text"' % i[0])[0].read().strip().split()
@@ -137,6 +138,6 @@ for i in addr[1:]:
j = popen2.popen4('objdump --section-headers "%s" | grep "\.text"' % p)[0].read().strip().split()
try:
a = int(j[5], 16)
- print 'add-symbol-file', p, i[1] + a
+ print('add-symbol-file', p, i[1] + a)
except IndexError:
sys.stderr.write('Bad file: %s, address: %d\n' % (i[0], i[1]))
diff --git a/tools/regression/netinet/ip_id_period/ip_id_period.py b/tools/regression/netinet/ip_id_period/ip_id_period.py
index ba84321..c04f5a4 100644
--- a/tools/regression/netinet/ip_id_period/ip_id_period.py
+++ b/tools/regression/netinet/ip_id_period/ip_id_period.py
@@ -27,6 +27,7 @@
# code. It will push 200000 packets, then report back what the min and max
# periods it saw for different IDs were.
+from __future__ import print_function
import os
import signal
import subprocess
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py
index 0723dc3..6d8a4b9 100644
--- a/tools/sched/schedgraph.py
+++ b/tools/sched/schedgraph.py
@@ -26,6 +26,7 @@
#
# $FreeBSD$
+from __future__ import print_function
import sys
import re
import random
@@ -142,7 +143,7 @@ class Colormap:
color = self.map[name]
except:
color = colors[random.randrange(0, len(colors))]
- print "Picking random color", color, "for", name
+ print("Picking random color", color, "for", name)
self.map[name] = color
self.table.append((name, color))
return (color)
@@ -736,9 +737,9 @@ class StateEvent(Event):
color = colormap.lookup(self.name)
if (duration < 0):
duration = 0
- print "Unsynchronized timestamp"
- print self.cpu, self.timestamp
- print next.cpu, next.timestamp
+ print("Unsynchronized timestamp")
+ print(self.cpu, self.timestamp)
+ print(next.cpu, next.timestamp)
delta = duration / canvas.ratio
l = canvas.create_rectangle(xpos, ypos,
xpos + delta, ypos - 10, fill=color, width=0,
@@ -762,9 +763,9 @@ class CountEvent(Event):
self.duration = duration = next.timestamp - self.timestamp
if (duration < 0):
duration = 0
- print "Unsynchronized timestamp"
- print self.cpu, self.timestamp
- print next.cpu, next.timestamp
+ print("Unsynchronized timestamp")
+ print(self.cpu, self.timestamp)
+ print(next.cpu, next.timestamp)
self.attrs.insert(0, ("count", self.count))
self.attrs.insert(1, ("duration", ticks2sec(duration)))
delta = duration / canvas.ratio
@@ -941,7 +942,7 @@ class KTRFile:
try:
ifp = open(file)
except:
- print "Can't open", file
+ print("Can't open", file)
sys.exit(1)
# quoteexp matches a quoted string, no escaping
@@ -989,14 +990,14 @@ class KTRFile:
status.startup("Parsing line " + str(lineno))
m = ktrre.match(line);
if (m == None):
- print "Can't parse", lineno, line,
+ print("Can't parse", lineno, line, end=' ')
continue;
(index, cpu, timestamp, group, id, type, dat, dat1, attrstring) = m.groups();
if (dat == None):
dat = dat1
if (self.checkstamp(timestamp) == 0):
- print "Bad timestamp at", lineno, ":",
- print cpu, timestamp
+ print("Bad timestamp at", lineno, ":", end=' ')
+ print(cpu, timestamp)
continue
#
# Build the table of optional attributes
@@ -1032,7 +1033,7 @@ class KTRFile:
args = (dat, cpu, timestamp, attrs)
e = self.makeevent(group, id, type, args)
if (e == None):
- print "Unknown type", type, lineno, line,
+ print("Unknown type", type, lineno, line, end=' ')
def makeevent(self, group, id, type, args):
e = None
@@ -1098,9 +1099,9 @@ class KTRFile:
if (self.stathz != 0):
return (self.timespan() / self.ticks[0]) * int(self.stathz)
# Pretend we have a 1ns clock
- print "WARNING: No clock discovered and no frequency ",
- print "specified via the command line."
- print "Using fake 1ghz clock"
+ print("WARNING: No clock discovered and no frequency ", end=' ')
+ print("specified via the command line.")
+ print("Using fake 1ghz clock")
return (oneghz);
def fixup(self):
@@ -1624,7 +1625,7 @@ class SchedGraph(Frame):
return self.display.getstate(tag)
if (len(sys.argv) != 2 and len(sys.argv) != 3):
- print "usage:", sys.argv[0], "<ktr file> [clock freq in ghz]"
+ print("usage:", sys.argv[0], "<ktr file> [clock freq in ghz]")
sys.exit(1)
if (len(sys.argv) > 2):
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 71f3955..59a6a5d 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -161,11 +161,16 @@ NANO_SLICE_DATA=s4
#######################################################################
# Architecture to build. Corresponds to TARGET_ARCH in a buildworld.
# Unfortunately, there's no way to set TARGET at this time, and it
-# conflates the two, so architectures where TARGET != TARGET_ARCH do
-# not work. This defaults to the arch of the current machine.
+# conflates the two, so architectures where TARGET != TARGET_ARCH and
+# TARGET can't be guessed from TARGET_ARCH do not work. This defaults
+# to the arch of the current machine.
NANO_ARCH=`uname -p`
+# CPUTYPE defaults to "" which is the default when CPUTYPE isn't
+# defined.
+NANO_CPUTYPE=""
+
# Directory to populate /cfg from
NANO_CFGDIR=""
@@ -235,7 +240,7 @@ build_world ( ) (
pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw"
cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \
+ env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} ${NANO_PMAKE} \
SRCCONF=${SRCCONF} \
__MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \
> ${MAKEOBJDIRPREFIX}/_.bw 2>&1
@@ -256,9 +261,6 @@ build_kernel ( ) (
fi
cd ${NANO_SRC};
- # unset these just in case to avoid compiler complaints
- # when cross-building
- unset TARGET_CPUTYPE
# Note: We intentionally build all modules, not only the ones in
# NANO_MODULES so the built world can be reused by multiple images.
eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \
@@ -299,7 +301,7 @@ install_world ( ) (
pprint 3 "log: ${NANO_OBJ}/_.iw"
cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} \
+ env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
${NANO_MAKE} SRCCONF=${SRCCONF} \
__MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \
DESTDIR=${NANO_WORLDDIR} \
@@ -313,7 +315,7 @@ install_etc ( ) (
pprint 3 "log: ${NANO_OBJ}/_.etc"
cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} \
+ env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
${NANO_MAKE} SRCCONF=${SRCCONF} \
__MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \
DESTDIR=${NANO_WORLDDIR} \
@@ -344,7 +346,8 @@ install_kernel ( ) (
fi
cd ${NANO_SRC}
- eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \
+ eval "TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
+ ${NANO_MAKE} installkernel \
DESTDIR='${NANO_WORLDDIR}' \
SRCCONF='${SRCCONF}' \
__MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \
@@ -358,7 +361,7 @@ native_xtools ( ) (
pprint 3 "log: ${NANO_OBJ}/_.native_xtools"
cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} \
+ env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
${NANO_MAKE} SRCCONF=${SRCCONF} \
__MAKE_CONF=${NANO_MAKE_CONF_INSTALL} native-xtools \
DESTDIR=${NANO_WORLDDIR} \
diff --git a/tools/tools/shlib-compat/shlib-compat.py b/tools/tools/shlib-compat/shlib-compat.py
index c0fb2d2..2d970b5 100755
--- a/tools/tools/shlib-compat/shlib-compat.py
+++ b/tools/tools/shlib-compat/shlib-compat.py
@@ -26,6 +26,7 @@
#
# $FreeBSD$
+from __future__ import print_function
import os
import sys
import re
@@ -78,7 +79,7 @@ class App(object):
def warn(cond, msg):
if cond:
- print >> sys.stderr, "WARN: " + msg
+ print("WARN: " + msg, file=sys.stderr)
# {{{ misc
@@ -694,12 +695,12 @@ class Shlib(object):
(sym.name_ver, self.libfile, sym.offset))
continue
if Config.verbose >= 3:
- print "Parsing symbol %s (%s)" % (sym.name_ver, self.libfile)
+ print("Parsing symbol %s (%s)" % (sym.name_ver, self.libfile))
sym.definition = dwarf.build(raw)
def parse(self):
if not os.path.isfile(self.libfile):
- print >> sys.stderr, ("No such file: %s" % self.libfile)
+ print("No such file: %s" % self.libfile, file=sys.stderr)
sys.exit(1)
self.parse_objdump()
self.parse_dwarfdump()
@@ -722,7 +723,7 @@ class Parser(object):
self.parser(line)
err = fd.close()
if err:
- print >> sys.stderr, ("Execution failed: %s" % self.proc)
+ print("Execution failed: %s" % self.proc, file=sys.stderr)
sys.exit(2)
def parse_begin(self, line):
@@ -964,16 +965,16 @@ def common_symbols(origlib, newlib):
result = []
verdiff = ListDiff(origlib.versions.keys(), newlib.versions.keys())
if Config.verbose >= 1:
- print 'Original versions: ', list_str(verdiff.orig)
- print 'New versions: ', list_str(verdiff.new)
+ print('Original versions: ', list_str(verdiff.orig))
+ print('New versions: ', list_str(verdiff.new))
for vername in verdiff.added:
- print 'Added version: ', vername
- print ' Added symbols: ', \
- names_ver_str(vername, newlib.versions[vername].names())
+ print('Added version: ', vername)
+ print(' Added symbols: ', \
+ names_ver_str(vername, newlib.versions[vername].names()))
for vername in verdiff.removed:
- print 'Removed version: ', vername
- print ' Removed symbols: ', \
- names_ver_str(vername, origlib.versions[vername].names())
+ print('Removed version: ', vername)
+ print(' Removed symbols: ', \
+ names_ver_str(vername, origlib.versions[vername].names()))
added = []
removed = []
for vername in verdiff.common:
@@ -990,13 +991,13 @@ def common_symbols(origlib, newlib):
sym = CommonSymbol(origver.symbols[n], newver.symbols[n])
commonver.append(sym)
if added:
- print 'Added symbols:'
+ print('Added symbols:')
for i in added:
- print ' ', i
+ print(' ', i)
if removed:
- print 'Removed symbols:'
+ print('Removed symbols:')
for i in removed:
- print ' ', i
+ print(' ', i)
return result
def cmp_symbols(commonver):
@@ -1011,27 +1012,27 @@ def cmp_symbols(commonver):
App.result_code = 1
if Config.verbose >= 1 or not match:
if missing:
- print '%s: missing definition' % \
- (sym.origsym.name_ver,)
+ print('%s: missing definition' % \
+ (sym.origsym.name_ver,))
continue
- print '%s: definitions %smatch' % \
- (sym.origsym.name_ver, "" if match else "mis")
+ print('%s: definitions %smatch' % \
+ (sym.origsym.name_ver, "" if match else "mis"))
if Config.dump or (not match and not Config.no_dump):
for x in [(sym.origsym, Config.origfile),
(sym.newsym, Config.newfile)]:
xsym = x[0]
xout = x[1].out
if not xsym.definition:
- print >> xout, '\n// Definition not found: %s %s' % \
- (xsym.name_ver, xsym.lib.libfile)
+ print('\n// Definition not found: %s %s' % \
+ (xsym.name_ver, xsym.lib.libfile), file=xout)
continue
- print >> xout, '\n// Definitions mismatch: %s %s' % \
- (xsym.name_ver, xsym.lib.libfile)
+ print('\n// Definitions mismatch: %s %s' % \
+ (xsym.name_ver, xsym.lib.libfile), file=xout)
pp = PrettyPrinter()
pp.run(xsym.definition)
for i in pp.nested():
- print >> xout, i
- print >> xout, pp.result()
+ print(i, file=xout)
+ print(pp.result(), file=xout)
def dump_symbols(commonver):
class SymbolDump(object):
@@ -1043,13 +1044,13 @@ def dump_symbols(commonver):
r = self.pp.run(sym.definition)
self.res.append('/* %s@%s */ %s' % (sym.name, sym.version, r))
def finish(self):
- print >> self.io_conf.out, '\n// Symbol dump: version %s, library %s' % \
- (ver.name, self.io_conf.filename)
+ print('\n// Symbol dump: version %s, library %s' % \
+ (ver.name, self.io_conf.filename), file=self.io_conf.out)
for i in self.pp.nested():
- print >> self.io_conf.out, i
- print >> self.io_conf.out, ''
+ print(i, file=self.io_conf.out)
+ print('', file=self.io_conf.out)
for i in self.res:
- print >> self.io_conf.out, i
+ print(i, file=self.io_conf.out)
for ver in commonver:
names = sorted(ver.names());
d_orig = SymbolDump(Config.origfile)
@@ -1150,7 +1151,7 @@ if __name__ == '__main__':
dump_symbols(commonver)
cmp_symbols(commonver)
if Config.verbose >= 4:
- print Dwarf.cmpcache.stats.show('Cmp')
- print DwarfdumpParser.tagcache_stats.show('Dwarf tag')
+ print(Dwarf.cmpcache.stats.show('Cmp'))
+ print(DwarfdumpParser.tagcache_stats.show('Dwarf tag'))
sys.exit(App.result_code)
OpenPOWER on IntegriCloud