Skip to content

Commit

Permalink
Improve perf_stat runner error message, fix #119
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Bechberger committed Jul 22, 2020
1 parent c972086 commit 611bd1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions temci/run/run_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def get_used_plugins(self) -> t.List[str]:
"""
used = super().get_used()
for plugin in PRESET_PLUGIN_MODES[self.misc_settings["preset"]][0].split(","):
if plugin not in used and plugin is not "":
if plugin not in used and plugin != "":
used.append(plugin)
order = self.misc_settings["plugin_order"]
used = sorted(used, key=lambda plugin: order.index(plugin) if plugin in order else -1)
Expand Down Expand Up @@ -1088,13 +1088,13 @@ class PerfStatExecRunner(ExecRunner):

def __init__(self, block: RunProgramBlock):
super().__init__(block)
typecheck(self.misc["properties"], ValidPerfStatPropertyList(), "Properties setting of perf stat runner")
if not is_perf_available():
raise KeyboardInterrupt("The perf tool needed for the perf stat runner isn't installed. You can install it "
"via the linux-tools (or so) package of your distribution. If it's installed, "
"you might by only allowed to use it with super user rights. Test a simple command "
"like `perf stat /bin/echo` to see what you have to do if you want to use with "
"your current rights.")
typecheck(self.misc["properties"], ValidPerfStatPropertyList(), "Properties setting of perf stat runner")

def setup_block(self, block: RunProgramBlock, cpuset: CPUSet = None, set_id: int = 0):

Expand Down
2 changes: 1 addition & 1 deletion temci/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _func(*args, **kwargs):

def _func2(run_file, **kwargs):
Settings()["run/driver"] = driver
if run_file is not "":
if run_file != "":
Settings()["run/in"] = run_file
benchmark_and_exit()
_func2.__name__ = "temci__" + driver
Expand Down

0 comments on commit 611bd1d

Please sign in to comment.