Permalink
Browse files

Add pin binaries to build outputs.

Changed XIOSIM_INSTALL to follow the structure of bazel-bin.
Removed PIN_ROOT (literally no more deps to install or setup).

Updated non-ROI integration test golden values: apparently invoking
pinbin directly (not through pin.sh) gives us 4K less instructions.

Change-Id: I71dfcf92330d2538a18b7d0a6ccc8ee019460511
  • Loading branch information...
s-kanev committed Nov 10, 2015
1 parent 2e4cc98 commit 362960a373fcd53f3e38d409a79b201e4961653a
Showing with 61 additions and 19 deletions.
  1. +1 −1 benchmarks.cfg
  2. +4 −1 run.sh
  3. +6 −7 scripts/run_tests.py
  4. +7 −10 scripts/xiosim_driver.py
  5. +42 −0 third_party/pin.BUILD
  6. +1 −0 xiosim/BUILD
View
@@ -14,7 +14,7 @@
*/
program {
exe = "tests/fib"
exe = "tests/k8/fib"
args = "> fib.out 2> fib.err"
instances = 1
}
View
5 run.sh
@@ -1,6 +1,9 @@
#!/bin/bash
PIN=bazel-xiosim/external/pin/pin-2.14-67254-gcc.4.4.7-linux/pin.sh
PIN_PATH=bazel-bin/external/pin
export PIN_VM_LD_LIBRARY_PATH=${PIN_PATH}
PIN=${PIN_PATH}/pinbin
BIN_PATH=bazel-bin/xiosim/pintool
PINTOOL=${BIN_PATH}/feeder_zesto.so
ZESTOCFG=xiosim/config/N.cfg
View
@@ -15,9 +15,8 @@
def CreateDriver():
XIOSIM_INSTALL = os.environ["XIOSIM_INSTALL"]
XIOSIM_TREE = os.environ["XIOSIM_TREE"]
PIN_ROOT = os.environ["PIN_ROOT"]
ARCH = os.environ["TARGET_ARCH"]
xio = xd.XIOSimDriver(PIN_ROOT, XIOSIM_INSTALL, XIOSIM_TREE, ARCH)
xio = xd.XIOSimDriver(XIOSIM_INSTALL, XIOSIM_TREE, ARCH)
return xio
@@ -98,7 +97,7 @@ def setDriverParams(self):
def setUp(self):
super(Fib1Test, self).setUp()
self.expected_vals.append((xs.PerfStatRE("all_insn"), 118369.0))
self.expected_vals.append((xs.PerfStatRE("all_insn"), 114495.0))
def runTest(self):
self.runAndValidate()
@@ -117,7 +116,7 @@ def setDriverParams(self):
def setUp(self):
super(NoneTest, self).setUp()
self.expected_vals.append((xs.PerfStatRE("all_insn"), 118369.0))
self.expected_vals.append((xs.PerfStatRE("all_insn"), 114495.0))
def runTest(self):
self.runAndValidate()
@@ -157,7 +156,7 @@ def setDriverParams(self):
def setUp(self):
super(Fib1SkipTest, self).setUp()
self.expected_vals.append((xs.PerfStatRE("all_insn"), 68369.0))
self.expected_vals.append((xs.PerfStatRE("all_insn"), 64495.0))
def runTest(self):
self.runAndValidate()
@@ -201,7 +200,7 @@ def setDriverParams(self):
def setUp(self):
super(Fib1PinPointsTest, self).setUp()
self.expected_vals.append((xs.PerfStatRE("all_insn"), 10100.0))
self.expected_vals.append((xs.PerfStatRE("all_insn"), 9430.0))
def runTest(self):
self.runAndValidate()
@@ -330,7 +329,7 @@ def setDriverParams(self):
def setUp(self):
super(Fib2Test, self).setUp()
self.expected_vals.append((xs.PerfStatRE("all_insn"), 236483.00))
self.expected_vals.append((xs.PerfStatRE("all_insn"), 228990.00))
def runTest(self):
self.runAndValidate()
View
@@ -3,23 +3,20 @@
import subprocess
class XIOSimDriver(object):
def __init__(self, PIN_ROOT, INSTALL_DIR, TREE_DIR, TARGET_ARCH, clean_arch=None, env=None):
def __init__(self, INSTALL_DIR, TREE_DIR, TARGET_ARCH, clean_arch=None, env=""):
''' TARGET_ARCH uses bazel notation. "piii" is ia32, "k8" is ia64.
'''
self.cmd = ""
#self.PIN = os.path.join(TREE_DIR, "bazel-xiosim/external/pin/pin-2.14-67254-gcc.4.4.7-linux/pin.sh")
# Ugh, we still need PIN_ROOT. Apparently the "bazel-xiosim" symlink above is
# actually "bazel-{cwd}", so it will change if we checkout under a different
# directory. TODO: Figure out a way around this.
self.PIN = os.path.join(PIN_ROOT, "pin.sh")
self.INSTALL_DIR = INSTALL_DIR
self.PIN_DIR = os.path.join(INSTALL_DIR, "external/pin")
self.PIN = os.path.join(self.PIN_DIR, "pinbin")
env = "PIN_VM_LD_LIBRARY_PATH=%s;%s" % (self.PIN_DIR, env)
self.TREE_DIR = TREE_DIR
self.TARGET_ARCH = TARGET_ARCH
self.test = ""
if clean_arch:
self.AddCleanArch()
if env:
self.AddEnvironment(env)
self.AddEnvironment(env)
self.AddHarness()
def AddCleanArch(self):
@@ -33,7 +30,7 @@ def AddEnvironment(self, env):
self.cmd += "/usr/bin/env -i " + env + " "
def AddHarness(self):
self.cmd += os.path.join(self.INSTALL_DIR, "harness") + " "
self.cmd += os.path.join(self.INSTALL_DIR, "xiosim/pintool/harness") + " "
def AddBmks(self, bmk_cfg):
self.cmd += "-benchmark_cfg " + bmk_cfg + " "
@@ -43,7 +40,7 @@ def AddPinOptions(self):
self.cmd += "-xyzzy "
self.cmd += "-pause_tool 1 "
self.cmd += "-catch_signals 0 "
self.cmd += "-t " + os.path.join(self.INSTALL_DIR, "feeder_zesto.so") + " "
self.cmd += "-t " + os.path.join(self.INSTALL_DIR, "xiosim/pintool/feeder_zesto.so") + " "
def AddPintoolOptions(self, num_cores):
self.cmd += "-num_cores %d " % num_cores
View
@@ -47,6 +47,48 @@ cc_library(
}),
)
filegroup(
name = "pin_ext_libs",
srcs = select({
":k8" : [
PIN_PATH + "/intel64/lib-ext/libelf.so",
PIN_PATH + "/intel64/lib-ext/libdwarf.so"
],
":piii" : [
PIN_PATH + "/ia32/lib-ext/libelf.so",
PIN_PATH + "/ia32/lib-ext/libdwarf.so"
],
}),
)
filegroup(
name = "pin_bin",
srcs = select({
":k8" : [ PIN_PATH + "/intel64/bin/pinbin" ],
":piii" : [ PIN_PATH + "/ia32/bin/pinbin" ],
}),
)
# We want symlinks instead of copying, but
# "Bazel doesn't copy over the directory/symlink structure created by genrules"
genrule(
visibility = ["//visibility:public"],
name = "cp_pinbin",
outs = [ "pinbin", "libelf.so", "libdwarf.so", "libelf.so.0", "libdwarf.so.0" ],
srcs = [
":pin_ext_libs",
":pin_bin"
],
cmd = "OUT_DIR=$$(dirname `echo $(OUTS) | cut -d\" \" -f 1`);" +
"for f in $(locations :pin_ext_libs); do " +
"cp $$f $${OUT_DIR}/$$(basename $$f);" +
"cp $$f $${OUT_DIR}/$$(basename $$f).0;" +
"done; " +
"cp $(location :pin_bin) $${OUT_DIR}/",
output_to_bindir = 1,
)
config_setting(
name = "k8",
values = { "cpu" : "k8" }
View
@@ -6,6 +6,7 @@ filegroup(
"//xiosim/pintool:timing_sim",
"//xiosim/pintool:feeder_zesto.so",
"//xiosim/pintool:harness",
"@pin//:cp_pinbin",
],
)

0 comments on commit 362960a

Please sign in to comment.