Skip to content

Commit 10bcbc6

Browse files
committed
Update artefact to draw new plots and tables
1 parent 62e3e1e commit 10bcbc6

File tree

12 files changed

+2041
-4522
lines changed

12 files changed

+2041
-4522
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ bare-metal: venv
7676
$(MEASURE_ARG)
7777

7878
process: venv
79-
@$(INVOKE) process-benchmarks
79+
@$(INVOKE) process-results
8080

8181
build-paper:
8282
docker build --progress=plain -f Dockerfile.paper --target export --output type=local,dest=./rustgc_paper -t rustgc-paper:latest .

alloy_adapter.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def __init__(self, include_faulty, executor):
2828
GaugeAdapter.__init__(self, include_faulty, executor)
2929

3030
def _create_command(self, command):
31-
return "%s -f %s %s" % (self._time_bin, AlloyAdapter.time_format, command)
31+
time = f"{self._time_bin} -f {AlloyAdapter.time_format}"
32+
return f"{time} {command}"
3233

3334
def should_enable_premature_finalizer_optimization(self, run_id):
3435
exec = run_id.benchmark.suite.executor.name
@@ -60,6 +61,13 @@ def acquire_command(self, run_id):
6061
if not self._completed_time_availability_check:
6162
self._check_which_time_command_is_available()
6263

64+
if "GC_HEAPTRACK_DIR" in run_id.env:
65+
dir = run_id.env["GC_HEAPTRACK_DIR"]
66+
bm = run_id.benchmark.name.lower()
67+
out = f"{dir}/{bm}-{run_id.completed_invocations + 1}"
68+
ht = run_id.env["HEAPTRACK_PATH"]
69+
run_id.env["GC_HEAPTRACK_ZST"] = out
70+
command = " ".join([ht, "--record-only", "-o", out, command])
6371
return self._create_command(command)
6472

6573
def _check_which_time_command_is_available(self):
@@ -118,6 +126,16 @@ def parse_data(self, data, run_id, invocation):
118126
measure = Measurement(
119127
invocation, iteration, time, "ms", run_id, "total"
120128
)
129+
130+
# if "GC_HEAPTRACK_DIR" in run_id.env:
131+
# zst = run_id.env["GC_HEAPTRACK_ZST"]
132+
# ht_print = run_id.env["HEAPTRACK_PRINT_PATH"]
133+
# subprocess.run(
134+
# [ht_print, "-M", f"{zst}.massif", f"{zst}.zst"],
135+
# stdout=subprocess.DEVNULL,
136+
# stderr=subprocess.DEVNULL,
137+
# )
138+
121139
current.add_measurement(measure)
122140
data_points.append(current)
123141
current = DataPoint(run_id)

artefacts.py

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,11 @@ def wrapper(self, *args, **kwargs):
117117

118118
@dataclass(frozen=True)
119119
class Artefact:
120-
_name: Optional[str] = None
121120
repo: Optional[Repo] = None
122-
deps: Tuple["Artefact"] = ()
123-
steps: Optional[int] = 0
124-
_src: Optional[Path] = None
125-
126-
@property
127-
def name(self) -> str:
128-
return self._name or self.repo.name
129-
130-
@property
131-
def debug_name(self) -> str:
132-
return self.name
133121

134122
@property
135123
def src(self) -> Path:
136-
return self._src or (SRC_DIR / self.repo.name)
124+
return SRC_DIR / self.repo.name
137125

138126
@property
139127
def install_prefix(self) -> Path:
@@ -161,44 +149,46 @@ def remove(self, including_src=False):
161149
self.repo.remove()
162150

163151

164-
class Crate(Artefact):
165-
@property
166-
def cargo_toml(self):
167-
return f"{self.src}/Cargo.toml"
152+
class Heaptrack(Artefact):
153+
def build(self, c):
154+
self.repo.fetch()
155+
self.build_dir.mkdir(parents=True, exist_ok=True)
156+
self.install_prefix.mkdir(parents=True, exist_ok=True)
168157

169-
@command_runner(description="Building", dry_run=DRY_RUN)
170-
def _cargo_build(self):
171-
return [
172-
"cargo",
173-
"build",
174-
"--release",
175-
"--manifest-path",
176-
self.cargo_toml,
177-
"--target-dir",
178-
self.build_dir,
158+
cmake = [
159+
"cmake",
160+
"-S",
161+
str(self.repo.src),
162+
"-B",
163+
str(self.build_dir),
164+
f"-DCMAKE_INSTALL_PREFIX={self.install_prefix}",
165+
"-DCMAKE_BUILD_TYPE=Release",
179166
]
167+
c.run(" ".join(cmake))
168+
with c.cd(self.build_dir):
169+
c.run(f"make -j install")
180170

181-
@prepare_build
182-
def build(self):
183-
self._cargo_build()
184-
for f in (self.target / "release").glob("*"):
185-
if (
186-
f.is_file()
187-
and not f.suffix in [".d", ".rlib"]
188-
and not f.name.startswith(".")
189-
):
190-
os.symlink(f, self.bin / f.name)
171+
@property
172+
def path(self) -> Path:
173+
return self.install_prefix / "bin" / "heaptrack"
191174

192175

193176
ALLOY = Artefact(
194-
steps=5907,
195177
repo=Repo(
196178
name="alloy",
197179
url="https://github.com/jacob-hughes/alloy",
198180
version="quickfix-stats",
199181
),
200182
)
201183

184+
HEAPTRACK = Heaptrack(
185+
repo=Repo(
186+
name="heaptrack",
187+
url="https://github.com/kde/heaptrack",
188+
version="master",
189+
),
190+
)
191+
202192
LINUX = Repo(
203193
name="linux",
204194
url="https://github.com/BurntSushi/linux",

0 commit comments

Comments
 (0)