diff --git a/infra/nightly-resources/handlers.js b/infra/nightly-resources/handlers.js index fe607a19..dd156e89 100644 --- a/infra/nightly-resources/handlers.js +++ b/infra/nightly-resources/handlers.js @@ -28,6 +28,10 @@ async function load_llvm() { const benchmark = params.get("benchmark"); const runMode = params.get("runmode"); + document.title = `${benchmark} | ${runMode}`; + document.getElementById("llvm-header").innerText = + `Benchmark: ${benchmark} | Run Mode: ${runMode}`; + if (!benchmark || !runMode) { console.error("missing query params, this probably shouldn't happen"); return; @@ -59,16 +63,21 @@ function selectAllModes(enabled) { refreshView(); } -function selectAllBenchmarks(enabled) { +function selectAllBenchmarks(enabled, category) { const checkboxContainer = document.getElementById("benchmarkCheckboxes"); - Array.from(checkboxContainer.getElementsByTagName("input")).forEach( - (checkbox) => { - checkbox.checked = enabled; - enabled - ? GLOBAL_DATA.enabledBenchmarks.add(checkbox.id) - : GLOBAL_DATA.enabledBenchmarks.delete(checkbox.id); - }, - ); + let checkboxes = Array.from(checkboxContainer.getElementsByTagName("input")); + if (category === "looped") { + const loopedBenchmarks = new Set( + GLOBAL_DATA.currentRun.filter((x) => x.looped).map((x) => x.benchmark), + ); + checkboxes = checkboxes.filter((x) => loopedBenchmarks.has(x.id)); + } + checkboxes.forEach((checkbox) => { + checkbox.checked = enabled; + enabled + ? GLOBAL_DATA.enabledBenchmarks.add(checkbox.id) + : GLOBAL_DATA.enabledBenchmarks.delete(checkbox.id); + }); refreshView(); } diff --git a/infra/nightly-resources/index.html b/infra/nightly-resources/index.html index 2ebbc037..1974ebcb 100644 --- a/infra/nightly-resources/index.html +++ b/infra/nightly-resources/index.html @@ -57,8 +57,11 @@

Profile

Benchmarks

- - + + +
+ +
diff --git a/infra/nightly-resources/llvm.html b/infra/nightly-resources/llvm.html index ccc30d74..9edb9d41 100644 --- a/infra/nightly-resources/llvm.html +++ b/infra/nightly-resources/llvm.html @@ -12,7 +12,7 @@ LLVM -

LLVM

+

LLVM

diff --git a/infra/profile.py b/infra/profile.py index d49584ed..d227df87 100755 --- a/infra/profile.py +++ b/infra/profile.py @@ -105,17 +105,21 @@ def should_have_llvm_ir(runMethod): ] # aggregate all profile info into a single json array. -def aggregate(compile_times, bench_times): +def aggregate(compile_times, bench_times, looped): res = [] for path in sorted(compile_times.keys()): name = path.split("/")[-2] runMethod = path.split("/")[-1] - result = {"runMethod": runMethod, "benchmark": name, "hyperfine": bench_times[path], "compileTime": compile_times[path]} + result = {"runMethod": runMethod, "benchmark": name, "hyperfine": bench_times[path], "compileTime": compile_times[path], "looped": looped[name]} res.append(result) return res +def is_looped(bril_file): + with open(bril_file) as f: + txt = f.read() + return "orig_main" in txt if __name__ == '__main__': # expect two arguments @@ -138,6 +142,11 @@ def aggregate(compile_times, bench_times): else: profiles = [bril_dir] + looped = {} + for profile in profiles: + name = profile.split("/")[-1][:-len(".bril")] + looped[name] = is_looped(profile) + to_run = [] index = 0 total = len(profiles) * len(treatments) @@ -181,7 +190,7 @@ def aggregate(compile_times, bench_times): (path, _bench_data) = res bench_data[path] = _bench_data - nightly_data = aggregate(compile_times, bench_data) + nightly_data = aggregate(compile_times, bench_data, looped) with open(f"{DATA_DIR}/profile.json", "w") as profile: json.dump(nightly_data, profile, indent=2)