Commit 178ae8e
committed
Auto merge of #1791 - Aaron1011:measureme, r=RalfJung
Add `measureme` integration for profiling the interpreted program
This PR uses the `measureme` crate to profile the call stack of the
program being interpreted by Miri. This is accomplished by starting a
measureme 'event' when we enter a function call, and ending the event
when we exit the call. The `measureme` tooling can be used to produce a
call stack from the generated profile data.
Limitations:
* We currently record every single entry/exit. This might generate very
large profile outputs for programs with a large number of function
calls. In follow-up work, we might want to explore sampling (e.g. only
recording every N function calls).
* This does not integrate very well with Miri's concurrency support.
Each event we record starts when we push a frame, and ends when we pop
a frame. As a result, the timing recorded for a particular frame will include all of the work Miri does before that frame completes, including executing another thread.
The `measureme` integration is off by default, and must be enabled via
`-Zmiri-measureme=<output_name>`File tree
6 files changed
+156
-12
lines changed- src
- bin
6 files changed
+156
-12
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
227 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
95 | | - | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
| |||
270 | 284 | | |
271 | 285 | | |
272 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
273 | 294 | | |
274 | 295 | | |
275 | 296 | | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 297 | + | |
281 | 298 | | |
282 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
| |||
288 | 308 | | |
289 | 309 | | |
290 | 310 | | |
291 | | - | |
292 | | - | |
| 311 | + | |
| 312 | + | |
293 | 313 | | |
294 | 314 | | |
295 | 315 | | |
296 | 316 | | |
297 | 317 | | |
298 | 318 | | |
| 319 | + | |
| 320 | + | |
299 | 321 | | |
300 | 322 | | |
301 | 323 | | |
| |||
597 | 619 | | |
598 | 620 | | |
599 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
600 | 637 | | |
601 | 638 | | |
602 | 639 | | |
603 | 640 | | |
604 | | - | |
| 641 | + | |
| 642 | + | |
605 | 643 | | |
606 | 644 | | |
607 | 645 | | |
| |||
625 | 663 | | |
626 | 664 | | |
627 | 665 | | |
628 | | - | |
| 666 | + | |
629 | 667 | | |
630 | 668 | | |
631 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
632 | 675 | | |
633 | 676 | | |
634 | 677 | | |
| |||
0 commit comments