Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions perf_trigger/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ def reset_running_gcpt(self):
num += 1
gcpt.stdout_path.unlink()
gcpt.stderr_path.unlink()
gcpt.db_path.unlink(missing_ok=True)
gcpt.result_path.rmdir()
gcpt.clear_state()
logging.info("Reset %d RUNNING GCPTs", num)
Expand Down Expand Up @@ -517,6 +518,11 @@ def main():
default="",
help="Path to custom constantin file path (empty for default init setting)",
)
parser.add_argument(
"--dump-db",
action="store_true",
help="Run emu with --dump-db and store simulator.db in each checkpoint result directory",
)

# report configs
parser.add_argument(
Expand Down Expand Up @@ -674,6 +680,7 @@ def main():
max_instr=args.max_instr,
threads=args.threads,
cst_file=cst_file,
dump_db=args.dump_db,
dry_run=args.dry_run,
),
)
Expand Down
4 changes: 4 additions & 0 deletions perf_trigger/modules/gcpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def stdout_path(self) -> Path:
def stderr_path(self) -> Path:
return self.__result_path / "simulator_err.txt"

@property
def db_path(self) -> Path:
return self.__result_path / "simulator.db"

def refresh_state(self) -> "GCPT.State":
if (
not self.stdout_path.exists()
Expand Down
9 changes: 9 additions & 0 deletions perf_trigger/modules/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,15 @@ def run_gcpt(
if emu_config.cst_file
else []
)
+ (
[
"--dump-db",
"--db-path",
shlex.quote(str(gcpt.db_path)),
]
if emu_config.dump_db
else []
)
)
if emu_config.dry_run:
cmd_str = " ".join(run_cmd)
Expand Down
1 change: 1 addition & 0 deletions perf_trigger/modules/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EmuConfig:
threads: int
with_numactl: bool = True
cst_file: Path | None = None
dump_db: bool = False
dry_run: bool = False


Expand Down