forked from sbt/zinc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add profiling invalidation utils (zprof)
zprof is the name I've chosen for this small profiler (or tracker if you will) of the invalidation logic. The profiled data is formalized in an internal format that is not supposed to be used by normal users, but rather by us (Zinc) and related tools (Bloop). The current profiled data exposes details of how the incremental compiler works internally and how it invalidates classes. This is the realization of an idea I registered here: sbt#550 With this idea, this data will not only be useful for debugging but for providing an automatic way of reporting bugs in Zinc. The infrastructure is far from finished but it's already in a usable state for libraries that depend on Zinc directly and have direct access to `Incremental`. By default, no profiler is used. Only people that change the profiler argument for `Incremental.compile` will be able to get the run profiles.
- Loading branch information
Showing
6 changed files
with
394 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
syntax = "proto3"; | ||
|
||
package sbt.internal.inc; | ||
|
||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
///////////////////////////////////////// ZINC PROF /////////////////////////////////////////// | ||
/////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
message Profile { | ||
repeated ZincRun runs = 1; | ||
repeated string string_table = 2; | ||
} | ||
|
||
message ZincRun { | ||
InitialChanges initial = 1; | ||
repeated CycleInvalidation cycles = 3; | ||
} | ||
|
||
message CycleInvalidation { | ||
repeated int64 invalidated = 1; | ||
repeated int64 invalidatedByPackageObjects = 2; | ||
repeated int64 initialSources = 3; | ||
repeated int64 invalidatedSources = 4; | ||
repeated int64 recompiledClasses = 5; | ||
|
||
int64 startTimeNanos = 6; // Start time of compilation (UTC) as nanoseconds past the epoch | ||
int64 compilationDurationNanos = 7; // Duration of the compilation profile in nanoseconds | ||
repeated ApiChange changesAfterRecompilation = 8; | ||
|
||
repeated InvalidationEvent events = 9; | ||
repeated int64 nextInvalidations = 10; | ||
bool shouldCompileIncrementally = 11; | ||
} | ||
|
||
message InvalidationEvent { | ||
string kind = 1; | ||
repeated int64 inputs = 2; | ||
repeated int64 outputs = 3; | ||
string reason = 4; | ||
} | ||
|
||
message Changes { | ||
repeated int64 added = 1; | ||
repeated int64 removed = 2; | ||
repeated int64 modified = 3; | ||
} | ||
|
||
message ApiChange { | ||
int64 modifiedClass = 1; | ||
string reason = 2; | ||
repeated UsedName usedNames = 3; // Can be empty if the change is not related to names | ||
} | ||
|
||
message InitialChanges { | ||
Changes changes = 1; | ||
repeated int64 removedProducts = 2; | ||
repeated int64 binaryDependencies = 3; | ||
repeated ApiChange externalChanges = 4; | ||
} | ||
|
||
message UsedName { | ||
int64 name = 1; | ||
repeated Scope scopes = 2; | ||
} | ||
|
||
message Scope { | ||
int64 kind = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.