|
59 | 59 | src = ./.; |
60 | 60 | }; |
61 | 61 |
|
| 62 | + sdqlFlamegraph = lake.mkPackage { |
| 63 | + name = "flamegraph"; |
| 64 | + src = ./.; |
| 65 | + }; |
| 66 | + |
62 | 67 | # Wrapper script that sets up datasets for tests and runs the Lean test runner. |
63 | 68 | # TPCH reference binaries are built on-demand by `Tests/Main.lean`. |
64 | 69 | sdqlTestsWithRef = pkgs.writeShellApplication { |
|
123 | 128 | exec ${sdqlOptPerf}/bin/optimisationPerformanceComparison "$@" |
124 | 129 | ''; |
125 | 130 | }; |
| 131 | + |
| 132 | + flamegraphRunner = pkgs.writeShellApplication { |
| 133 | + name = "flamegraph"; |
| 134 | + runtimeInputs = |
| 135 | + [ rustToolchain pkgs.cargo-flamegraph ] |
| 136 | + ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.linuxPackages.perf ]; |
| 137 | + text = '' |
| 138 | + set -euo pipefail |
| 139 | +
|
| 140 | + if [ ! -f "sdql_runtime.rs" ]; then |
| 141 | + echo "Error: must be run from the project root directory (sdql_runtime.rs not found)" >&2 |
| 142 | + exit 1 |
| 143 | + fi |
| 144 | +
|
| 145 | + if [ ! -d "datasets/tpch-tiny" ]; then |
| 146 | + echo "Error: datasets/tpch-tiny not found" >&2 |
| 147 | + exit 1 |
| 148 | + fi |
| 149 | +
|
| 150 | + if [ ! -d "sdql-rs/datasets/tpch_datasets/SF_0.01" ]; then |
| 151 | + echo "Error: sdql-rs/datasets/tpch_datasets/SF_0.01 not found" >&2 |
| 152 | + exit 1 |
| 153 | + fi |
| 154 | +
|
| 155 | + exec ${sdqlFlamegraph}/bin/flamegraph "$@" |
| 156 | + ''; |
| 157 | + }; |
126 | 158 | # Runtime tools shared by sdql reference test runners |
127 | 159 | sdqlRefRuntimeInputs = with pkgs; [ |
128 | 160 | # JVM + Scala toolchain |
|
218 | 250 | sdql-tests-bare = sdqlTests; |
219 | 251 | performanceComparison = performanceComparison; |
220 | 252 | optimisationPerformanceComparison = optimisationPerformanceComparison; |
| 253 | + flamegraph = flamegraphRunner; |
221 | 254 | sdql-reference-tests = sdqlRefTestRunner; |
222 | 255 | sdql-reference-tpch-0_01 = sdqlRefTPCH001; |
223 | 256 | sdql-reference-tpch-1 = sdqlRefTPCH1; |
|
257 | 290 | type = "app"; |
258 | 291 | program = "${optimisationPerformanceComparison}/bin/optimisationPerformanceComparison"; |
259 | 292 | }; |
| 293 | + flamegraph = { |
| 294 | + type = "app"; |
| 295 | + program = "${flamegraphRunner}/bin/flamegraph"; |
| 296 | + }; |
260 | 297 | }; |
261 | 298 |
|
262 | 299 | devShells.default = pkgs.mkShell { |
|
0 commit comments