Commit dcc3669
Report CPU and wall times in profiler output for build commands again.
This was broken in bazelbuild@cb42a1d. The reason is that MetricsCollector assumed that the profiler was active while calling finishTimingMetrics(), which used to be the case before that change. However, that change made finishTimingMetrics() be called in CommandPrecompleteEvent and (somewhat confusingly) BuildSummaryStatsModule shuts down the profiler in BuildCompleteEvent, which happens before.
Ideally, we'd shut down the profiler at the last minute, but we can't do that because we publish the profiler data to the BEP, which in turn shuts down in BuildCompleteEvent. So we must shut down the profiler in BuildCompleteEvent, but that doesn't happen on non-build commands so we must also shut it down some place that is called on every command. This of course means that we lose profiler events between BuildCompleteEvent and the actual end of the command.
The profiler is changed so that timing data is available after .stop(), which makes MetricsCollector work again.
RELNOTES: None.
PiperOrigin-RevId: 671727112
Change-Id: Ibf336a7a387449a3edbaffb3d399e5b5e9ed0ff41 parent 09fe68a commit dcc3669
File tree
5 files changed
+59
-49
lines changed- src
- main/java/com/google/devtools/build/lib
- metrics
- profiler
- runtime
- test
- java/com/google/devtools/build/lib/profiler
- shell/integration
5 files changed
+59
-49
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| |||
Lines changed: 48 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
| 310 | + | |
310 | 311 | | |
311 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| |||
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
379 | | - | |
| 383 | + | |
| 384 | + | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
| |||
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
404 | 407 | | |
405 | 408 | | |
406 | 409 | | |
| |||
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
| |||
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
487 | | - | |
| 488 | + | |
488 | 489 | | |
| 490 | + | |
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
| |||
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
556 | | - | |
| 558 | + | |
557 | 559 | | |
558 | 560 | | |
559 | 561 | | |
560 | 562 | | |
561 | | - | |
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
570 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
571 | 588 | | |
572 | | - | |
573 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
574 | 593 | | |
575 | 594 | | |
576 | 595 | | |
| |||
583 | 602 | | |
584 | 603 | | |
585 | 604 | | |
586 | | - | |
| 605 | + | |
587 | 606 | | |
588 | 607 | | |
589 | 608 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
733 | 732 | | |
734 | 733 | | |
735 | 734 | | |
736 | 735 | | |
737 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
738 | 740 | | |
739 | 741 | | |
740 | 742 | | |
| |||
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | 736 | | |
751 | 737 | | |
752 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1478 | 1478 | | |
1479 | 1479 | | |
1480 | 1480 | | |
| 1481 | + | |
1481 | 1482 | | |
| 1483 | + | |
1482 | 1484 | | |
1483 | | - | |
| 1485 | + | |
| 1486 | + | |
1484 | 1487 | | |
1485 | 1488 | | |
1486 | 1489 | | |
| |||
0 commit comments